Drupal code standards issues

Created on 2 April 2020, over 4 years ago
Updated 11 July 2024, 4 months ago
Git errors:
<ul>
<li>It appears you are working in the "1.x" branch in git. You should really be working in a version specific branch. The most direct documentation on this is <a href="https://www.drupal.org/node/1127732">Moving from a master branch to a version branch.</a> For additional resources please see the documentation about <a href="https://www.drupal.org/node/1015226">release naming conventions</a> and <a href="https://www.drupal.org/node/1066342">creating a branch in git</a>.</li>
</ul>
Review of the 1.x branch (commit 6549f2c):
<ul>
<li>README.md or README.txt is missing, see the <a href="https://www.drupal.org/node/447604">guidelines for in-project documentation</a>.</li>
<li>The domain_color.module does not implement <code>hook_help()

. See https://www.drupal.org/docs/develop/documenting-your-project/module-docu... .

  • Coder Sniffer has found some issues with your code (please check the Drupal coding standards ). See attachment.
  • DrupalPractice has found some issues with your code, but could be false positives.
    
    FILE: ...e1101/web/vendor/drupal/pareviewsh/pareview_temp/domain_color.module
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 24 WARNINGS AFFECTING 19 LINES
    --------------------------------------------------------------------------
      50 | WARNING | Variable $info is undefined.
      54 | WARNING | Variable $theme is undefined.
      56 | WARNING | Variable $theme is undefined.
      59 | WARNING | Variable $scheme is undefined.
      60 | WARNING | Variable $palette is undefined.
      61 | WARNING | Variable $info is undefined.
      61 | WARNING | Variable $scheme is undefined.
      62 | WARNING | Variable $info is undefined.
      62 | WARNING | Variable $scheme is undefined.
      65 | WARNING | Variable $info is undefined.
      69 | WARNING | Variable $info is undefined.
      71 | WARNING | Variable $theme is undefined.
      71 | WARNING | Variable $info is undefined.
     103 | WARNING | Variable $theme is undefined.
     109 | WARNING | Variable $theme is undefined.
     119 | WARNING | Variable $theme is undefined.
     135 | WARNING | Variable $info is undefined.
     149 | WARNING | Variable $info is undefined.
     150 | WARNING | Variable $theme is undefined.
     150 | WARNING | Variable $info is undefined.
     155 | WARNING | Variable $info is undefined.
     177 | WARNING | Variable $theme is undefined.
     177 | WARNING | Variable $info is undefined.
     209 | WARNING | Unused variable $color_sets.
    --------------------------------------------------------------------------
    
    Time: 416ms; Memory: 4Mb
    
  • No automated test cases were found, did you consider writing Simpletests or PHPUnit tests ? This is not a requirement but encouraged for professional software development.
  • 
    FILE: ...e1101/web/vendor/drupal/pareviewsh/pareview_temp/domain_color.module
    --------------------------------------------------------------------------
    FOUND 11 ERRORS AND 2 WARNINGS AFFECTING 9 LINES
    --------------------------------------------------------------------------
       1 | ERROR   | [x] Missing file doc comment
     193 | ERROR   | [x] Expected 1 blank line after function; 2 found
     199 | ERROR   | [ ] Missing parameter type
     224 | WARNING | [ ] Line exceeds 80 characters; contains 101 characters
     224 | ERROR   | [x] No space found before comment text; expected "//
         |         |     $current_scheme =
         |         |     \Drupal::configFactory()->getEditable('color.theme.'
         |         |     . $theme)->get('palette');" but found
         |         |     "//$current_scheme =
         |         |     \Drupal::configFactory()->getEditable('color.theme.'
         |         |     . $theme)->get('palette');"
     224 | ERROR   | [x] Inline comments must end in full-stops, exclamation
         |         |     marks, colons, question marks, or closing
         |         |     parentheses
     243 | ERROR   | [x] Functions must not contain multiple empty lines in a
         |         |     row; found 2 empty lines
     269 | ERROR   | [x] No space found before comment text; expected "// /
         |         |     original color setting." but found "/// original
         |         |     color setting."
     303 | WARNING | [ ] Line exceeds 80 characters; contains 87 characters
     303 | ERROR   | [x] No space found before comment text; expected "//
         |         |     $stylesheets = \Drupal::config('color.theme.' .
         |         |     $active_theme)->get('stylesheets');" but found
         |         |     "//$stylesheets = \Drupal::config('color.theme.' .
         |         |     $active_theme)->get('stylesheets');"
     303 | ERROR   | [x] Inline comments must end in full-stops, exclamation
         |         |     marks, colons, question marks, or closing
         |         |     parentheses
     326 | ERROR   | [x] Expected 1 space after FUNCTION keyword; 0 found
     330 | ERROR   | [x] Closing brace must be on a line by itself
    --------------------------------------------------------------------------
    PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------
    
    Time: 836ms; Memory: 6Mb
    

    📌 Task
    Status

    Fixed

    Version

    1.0

    Component

    Code

    Created by

    🇮🇳India shaktik New Delhi

    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