Coding Standard Issues

Created on 15 February 2023, almost 2 years ago

Problem/Motivation

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Needs review

Version

1.0

Component

Code

Created by

🇮🇳India sidharth_soman Bangalore

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @sidharth_soman
  • Status changed to Needs work almost 2 years ago
  • 🇮🇳India sidharth_soman Bangalore

    I am finding the following issues using php codesniffer. I am working on them.

    FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\user_private_fields-3341813\README.txt
    --------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 7 WARNINGS AFFECTING 7 LINES
    --------------------------------------------------------------------------------------------------
     14 | WARNING | Line exceeds 80 characters; contains 84 characters
     38 | WARNING | Line exceeds 80 characters; contains 87 characters
     39 | WARNING | Line exceeds 80 characters; contains 108 characters
     53 | WARNING | Line exceeds 80 characters; contains 81 characters
     54 | WARNING | Line exceeds 80 characters; contains 83 characters
     55 | WARNING | Line exceeds 80 characters; contains 86 characters
     56 | WARNING | Line exceeds 80 characters; contains 84 characters
    --------------------------------------------------------------------------------------------------
    
    
    FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\user_private_fields-3341813\user_private_fields.info.yml
    --------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
    --------------------------------------------------------------------------------------------------------------------
     1 | WARNING | "core_version_requirement" property is missing in the info.yml file
     7 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
     8 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
    --------------------------------------------------------------------------------------------------------------------
    
    
    FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\user_private_fields-3341813\user_private_fields.install
    -------------------------------------------------------------------------------------------------------------------
    FOUND 10 ERRORS AFFECTING 10 LINES
    -------------------------------------------------------------------------------------------------------------------
      1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
     12 | ERROR | [x] Short array syntax must be used to define arrays
     13 | ERROR | [x] Short array syntax must be used to define arrays
     14 | ERROR | [x] Short array syntax must be used to define arrays
     19 | ERROR | [x] Short array syntax must be used to define arrays
     24 | ERROR | [x] Short array syntax must be used to define arrays
     30 | ERROR | [x] Short array syntax must be used to define arrays
     37 | ERROR | [x] Short array syntax must be used to define arrays
     38 | ERROR | [x] Short array syntax must be used to define arrays
     39 | ERROR | [x] Short array syntax must be used to define arrays
    -------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------------------------------------------
    
    
    FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\user_private_fields-3341813\user_private_fields.module
    ------------------------------------------------------------------------------------------------------------------------
    FOUND 37 ERRORS AND 19 WARNINGS AFFECTING 35 LINES
    ------------------------------------------------------------------------------------------------------------------------
       1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
      10 | WARNING | [x] Unused use statement
      11 | WARNING | [x] Unused use statement
      12 | WARNING | [x] Unused use statement
      13 | WARNING | [x] Unused use statement
      22 | WARNING | [ ] Hook implementations should not duplicate @param documentation
      22 | ERROR   | [ ] Missing parameter comment
      22 | ERROR   | [ ] Missing parameter type
      23 | WARNING | [ ] Hook implementations should not duplicate @param documentation
      23 | ERROR   | [ ] Missing parameter comment
      24 | WARNING | [ ] Hook implementations should not duplicate @return documentation
      24 | ERROR   | [x] Separate the @param and @return sections by a blank line.
      24 | ERROR   | [ ] Description for the @return value is missing
      25 | ERROR   | [x] There must be no blank lines after the function comment
      41 | WARNING | [ ] Hook implementations should not duplicate @param documentation
      41 | ERROR   | [ ] Missing parameter comment
      41 | ERROR   | [ ] Missing parameter type
      42 | WARNING | [ ] Hook implementations should not duplicate @param documentation
      42 | ERROR   | [ ] Missing parameter comment
      43 | ERROR   | [x] There must be no blank lines after the function comment
      53 | WARNING | [ ] Avoid backslash escaping in translatable strings when possible, use "" quotes instead
      60 | WARNING | [ ] Line exceeds 80 characters; contains 85 characters
      64 | ERROR   | [x] Data types in @param tags need to be fully namespaced
      66 | ERROR   | [x] There must be no blank lines after the function comment
      68 | ERROR   | [ ] Type hint "array" missing for $form
      89 | WARNING | [ ] Hook implementations should not duplicate @param documentation
      89 | ERROR   | [ ] Missing parameter comment
      89 | ERROR   | [ ] Missing parameter type
      90 | WARNING | [ ] Hook implementations should not duplicate @param documentation
      90 | ERROR   | [ ] Missing parameter comment
      91 | ERROR   | [x] There must be no blank lines after the function comment
     125 | ERROR   | [ ] Missing short description in doc comment
     126 | ERROR   | [ ] Missing parameter comment
     126 | ERROR   | [ ] Missing parameter type
     127 | ERROR   | [ ] Missing parameter comment
     146 | ERROR   | [ ] Missing short description in doc comment
     147 | ERROR   | [ ] Missing parameter comment
     147 | ERROR   | [ ] Missing parameter type
     148 | ERROR   | [ ] Missing parameter comment
     149 | ERROR   | [x] There must be no blank lines after the function comment
     163 | WARNING | [x] A comma should follow the last multiline array item. Found: $is_private
     189 | WARNING | [ ] Hook implementations should not duplicate @param documentation
     189 | ERROR   | [ ] Missing parameter comment
     189 | ERROR   | [ ] Missing parameter type
     190 | WARNING | [ ] Hook implementations should not duplicate @param documentation
     190 | ERROR   | [ ] Missing parameter comment
     191 | WARNING | [ ] Hook implementations should not duplicate @param documentation
     191 | ERROR   | [ ] Missing parameter comment
     192 | WARNING | [ ] Hook implementations should not duplicate @param documentation
     192 | ERROR   | [ ] Missing parameter comment
     192 | ERROR   | [x] Expected "\Drupal\Core\Field\FieldItemListInterface|null" but found
         |         |     "\Drupal\Core\Field\FieldItemListInterface|NULL" for parameter type
     193 | WARNING | [ ] Hook implementations should not duplicate @return documentation
     193 | ERROR   | [x] Separate the @param and @return sections by a blank line.
     193 | ERROR   | [ ] Description for the @return value is missing
     194 | ERROR   | [x] There must be no blank lines after the function comment
     237 | ERROR   | [x] Doc comment short description must end with a full stop
    ------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 17 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------
    
    Time: 485ms; Memory: 6MB
    
  • @sidharth_soman opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review almost 2 years ago
  • 🇮🇳India sidharth_soman Bangalore

    I have solved most of the issues. The ones remaining are to do with parameter/method doc comments which someone with good understanding of the module should fill in.

    Please review the above MR.

Production build 0.71.5 2024