Drupal Coding Standards Issues | phpcs

Created on 13 December 2022, over 1 year ago
Updated 29 January 2023, over 1 year ago

Problem/Motivation

Getting following error/warnings

FILE: /app/modules/contrib/csp/csp.routing.yml
------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------
14 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/csp/csp_extras/src/Ajax/AjaxResponseAttachmentsProcessor.php
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 2 WARNINGS AFFECTING 5 LINES
---------------------------------------------------------------------------------------------------------------------------------------------
101 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
146 | ERROR | [x] Use null coalesce operator instead of ternary operator.
148 | ERROR | [x] Use null coalesce operator instead of ternary operator.
176 | ERROR | [ ] The array declaration extends to column 111 (the limit is 80). The array content should be split up over multiple lines
179 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
---------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/csp/src/Csp.php
-------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------------
486 | WARNING | [ ] Line exceeds 80 characters; contains 86 characters
486 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
574 | ERROR | [ ] Parameter tags must be defined first in a doc comment
-------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/csp/src/Form/CspSettingsForm.php
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 11 ERRORS AND 19 WARNINGS AFFECTING 30 LINES
---------------------------------------------------------------------------------------------------------------------------------------------
45 | ERROR | [ ] The array declaration extends to column 139 (the limit is 80). The array content should be split up over multiple lines
55 | ERROR | [ ] The array declaration extends to column 102 (the limit is 80). The array content should be split up over multiple lines
56 | ERROR | [ ] The array declaration extends to column 139 (the limit is 80). The array content should be split up over multiple lines
140 | WARNING | [ ] Unused private method getKeywordOptions()
234 | ERROR | [ ] The array declaration extends to column 157 (the limit is 80). The array content should be split up over multiple lines
263 | WARNING | [ ] #options values usually have to run through t() for translation
264 | WARNING | [ ] #options values usually have to run through t() for translation
266 | WARNING | [ ] #options values usually have to run through t() for translation
268 | ERROR | [x] Use null coalesce operator instead of ternary operator.
298 | ERROR | [ ] The array declaration extends to column 81 (the limit is 80). The array content should be split up over multiple lines
314 | ERROR | [ ] The array declaration extends to column 81 (the limit is 80). The array content should be split up over multiple lines
351 | WARNING | [ ] #options values usually have to run through t() for translation
352 | WARNING | [ ] #options values usually have to run through t() for translation
353 | WARNING | [ ] #options values usually have to run through t() for translation
354 | WARNING | [ ] #options values usually have to run through t() for translation
355 | WARNING | [ ] #options values usually have to run through t() for translation
356 | WARNING | [ ] #options values usually have to run through t() for translation
357 | WARNING | [ ] #options values usually have to run through t() for translation
358 | WARNING | [ ] #options values usually have to run through t() for translation
359 | WARNING | [ ] #options values usually have to run through t() for translation
360 | WARNING | [ ] #options values usually have to run through t() for translation
361 | WARNING | [ ] #options values usually have to run through t() for translation
362 | WARNING | [ ] #options values usually have to run through t() for translation
363 | WARNING | [ ] #options values usually have to run through t() for translation
372 | WARNING | [ ] #options values usually have to run through t() for translation
373 | WARNING | [ ] #options values usually have to run through t() for translation
505 | ERROR | [ ] The array declaration extends to column 112 (the limit is 80). The array content should be split up over multiple lines
548 | ERROR | [ ] The array declaration extends to column 101 (the limit is 80). The array content should be split up over multiple lines
683 | ERROR | [ ] The array declaration extends to column 93 (the limit is 80). The array content should be split up over multiple lines
685 | ERROR | [ ] The array declaration extends to column 105 (the limit is 80). The array content should be split up over multiple lines
---------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/csp/src/Plugin/CspReportingHandler/ReportUri.php
---------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------
36 | ERROR | [x] Use null coalesce operator instead of ternary operator.
---------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------

FILE: /app/modules/contrib/csp/src/Plugin/CspReportingHandler/Uri.php
--------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------
33 | ERROR | [x] Use null coalesce operator instead of ternary operator.
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------

FILE: /app/modules/contrib/csp/tests/src/Unit/CspFirefoxBugTest.php
---------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
---------------------------------------------------------------------------------------------------------------------------------------
26 | ERROR | The array declaration extends to column 83 (the limit is 80). The array content should be split up over multiple lines
43 | ERROR | The array declaration extends to column 84 (the limit is 80). The array content should be split up over multiple lines
92 | ERROR | The array declaration extends to column 83 (the limit is 80). The array content should be split up over multiple lines
108 | ERROR | The array declaration extends to column 101 (the limit is 80). The array content should be split up over multiple lines
---------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/csp/tests/src/Unit/CspOptimizationTest.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------------------------------------------------------------
147 | ERROR | The array declaration extends to column 85 (the limit is 80). The array content should be split up over multiple lines
156 | ERROR | The array declaration extends to column 90 (the limit is 80). The array content should be split up over multiple lines
174 | ERROR | The array declaration extends to column 84 (the limit is 80). The array content should be split up over multiple lines
183 | ERROR | The array declaration extends to column 89 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/csp/tests/src/Unit/CspTest.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------
346 | ERROR | The array declaration extends to column 81 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/csp/tests/src/Unit/Form/CspSettingsFormTest.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------------------------------------------------------------
54 | ERROR | The array declaration extends to column 81 (the limit is 80). The array content should be split up over multiple lines
56 | ERROR | The array declaration extends to column 91 (the limit is 80). The array content should be split up over multiple lines
57 | ERROR | The array declaration extends to column 83 (the limit is 80). The array content should be split up over multiple lines
58 | ERROR | The array declaration extends to column 100 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------

Time: 4.68 secs; Memory: 16MB

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/markup/

Proposed resolution

Above error/warnings need to be fixed

๐Ÿ“Œ Task
Status

Closed: outdated

Version

1.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.69.0 2024