Fix the issues reported by phpcs

Created on 8 July 2024, 4 months ago
Updated 29 August 2024, 3 months ago

Problem/Motivation

Running :-
vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig web/modules/contrib/entity_translate_side_by_side/
returns the following warnings/errors, which should be fixed.

FILE: /home/prem/Documents/drupal-10.3.1/web/modules/contrib/entity_translate_side_by_side/entity_translate_side_by_side.info.yml
---------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------
1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
1 | WARNING | Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically
1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
---------------------------------------------------------------------------------------------------------------------------------

FILE: /home/prem/Documents/drupal-10.3.1/web/modules/contrib/entity_translate_side_by_side/src/Form/LanguageConfigForm.php
--------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------------------
25 | ERROR | [x] Data types in @param tags need to be fully namespaced
95 | ERROR | [x] Data types in @param tags need to be fully namespaced
--------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------

FILE: /home/prem/Documents/drupal-10.3.1/web/modules/contrib/entity_translate_side_by_side/src/Form/EntityTranslateSideBySideForm.php
----------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 40 ERRORS AND 53 WARNINGS AFFECTING 90 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------------
26 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
26 | WARNING | [x] 'TODO: Consider making this blacklist configurable for the contribution module.' should match the format '@todo Fix problem X here.'
27 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
53 | ERROR | [x] Data types in @param tags need to be fully namespaced
55 | ERROR | [x] Data types in @param tags need to be fully namespaced
66 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter
72 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
76 | ERROR | [x] Data types in @param tags need to be fully namespaced
90 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
114 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
118 | WARNING | [ ] Line exceeds 80 characters; contains 110 characters
148 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
160 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
181 | ERROR | [x] Data types in @param tags need to be fully namespaced
204 | WARNING | [ ] Line exceeds 80 characters; contains 90 characters
208 | ERROR | [x] Data types in @param tags need to be fully namespaced
215 | WARNING | [ ] Line exceeds 80 characters; contains 93 characters
216 | WARNING | [ ] Line exceeds 80 characters; contains 85 characters
217 | WARNING | [ ] Line exceeds 80 characters; contains 100 characters
218 | WARNING | [ ] Line exceeds 80 characters; contains 96 characters
220 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
271 | WARNING | [ ] Line exceeds 80 characters; contains 102 characters
272 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
273 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
288 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
323 | WARNING | [ ] Line exceeds 80 characters; contains 101 characters
334 | WARNING | [ ] Line exceeds 80 characters; contains 126 characters
335 | WARNING | [ ] Line exceeds 80 characters; contains 116 characters
336 | WARNING | [ ] Line exceeds 80 characters; contains 103 characters
340 | ERROR | [x] Data types in @param tags need to be fully namespaced
344 | ERROR | [x] Data types in @param tags need to be fully namespaced
367 | WARNING | [ ] Line exceeds 80 characters; contains 95 characters
367 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
412 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
416 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
421 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
426 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
431 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
433 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
439 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
447 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
462 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
463 | WARNING | [ ] Line exceeds 80 characters; contains 86 characters
464 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
465 | WARNING | [ ] Line exceeds 80 characters; contains 86 characters
466 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
478 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
483 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
489 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
494 | WARNING | [ ] Line exceeds 80 characters; contains 102 characters
496 | WARNING | [ ] Line exceeds 80 characters; contains 100 characters
497 | WARNING | [ ] Line exceeds 80 characters; contains 98 characters
498 | WARNING | [ ] Line exceeds 80 characters; contains 101 characters
501 | ERROR | [x] Data types in @param tags need to be fully namespaced
507 | WARNING | [ ] Line exceeds 80 characters; contains 99 characters
520 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
523 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
526 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
529 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
587 | WARNING | [ ] Line exceeds 80 characters; contains 111 characters
588 | WARNING | [ ] Line exceeds 80 characters; contains 99 characters
589 | WARNING | [ ] Line exceeds 80 characters; contains 94 characters
590 | WARNING | [ ] Line exceeds 80 characters; contains 112 characters
593 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
594 | WARNING | [ ] Line exceeds 80 characters; contains 86 characters
595 | WARNING | [ ] Line exceeds 80 characters; contains 98 characters
607 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
628 | ERROR | [ ] Description for the @return value must be on the next line
673 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
689 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
700 | WARNING | [ ] Line exceeds 80 characters; contains 86 characters
709 | ERROR | [x] Data types in @param tags need to be fully namespaced
748 | ERROR | [x] Data types in @param tags need to be fully namespaced
758 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
774 | WARNING | [ ] Line exceeds 80 characters; contains 98 characters
792 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
797 | WARNING | [ ] Line exceeds 80 characters; contains 94 characters
802 | WARNING | [ ] Line exceeds 80 characters; contains 119 characters
803 | WARNING | [ ] Line exceeds 80 characters; contains 159 characters
805 | WARNING | [ ] Line exceeds 80 characters; contains 119 characters
806 | WARNING | [ ] Line exceeds 80 characters; contains 117 characters
807 | WARNING | [ ] Line exceeds 80 characters; contains 118 characters
809 | WARNING | [ ] Line exceeds 80 characters; contains 138 characters
810 | WARNING | [ ] Line exceeds 80 characters; contains 115 characters
818 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
823 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
828 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
836 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
836 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
838 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
841 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
843 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
849 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
----------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 40 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /home/prem/Documents/drupal-10.3.1/web/modules/contrib/entity_translate_side_by_side/src/Controller/EntityTranslateSideBySideController.php
-------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 6 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------
9 | ERROR | [x] Missing class doc comment
21 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter
27 | ERROR | [x] Data types in @param tags need to be fully namespaced
54 | ERROR | [x] Data types in @return tags need to be fully namespaced
58 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
63 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
-------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /home/prem/Documents/drupal-10.3.1/web/modules/contrib/entity_translate_side_by_side/src/Breadcrumb/EntityTranslateSideBySideBreadcrumbBuilder.php
--------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 8 ERRORS AND 3 WARNINGS AFFECTING 11 LINES
--------------------------------------------------------------------------------------------------------------------------------------------------------
36 | ERROR | [x] Data types in @param tags need to be fully namespaced
38 | ERROR | [x] Data types in @param tags need to be fully namespaced
49 | ERROR | [x] Data types in @param tags need to be fully namespaced
53 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
62 | ERROR | [x] Data types in @param tags need to be fully namespaced
65 | ERROR | [x] Data types in @return tags need to be fully namespaced
72 | WARNING | [ ] Line exceeds 80 characters; contains 101 characters
105 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
107 | ERROR | [x] Data types in @param tags need to be fully namespaced
125 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
132 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
--------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /home/prem/Documents/drupal-10.3.1/web/modules/contrib/entity_translate_side_by_side/js/edit_form_scripts.js
------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------
40 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
42 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------

