Drupal coding standards

Created on 15 April 2020, almost 5 years ago
Updated 22 July 2024, 7 months ago
🐛 Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

🇮🇳India suresh prabhu parkala Bangalore

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.

  • 🇮🇳India riddhi.addweb

    I have applied the "3127870-2" patch cleanly, but still there are some errors.
    Please check the screenshots for the same.

    FILE: /var/www/html/web/drupal_8.9/web/modules/contrib/glazed_helper/src/Plugin/Block/FullScreenSearchBlock.php
    -----------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 3 WARNINGS AFFECTING 4 LINES
    -----------------------------------------------------------------------------------------------------------------------------------------
     22 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     24 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     44 | ERROR   | The array declaration extends to column 151 (the limit is 120). The array content should be split up over multiple lines
     50 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    -----------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /var/www/html/web/drupal_8.9/web/modules/contrib/glazed_helper/src/Plugin/Block/UserRegisterBlock.php
    -----------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
    -----------------------------------------------------------------------------------------------------------------------------------------------
      9 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Plugin\ContainerFactoryPluginInterface.
     90 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
     92 | 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/web/drupal_8.9/web/modules/contrib/glazed_helper/src/FlippyPager.php
    ----------------------------------------------------------------------------------------------------
    FOUND 6 ERRORS AND 1 WARNING AFFECTING 7 LINES
    ----------------------------------------------------------------------------------------------------
      95 | ERROR   | Public method name "FlippyPager::flippy_build_list" is not in lowerCamel format
     213 | ERROR   | Missing parameter type
     219 | ERROR   | Public method name "FlippyPager::flippy_use_pager" is not in lowerCamel format
     230 | ERROR   | Missing parameter type
     232 | ERROR   | Missing parameter type
     238 | ERROR   | Public method name "FlippyPager::flippy_generate_link" is not in lowerCamel format
     239 | WARNING | Unused variable $language.
    ----------------------------------------------------------------------------------------------------
    
    
    FILE: /var/www/html/web/drupal_8.9/web/modules/contrib/glazed_helper/glazed_helper.module
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 8 ERRORS AND 7 WARNINGS AFFECTING 13 LINES
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
       8 | WARNING | [x] Unused use statement
       9 | WARNING | [x] Unused use statement
      12 | WARNING | [x] Unused use statement
      51 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
      52 | ERROR   | [ ] Doc comment short description must end with a full stop
      52 | ERROR   | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
      56 | 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."
     110 | ERROR   | [x] Function comment short description must start with exactly one space
     114 | ERROR   | [x] Inline comments must start with a capital letter
     114 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
     119 | WARNING | [ ] Only string literals should be passed to t() where possible
     121 | WARNING | [ ] Only string literals should be passed to t() where possible
     123 | ERROR   | [x] Namespaced classes/interfaces/traits should be referenced with use statements
     124 | ERROR   | [x] Namespaced classes/interfaces/traits should be referenced with use statements
     126 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /var/www/html/web/drupal_8.9/web/modules/contrib/glazed_helper/templates/flippy.html.twig
    -----------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------
     8 | ERROR | [x] Expected 1 newline at end of file; 0 found
    -----------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------
    
    
    FILE: /var/www/html/web/drupal_8.9/web/modules/contrib/glazed_helper/glazed_helper.services.yml
    -----------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------
     14 | ERROR | [x] Expected 1 newline at end of file; 0 found
    -----------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------
    
  • First commit to issue fork.
Production build 0.71.5 2024