Drupal Coding Standards Issues | phpcs

Created on 3 January 2023, over 2 years ago
Updated 24 May 2023, almost 2 years ago

Problem/Motivation

Getting following error/warnings

FILE: /app/modules/contrib/cookiebot/cookiebot.api.php
--------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------
32 | ERROR | [x] Doc comment short description must end with a full stop
37 | ERROR | [ ] Type hint "array" missing for $cookiebot
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------

FILE: /app/modules/contrib/cookiebot/cookiebot.install
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
31 | WARNING | Line exceeds 80 characters; contains 101 characters
----------------------------------------------------------------------

FILE: /app/modules/contrib/cookiebot/cookiebot.module
---------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------------------------------------
99 | ERROR | The array declaration extends to column 152 (the limit is 80). The array content should be split up over multiple lines
159 | ERROR | The array declaration extends to column 160 (the limit is 80). The array content should be split up over multiple lines
---------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/cookiebot/css/cookiebot.css
----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------

FILE: /app/modules/contrib/cookiebot/src/Form/CookiebotForm.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
99 | WARNING | FilterFormat::load calls should be avoided in classes, use dependency injection instead
203 | ERROR | The array declaration extends to column 637 (the limit is 80). The array content should be split up over multiple lines
219 | WARNING | FilterFormat::load calls should be avoided in classes, use dependency injection instead
-----------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/cookiebot/src/Plugin/Block/CookieDeclarationBlock.php
---------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
---------------------------------------------------------------------------------------------
88 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
89 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
---------------------------------------------------------------------------------------------

Time: 769ms; Memory: 12MB

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

Proposed resolution

Above error/warnings need to be fixed

🐛 Bug report
Status

Fixed

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