FILE: /home/prem/Documents/drupal-10.3.1/web/modules/contrib/entity_translate_side_by_side/js/drag_and_drop_scrolling.js
------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 6 LINES
------------------------------------------------------------------------------------------------------------------------
22 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
25 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
30 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
37 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
42 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
47 | ERROR | [x] Inline control structures are not allowed
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------

FILE: /home/prem/Documents/drupal-10.3.1/web/modules/contrib/entity_translate_side_by_side/entity_translate_side_by_side.api.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------
9 | WARNING | Line exceeds 80 characters; contains 87 characters
--------------------------------------------------------------------------------------------------------------------------------

FILE: /home/prem/Documents/drupal-10.3.1/web/modules/contrib/entity_translate_side_by_side/entity_translate_side_by_side.module
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 7 WARNINGS AFFECTING 10 LINES
-------------------------------------------------------------------------------------------------------------------------------------
3 | ERROR | [ ] Missing short description in doc comment
9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Entity\TranslatableInterface.
17 | WARNING | [ ] Hook implementations should not duplicate @param documentation
20 | WARNING | [ ] Hook implementations should not duplicate @return documentation
24 | ERROR | [ ] Inline doc block comments are not allowed; use "/* Comment */" or "// Comment" instead
25 | WARNING | [ ] Line exceeds 80 characters; contains 88 characters
28 | WARNING | [ ] Line exceeds 80 characters; contains 102 characters
29 | WARNING | [ ] Line exceeds 80 characters; contains 90 characters
38 | WARNING | [ ] Line exceeds 80 characters; contains 109 characters
39 | WARNING | [ ] Line exceeds 80 characters; contains 88 characters
-------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------

Time: 331ms; Memory: 14MB

📌 Task
Status

Needs work

Version

1.1

Component

Code

Created by

🇮🇳India prem suthar Ahemdabad- Gujrat , Jodhpur - Rajsthan

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.71.5 2024