Prepare list of coding standards issues

Created on 16 May 2023, over 1 year ago
Updated 2 June 2023, over 1 year ago

Problem/Motivation

We need to fix coding standards issues in the module.

Proposed resolution

1) Using the code sniffer, rector, or other tools prepare a list of files that need to be refactored.

2) Place the list into a comment, please describe how you checked the code (which tools you are using, and what problems you have found)

Remaining tasks

@todo

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇺🇦Ukraine Panchuk Volyn, Lutsk

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

  • Issue created by @Panchuk
  • First commit to issue fork.
  • Assigned to dineshkumarbollu
  • 🇮🇳India dineshkumarbollu

    Hi

    Yes This module as coding standards issues i will work on this,

    vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig web/modules/contrib/paragraphs_gridstack-3360621/

    FILE: /var/www/html/vb9/web/modules/contrib/paragraphs_gridstack-3360621/modules/paragraphs_gridstack_demo/config/install/core.entity_form_display.node.gridstack_content_demo.default.yml
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    51 | ERROR | [x] Expected 1 newline at end of file; 2 found
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    FILE: /var/www/html/vb9/web/modules/contrib/paragraphs_gridstack-3360621/modules/paragraphs_gridstack_demo/paragraphs_gridstack_demo.info.yml
    ---------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
    ---------------------------------------------------------------------------------------------------------------------------------------------
    1 | WARNING | [ ] Remove "version" from the info file, it will be added by drupal.org packaging automatically
    11 | ERROR | [x] Expected 1 newline at end of file; 2 found
    ---------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------------------------------------------------------

    FILE: /var/www/html/vb9/web/modules/contrib/paragraphs_gridstack-3360621/src/Form/ParagraphsGridstackManageStyles.php
    --------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 4 ERRORS AND 3 WARNINGS AFFECTING 5 LINES
    --------------------------------------------------------------------------------------------------------------------------------------------------
    32 | ERROR | [ ] Parameter $gridstack_breakpoints_manager is not described in comment
    82 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
    84 | ERROR | [x] Visibility must be declared on method "buildForm"
    95 | WARNING | [x] There must be no blank line following an inline comment
    95 | WARNING | [ ] There must be no blank line following an inline comment
    95 | ERROR | [x] No space found before comment text; expected "// @todo Create correct #options." but found "//@todo Create correct #options."
    97 | ERROR | [x] Expected 1 space before "="; 0 found
    --------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------------------------------------------------------------------------

    FILE: /var/www/html/vb9/web/modules/contrib/paragraphs_gridstack-3360621/src/Form/ParagraphsGridstackFormBase.php
    -----------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
    -----------------------------------------------------------------------------------------------------------------
    34 | ERROR | [ ] Parameter $gridstack_breakpoints_manager is not described in comment
    218 | WARNING | [x] '@TODO robot label should be replaced.' should match the format '@todo Fix problem X here.'
    -----------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------------------

    FILE: /var/www/html/vb9/web/modules/contrib/paragraphs_gridstack-3360621/src/Plugin/paragraphs/Behavior/GridstackContainer.php
    ------------------------------------------------------------------------------------------------------------------------------
    FOUND 5 ERRORS AND 2 WARNINGS AFFECTING 7 LINES
    ------------------------------------------------------------------------------------------------------------------------------
    16 | WARNING | [x] Unused use statement
    74 | ERROR | [x] Do not append variable name "$moduleHandler" to the type declaration in a member variable comment
    148 | ERROR | [x] Expected 1 space after "="; 2 found
    164 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
    175 | ERROR | [x] Equals sign not aligned with surrounding assignments; expected 1 space but found 2 spaces
    234 | WARNING | [x] '@TODO Handle AJAX updating.' should match the format '@todo Fix problem X here.'
    480 | ERROR | [x] Expected 1 newline at end of file; 2 found
    ------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------------

    FILE: /var/www/html/vb9/web/modules/contrib/paragraphs_gridstack-3360621/src/GridstackBreakpointsManager.php
    -----------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------------------------------
    74 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    74 | WARNING | Only string literals should be passed to t() where possible
    74 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    74 | WARNING | Only string literals should be passed to t() where possible
    -----------------------------------------------------------------------------------------------------------------------------------------

    FILE: /var/www/html/vb9/web/modules/contrib/paragraphs_gridstack-3360621/src/GridstackStylesManager.php
    -------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------
    32 | ERROR | [x] Data types in @param tags need to be fully namespaced
    -------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------------------------------

    FILE: /var/www/html/vb9/web/modules/contrib/paragraphs_gridstack-3360621/src/Entity/ParagraphsGridstack.php
    -----------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------
    6 | WARNING | [x] Unused use statement
    -----------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------------

    FILE: /var/www/html/vb9/web/modules/contrib/paragraphs_gridstack-3360621/css/gridstack-col24.css
    ------------------------------------------------------------------------------------------------
    FOUND 48 ERRORS AFFECTING 48 LINES
    ------------------------------------------------------------------------------------------------
    2 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    5 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    8 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    11 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    14 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    17 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    20 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    23 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    26 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    29 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    32 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    35 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    38 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    41 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    44 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    47 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    50 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    53 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    56 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    59 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    62 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    65 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    68 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    71 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    74 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    77 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    80 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    83 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    86 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    89 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    92 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    95 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    98 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    101 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    104 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    107 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    110 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    113 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    116 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    119 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    122 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    125 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    128 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    131 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    134 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    137 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    140 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
    141 | ERROR | [x] Expected 1 newline at end of file; 0 found
    ------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 48 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------

    FILE: /var/www/html/vb9/web/modules/contrib/paragraphs_gridstack-3360621/paragraphs_gridstack.module
    --------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------------------------------
    14 | WARNING | [x] '@TODO Add the help information about paragraphs gridstack module.' should match the format '@todo Fix problem X here.'
    --------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------------------------------------------------------------------

    FILE: /var/www/html/vb9/web/modules/contrib/paragraphs_gridstack-3360621/README.md
    ----------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 7 WARNINGS AFFECTING 7 LINES
    ----------------------------------------------------------------------------------
    1 | WARNING | Line exceeds 80 characters; contains 102 characters
    2 | WARNING | Line exceeds 80 characters; contains 98 characters
    4 | WARNING | Line exceeds 80 characters; contains 105 characters
    19 | WARNING | Line exceeds 80 characters; contains 87 characters
    25 | WARNING | Line exceeds 80 characters; contains 158 characters
    29 | WARNING | Line exceeds 80 characters; contains 100 characters
    52 | WARNING | Line exceeds 80 characters; contains 167 characters
    ----------------------------------------------------------------------------------

    FILE: /var/www/html/vb9/web/modules/contrib/paragraphs_gridstack-3360621/paragraphs_gridstack.info.yml
    ---------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
    ---------------------------------------------------------------------------------------------------------------
    1 | WARNING | [ ] Remove "version" from the info file, it will be added by drupal.org packaging automatically
    8 | ERROR | [x] Expected 1 newline at end of file; 2 found
    ---------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------------------------

    Time: 1.6 secs; Memory: 14MB

  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India dineshkumarbollu

    Hi

    I fix the all errors except

    WARNING | Only string literals should be passed to t() where possible

    please review

    Thanks

  • 🇮🇳India Akshay kashyap

    Added patch Please review.

  • 🇮🇳India Akshay kashyap

    Added patch to fixed the warning messages which are mentioned in the comment #5

  • 🇺🇦Ukraine Panchuk Volyn, Lutsk

    Thanks for your work done here @dineshkumarbollu and @akshay-kashyap
    I will review patch, and send my response asap

  • 🇺🇦Ukraine Panchuk Volyn, Lutsk

    @dineshkumarbollu can you check in path #8 how were fixed the warning messages which are mentioned in comment #5 and then update and publish your merge request? It will be much easier for me to work with MR.

  • @dineshkumarbollu opened merge request.
  • 🇮🇳India dineshkumarbollu

    Hi Panchuk

    sorry i forgot to create MR for this issue now i send a MR

    please review

  • @panchuk opened merge request.
    • Panchuk committed d89cdb35 on 1.0.x
      Issue #3360621 by Panchuk, dineshkumarbollu, Akshay kashyap: Prepare...
  • Status changed to Fixed over 1 year ago
  • 🇺🇦Ukraine Panchuk Volyn, Lutsk
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024