Fix coding standards issues

Created on 10 May 2023, about 1 year ago
Updated 20 February 2024, 4 months ago

Problem/Motivation

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\taxonomy_term_depth\constants.inc
------------------------------------------------------------------------------------------------------------------------------
FOUND 8 ERRORS AND 1 WARNING AFFECTING 6 LINES
------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
4 | ERROR | [x] Doc comment short description must end with a full stop
12 | ERROR | [x] Doc comment short description must end with a full stop
14 | WARNING | [ ] There must be no blank line following an inline comment
14 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
14 | ERROR | [x] Comments may not appear after statements
17 | ERROR | [x] Doc comment short description must end with a full stop
22 | ERROR | [x] Doc comment short description must end with a full stop
------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\taxonomy_term_depth\includes\taxonomy_term_depth_handler_field_taxonomy.inc
---------------------------------------------------------------------------------------------------------------------------------------
FOUND 19 ERRORS AND 1 WARNING AFFECTING 13 LINES
---------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
7 | ERROR | [x] There must be exactly one blank line after the file comment
7 | ERROR | [x] Additional blank lines found at end of doc comment
8 | ERROR | [x] Missing class doc comment
8 | ERROR | [ ] Class name must begin with a capital letter
8 | ERROR | [ ] Class name must use UpperCamel naming without underscores
16 | ERROR | [x] Visibility must be declared on method "construct"
21 | ERROR | [x] Missing function doc comment
21 | ERROR | [ ] Method name "taxonomy_term_depth_handler_field_taxonomy::option_definition" is not in lowerCamel format
21 | ERROR | [x] Visibility must be declared on method "option_definition"
28 | ERROR | [x] Doc comment short description must end with a full stop
30 | ERROR | [ ] Method name "taxonomy_term_depth_handler_field_taxonomy::options_form" is not in lowerCamel format
30 | ERROR | [x] Visibility must be declared on method "options_form"
33 | WARNING | [ ] Avoid backslash escaping in translatable strings when possible, use "" quotes instead
43 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
47 | ERROR | [ ] Method name "taxonomy_term_depth_handler_field_taxonomy::render_link" is not in lowerCamel format
47 | ERROR | [x] Visibility must be declared on method "render_link"
54 | ERROR | [x] Use null coalesce operator instead of ternary operator.
80 | ERROR | [x] Expected 1 blank line after function; 0 found
81 | ERROR | [x] The closing brace for the class must have an empty line before it
---------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 13 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\taxonomy_term_depth\includes\taxonomy_term_depth_handler_filter_has_children.inc
--------------------------------------------------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
8 | ERROR | [x] There must be exactly one blank line after the file comment
9 | ERROR | [x] Missing class doc comment
9 | ERROR | [ ] Class name must begin with a capital letter
9 | ERROR | [ ] Class name must use UpperCamel naming without underscores
11 | ERROR | [x] Missing function doc comment
11 | ERROR | [x] Visibility must be declared on method "query"
--------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\taxonomy_term_depth\taxonomy_term_depth.batch.inc
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 16 ERRORS AND 2 WARNINGS AFFECTING 15 LINES
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
2 | ERROR | [ ] Missing short description in doc comment
7 | ERROR | [x] Doc comment short description must end with a full stop
11 | ERROR | [x] Missing function doc comment
23 | ERROR | [x] Missing function doc comment
24 | ERROR | [x] Use null coalesce operator instead of ternary operator.
38 | ERROR | [x] Case breaking statements must be followed by a single blank line
44 | ERROR | [x] Missing function doc comment
46 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
54 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
56 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
59 | ERROR | [x] Array indentation error, expected 8 spaces but found 10
60 | ERROR | [x] Array closing indentation error, expected 6 spaces but found 8
72 | WARNING | [x] There must be no blank line following an inline comment
72 | WARNING | [ ] There must be no blank line following an inline comment
72 | ERROR | [x] No space found before comment text; expected "// $sandbox['position'] += $sandbox['bunch'];" but found "//$sandbox['position'] += $sandbox['bunch'];"
78 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 16 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\taxonomy_term_depth\taxonomy_term_depth.install
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 3 WARNINGS AFFECTING 8 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
2 | ERROR | [ ] Missing short description in doc comment
7 | 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."
19 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
28 | ERROR | [ ] Do not use t() or st() in installation phase hooks, use $t = get_t() to retrieve the appropriate localization function name
34 | 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."
50 | 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."
54 | ERROR | [x] Whitespace found at end of line
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\taxonomy_term_depth\taxonomy_term_depth.module
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 48 ERRORS AND 7 WARNINGS AFFECTING 45 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
8 | ERROR | [x] Doc comment short description must end with a full stop
29 | ERROR | [ ] Missing short description in doc comment
30 | WARNING | [x] '@todo: Provide description' should match the format '@todo Fix problem X here.'
32 | ERROR | [ ] Missing parameter comment
32 | ERROR | [ ] Missing parameter type
33 | ERROR | [ ] Missing parameter comment
35 | ERROR | [ ] Description for the @return value is missing
42 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
44 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
47 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
63 | 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."
63 | ERROR | [ ] Doc comment short description must end with a full stop
66 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
73 | 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."
80 | ERROR | [x] Doc comment short description must end with a full stop
82 | ERROR | [ ] Missing parameter comment
82 | ERROR | [ ] Missing parameter type
84 | ERROR | [ ] Description for the @return value is missing
97 | ERROR | [x] Doc comment short description must end with a full stop
99 | ERROR | [ ] Missing parameter type
100 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 2 spaces
113 | ERROR | [x] Expected 1 blank line after function; 2 found
117 | ERROR | [x] Doc comment short description must end with a full stop
119 | ERROR | [ ] Missing parameter type
120 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 2 spaces
135 | ERROR | [ ] Missing short description in doc comment
136 | ERROR | [ ] Missing parameter comment
136 | ERROR | [ ] Missing parameter type
138 | ERROR | [ ] Description for the @return value is missing
139 | ERROR | [ ] The text '@deprecated Use taxonomy_term_depth_get_full_chain().' does not match the standard format: @deprecated in %deprecation-version% and is removed from %removal-version%.
| | %extra-info%.
139 | ERROR | [ ] Each @deprecated tag must have a @see tag immediately following it
143 | ERROR | [x] Expected 1 blank line after function; 2 found
149 | ERROR | [ ] Missing parameter comment
149 | ERROR | [ ] Missing parameter type
151 | ERROR | [ ] Description for the @return value is missing
154 | WARNING | [x] '@todo: Caching parents or not worth?' should match the format '@todo Fix problem X here.'
167 | ERROR | [ ] Missing parameter comment
167 | ERROR | [ ] Missing parameter type
169 | ERROR | [ ] Description for the @return value is missing
174 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
184 | ERROR | [x] Doc comment short description must end with a full stop
186 | ERROR | [ ] Missing parameter comment
186 | ERROR | [ ] Missing parameter type
188 | ERROR | [ ] Description for the @return value is missing
199 | 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."
225 | 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."
226 | ERROR | [ ] Doc comment short description must end with a full stop
226 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
230 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
236 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
242 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
247 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
255 | WARNING | [ ] Avoid backslash escaping in translatable strings when possible, use "" quotes instead
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 22 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\taxonomy_term_depth\taxonomy_term_depth.test
-------------------------------------------------------------------------------------------------------------------------------
FOUND 14 ERRORS AND 2 WARNINGS AFFECTING 13 LINES
-------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
3 | ERROR | [ ] Missing short description in doc comment
10 | WARNING | [ ] Class name must be prefixed with the project name "TaxonomyTermDepth"
11 | ERROR | [ ] Missing member variable doc comment
13 | ERROR | [x] Missing function doc comment
21 | ERROR | [x] Missing function doc comment
21 | ERROR | [x] Visibility must be declared on method "setUp"
24 | WARNING | [x] A comma should follow the last multiline array item. Found: 'taxonomy'
28 | ERROR | [x] Expected 1 blank line after function; 2 found
43 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
75 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
97 | ERROR | [x] Missing function doc comment
97 | ERROR | [ ] Public method name "DynamicDepthCalculationTest::_testDepthCache" is not in lowerCamel format
99 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
114 | ERROR | [x] Missing function doc comment
114 | ERROR | [ ] Public method name "DynamicDepthCalculationTest::_testDepthProperty" is not in lowerCamel format
-------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 11 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------

Time: 1.67 secs; Memory: 6MB

Steps to reproduce

Run the phpcs command on the module.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Needs work

Version

2.0

Component

Code

Created by

🇮🇳India sidharth_soman Bangalore

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024