Drupal Coding Standards Issues | phpcs

Created on 11 January 2023, almost 2 years ago
Updated 29 January 2023, almost 2 years ago

Problem/Motivation

Getting following error/warnings

FILE: /var/www/html/modules/contrib/tooltip_taxonomy/css/tooltip.css
------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------
39 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/tooltip_taxonomy/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
----------------------------------------------------------------------
14 | WARNING | Line exceeds 80 characters; contains 365 characters
30 | WARNING | Line exceeds 80 characters; contains 103 characters
36 | WARNING | Line exceeds 80 characters; contains 148 characters
38 | WARNING | Line exceeds 80 characters; contains 747 characters
40 | WARNING | Line exceeds 80 characters; contains 346 characters
----------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/tooltip_taxonomy/tooltip_taxonomy.install
-----------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 5 LINES
-----------------------------------------------------------------------------
4 | ERROR | [x] The second line in the file doc comment must be "@file"
5 | ERROR | [x] Expected 1 space(s) before asterisk; 0 found
5 | ERROR | [x] There must be no blank lines after the function comment
21 | ERROR | [x] Whitespace found at end of line
22 | ERROR | [x] Whitespace found at end of line
30 | ERROR | [x] Expected 1 newline at end of file; 0 found
-----------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/tooltip_taxonomy/tooltip_taxonomy.module
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 19 ERRORS AND 1 WARNING AFFECTING 20 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
27 | 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."
35 | ERROR | [x] Whitespace found at end of line
45 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 10
46 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 10
47 | ERROR | [x] Line indented incorrectly; expected 10 spaces, found 12
48 | ERROR | [x] Line indented incorrectly; expected 12 spaces, found 14
49 | ERROR | [x] Line indented incorrectly; expected 14 spaces, found 16
50 | ERROR | [x] Line indented incorrectly; expected 12 spaces, found 14
51 | ERROR | [x] Line indented incorrectly; expected 12 spaces, found 14
52 | ERROR | [x] Line indented incorrectly; expected 12 spaces, found 14
53 | ERROR | [x] Line indented incorrectly; expected 12 spaces, found 14
54 | ERROR | [x] Line indented incorrectly; expected 14 spaces, found 16
55 | ERROR | [x] Line indented incorrectly; expected 12 spaces, found 14
56 | ERROR | [x] Line indented incorrectly; expected 10 spaces, found 12
57 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 10
58 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 10
59 | ERROR | [x] Line indented incorrectly; expected 10 spaces, found 12
60 | ERROR | [x] Line indented incorrectly; expected 10 spaces, found 12
61 | ERROR | [x] Line indented incorrectly; expected 10 spaces, found 12
62 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 10
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 19 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/tooltip_taxonomy/tooltip_taxonomy.libraries.yml
-----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------
4 | ERROR | [x] Expected 1 newline at end of file; 0 found
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/tooltip_taxonomy/src/Form/FilterConditionDeleteForm.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------
12 | WARNING | @author tags are not usually used in Drupal, because over time multiple contributors will touch the code anyway
--------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/tooltip_taxonomy/src/Form/FilterConditionForm.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 4 WARNINGS AFFECTING 5 LINES
-------------------------------------------------------------------------------------------------------------------------------------
19 | WARNING | [ ] @author tags are not usually used in Drupal, because over time multiple contributors will touch the code anyway
162 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
166 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
215 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
265 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
-------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/tooltip_taxonomy/src/Entity/FilterConditionInterface.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------------------------
10 | WARNING | @author tags are not usually used in Drupal, because over time multiple contributors will touch the code anyway
16 | WARNING | @author tags are not usually used in Drupal, because over time multiple contributors will touch the code anyway
--------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/tooltip_taxonomy/src/Entity/FilterCondition.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
-------------------------------------------------------------------------------------------------------------------------------------
10 | WARNING | [ ] @author tags are not usually used in Drupal, because over time multiple contributors will touch the code anyway
117 | ERROR | [x] Doc comment short description must end with a full stop
129 | ERROR | [x] Expected 1 blank line before function; 2 found
-------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/tooltip_taxonomy/src/Plugin/Field/FieldFormatter/TooltipTaxonomyFormatter.php
-----------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
-----------------------------------------------------------------------------------------------------------------
35 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
36 | ERROR | [x] Array closing indentation error, expected 4 spaces but found 6
48 | ERROR | [x] Expected 1 space after ":"; 0 found
-----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/tooltip_taxonomy/src/Controller/FilterConditionListBuilder.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------
11 | WARNING | @author tags are not usually used in Drupal, because over time multiple contributors will touch the code anyway
--------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/tooltip_taxonomy/src/Services/TooltipManager.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 10 ERRORS AND 2 WARNINGS AFFECTING 10 LINES
-------------------------------------------------------------------------------------------------------------------------------------
15 | WARNING | [ ] @author tags are not usually used in Drupal, because over time multiple contributors will touch the code anyway
81 | ERROR | [ ] Parameter $entity is not described in comment
86 | ERROR | [ ] Doc comment for parameter $node does not match actual variable name $entity
134 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
227 | ERROR | [x] Inline comments must start with a capital letter
227 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
234 | ERROR | [x] Inline comments must start with a capital letter
234 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
282 | ERROR | [ ] Missing parameter type
353 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
356 | ERROR | [x] Parameter comment must end with a full stop
359 | ERROR | [x] Separate the @param and @return sections by a blank line.
-------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/tooltip_taxonomy/src/Services/FieldTypeManager.php
-------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------
8 | WARNING | @author tags are not usually used in Drupal, because over time multiple contributors will touch the code anyway
-------------------------------------------------------------------------------------------------------------------------------

Time: 1.06 secs; Memory: 6MB

Steps to reproduce

Run following command

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml modules/contrib/tooltip_taxonomy/

Proposed resolution

Above error/warnings need to be fixed

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇮🇳India samit.310@gmail.com

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024