Drupal Coding Standards Issues | phpcs

Created on 30 January 2023, over 1 year ago

Problem/Motivation

Getting following error/warnings

FILE: /var/www/html/modules/contrib/twitter_feed/twitter_feed.module
---------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------
140 | ERROR | The array declaration extends to column 140 (the limit is 80). The array content should be split up over multiple lines
---------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/twitter_feed/src/Form/TwitterFeedConfigForm.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------
14 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
83 | WARNING | Possible useless method overriding detected
-----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/twitter_feed/src/Plugin/Block/TwitterFeedBlock.php
----------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 3 WARNINGS AFFECTING 4 LINES
----------------------------------------------------------------------------------------------------------
29 | ERROR | [ ] Parameter $http_client is not described in comment
120 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
175 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
194 | WARNING | [x] 'TODO set per-block cache time.' should match the format '@todo Fix problem X here.'
----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------

Time: 483ms; 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/twitter_feed/

Proposed resolution

Above error/warnings need to be fixed.

📌 Task
Status

Needs review

Version

2.0

Component

Code

Created by

🇮🇳India samit.310@gmail.com

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

Comments & Activities

Production build 0.69.0 2024