the issues reported by phpcs

Created on 26 February 2024, 10 months ago
Updated 7 March 2024, 10 months ago

Running phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml shows the following errors/warnings that should be fixed.

FILE: D:\xampp\htdocs\drupal9\web\modules\user_node_access\README.txt
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
1 | WARNING | Line exceeds 80 characters; contains 91 characters
----------------------------------------------------------------------

FILE: D:\xampp\htdocs\drupal9\web\modules\user_node_access\user_node_access.install
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 4 WARNINGS AFFECTING 5 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
3 | WARNING | [x] Unused use statement
11 | WARNING | [ ] Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for
| | xyz-bar.html.twig.", "* Implements hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or "* Implements hook_foo_BAR_ID_bar() for block templates."
34 | WARNING | [x] A comma should follow the last multiline array item. Found: ''
44 | WARNING | [ ] Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for
| | xyz-bar.html.twig.", "* Implements hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or "* Implements hook_foo_BAR_ID_bar() for block templates."
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: D:\xampp\htdocs\drupal9\web\modules\user_node_access\user_node_access.module
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 45 ERRORS AND 26 WARNINGS AFFECTING 48 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
3 | ERROR | [ ] Missing short description in doc comment
7 | WARNING | [x] Unused use statement
7 | ERROR | [x] When importing a class with "use", do not include a leading \
8 | WARNING | [x] Unused use statement
8 | ERROR | [x] When importing a class with "use", do not include a leading \
9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\FormStateInterface.
9 | ERROR | [x] When importing a class with "use", do not include a leading \
10 | WARNING | [x] Unused use statement
12 | WARNING | [x] Unused use statement
14 | WARNING | [x] Unused use statement
16 | WARNING | [x] Unused use statement
17 | WARNING | [x] Unused use statement
18 | WARNING | [x] Unused use statement
18 | ERROR | [x] There must be one blank line after the last USE statement; 2 found;
22 | WARNING | [ ] Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for
| | xyz-bar.html.twig.", "* Implements hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or "* Implements hook_foo_BAR_ID_bar() for block templates."
24 | ERROR | [x] Expected 1 blank line before function; 2 found
29 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
39 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
43 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
76 | ERROR | [x] Function comment short description must start with exactly one space
76 | ERROR | [x] Doc comment short description must end with a full stop
80 | WARNING | [ ] Line exceeds 80 characters; contains 226 characters
81 | WARNING | [ ] Line exceeds 80 characters; contains 113 characters
81 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
82 | WARNING | [ ] Line exceeds 80 characters; contains 117 characters
82 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
83 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
85 | ERROR | [x] No space found before comment text; expected "// die;" but found "//die;"
85 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
86 | WARNING | [ ] Line exceeds 80 characters; contains 116 characters
86 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
87 | WARNING | [ ] Line exceeds 80 characters; contains 107 characters
87 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
88 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
90 | WARNING | [ ] Line exceeds 80 characters; contains 110 characters
90 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
91 | WARNING | [ ] Line exceeds 80 characters; contains 106 characters
91 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
92 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
94 | WARNING | [ ] Line exceeds 80 characters; contains 224 characters
94 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
95 | WARNING | [ ] Line exceeds 80 characters; contains 110 characters
95 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
96 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
98 | WARNING | [x] There must be no blank line following an inline comment
98 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
98 | ERROR | [x] No space found before comment text; expected "// dump($access_allow['scheduler']);die;" but found "//dump($access_allow['scheduler']);die;"
98 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
100 | WARNING | [x] There must be no blank line following an inline comment
100 | ERROR | [x] No space found before comment text; expected "// dump($access_allow['scheduler']['start']);die;" but found
| | "//dump($access_allow['scheduler']['start']);die;"
100 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
102 | WARNING | [ ] Line exceeds 80 characters; contains 99 characters
103 | WARNING | [ ] Line exceeds 80 characters; contains 116 characters
103 | ERROR | [ ] Comment indentation error, expected only 1 spaces
104 | WARNING | [ ] Line exceeds 80 characters; contains 118 characters
104 | ERROR | [ ] Comment indentation error, expected only 3 spaces
106 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
110 | ERROR | [x] Function comment short description must start with exactly one space
110 | ERROR | [x] Doc comment short description must end with a full stop
133 | WARNING | [ ] Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for
| | xyz-bar.html.twig.", "* Implements hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or "* Implements hook_foo_BAR_ID_bar() for block templates."
135 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
144 | WARNING | [ ] Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for
| | xyz-bar.html.twig.", "* Implements hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or "* Implements hook_foo_BAR_ID_bar() for block templates."
146 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
156 | WARNING | [ ] Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for
| | xyz-bar.html.twig.", "* Implements hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or "* Implements hook_foo_BAR_ID_bar() for block templates."
161 | ERROR | [x] Expected one space after the comma, 0 found
162 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
162 | ERROR | [x] Object operator not indented correctly; expected 6 spaces but found 4
163 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
164 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
165 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India jayprakash.kushwah India

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024