Issues found by phpcs

Created on 30 October 2023, about 1 year ago
Updated 17 September 2024, 3 months ago

Problem/Motivation

Steps to reproduce

Proposed resolution

$ vendor/bin/phpcs -s $_WEB_ROOT/modules/custom --report-junit=junit.xml --report-full --report-summary --report-source
FILE: ...les/custom/message_digest-3397836/tests/src/Kernel/TokenTest.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 62 | ERROR | The array declaration extends to column 126 (the limit
    |       | is 120). The array content should be split up over
    |       | multiple lines
    |       | (Drupal.Arrays.Array.LongLineDeclaration)
----------------------------------------------------------------------
FILE: ...om/message_digest-3397836/src/Form/MessageDigestIntervalForm.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 68 | ERROR | The array declaration extends to column 296 (the limit
    |       | is 120). The array content should be split up over
    |       | multiple lines
    |       | (Drupal.Arrays.Array.LongLineDeclaration)
----------------------------------------------------------------------
FILE: ...stom/message_digest-3397836/src/Entity/MessageDigestInterval.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 37 | WARNING | Line exceeds 80 characters; contains 92
    |         | characters (Drupal.Files.LineLength.TooLong)
----------------------------------------------------------------------
FILE: ...essage_digest-3397836/message_digest_ui/message_digest_ui.module
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
 16 | ERROR | All functions defined in a module file must be prefixed
    |       | with the module's name, found
    |       | "message_digest_allowed_values_callback" but expected
    |       | "message_digest_ui_message_digest_allowed_values_callback"
    |       | (Drupal.NamingConventions.ValidFunctionName.InvalidPrefix)
 36 | ERROR | All functions defined in a module file must be prefixed
    |       | with the module's name, found
    |       | "message_digest_default_value_callback" but expected
    |       | "message_digest_ui_message_digest_default_value_callback"
    |       | (Drupal.NamingConventions.ValidFunctionName.InvalidPrefix)
----------------------------------------------------------------------
Time: 619ms; Memory: 6MB
PHP CODE SNIFFER REPORT SUMMARY
----------------------------------------------------------------------
FILE                                                  ERRORS  WARNINGS
----------------------------------------------------------------------
...397836/message_digest_ui/message_digest_ui.module  2       0
...gest-3397836/src/Entity/MessageDigestInterval.php  0       1
...st-3397836/src/Form/MessageDigestIntervalForm.php  1       0
...age_digest-3397836/tests/src/Kernel/TokenTest.php  1       0
----------------------------------------------------------------------
A TOTAL OF 4 ERRORS AND 1 WARNING WERE FOUND IN 40 FILES
----------------------------------------------------------------------
PHP CODE SNIFFER VIOLATION SOURCE SUMMARY
----------------------------------------------------------------------
SOURCE                                                           COUNT
----------------------------------------------------------------------
Drupal.Arrays.Array.LongLineDeclaration                          2
Drupal.NamingConventions.ValidFunctionName.InvalidPrefix         2
Drupal.Files.LineLength.TooLong                                  1
----------------------------------------------------------------------
A TOTAL OF 5 SNIFF VIOLATIONS WERE FOUND IN 3 SOURCES
----------------------------------------------------------------------

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States bluegeek9

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @bluegeek9
  • Merge request !14Resolve #3397844 "Issues found by" β†’ (Merged) created by bluegeek9
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 8
    last update about 1 year ago
    37 pass
  • Pipeline finished with Success
    about 1 year ago
    Total: 177s
    #41693
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9

    The 92 character line is part of the entity annotation. I am not sure why it is listed.

    I am not sure how I should handle the two InvalidPrefix. We could move the functions to message_digest.module. Or, we could rename the functions and use a hook_update_N to update the fields. I prefer the first option as it does not require a hook_update_N; there is less chance of something going wrong.

    $ vendor/bin/phpcs -s $_WEB_ROOT/modules/custom --report-junit=junit.xml --report-full --report-summary --report-source
    FILE: ...stom/message_digest-3397844/src/Entity/MessageDigestInterval.php
    ----------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ----------------------------------------------------------------------
     37 | WARNING | Line exceeds 80 characters; contains 92
        |         | characters (Drupal.Files.LineLength.TooLong)
    ----------------------------------------------------------------------
    FILE: ...essage_digest-3397844/message_digest_ui/message_digest_ui.module
    ----------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    ----------------------------------------------------------------------
     16 | ERROR | All functions defined in a module file must be prefixed
        |       | with the module's name, found
        |       | "message_digest_allowed_values_callback" but expected
        |       | "message_digest_ui_message_digest_allowed_values_callback"
        |       | (Drupal.NamingConventions.ValidFunctionName.InvalidPrefix)
     36 | ERROR | All functions defined in a module file must be prefixed
        |       | with the module's name, found
        |       | "message_digest_default_value_callback" but expected
        |       | "message_digest_ui_message_digest_default_value_callback"
        |       | (Drupal.NamingConventions.ValidFunctionName.InvalidPrefix)
    ----------------------------------------------------------------------
    
  • Pipeline finished with Skipped
    3 months ago
    #285666
  • Status changed to Downport 3 months ago
  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9
  • Status changed to Fixed 3 months ago
  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024