Fix the issues reported by phpcs

Created on 17 March 2023, over 1 year ago
Updated 20 August 2024, 3 months ago
📌 Task
Status

Needs work

Version

2.0

Component

Code

Created by

🇮🇳India omkar_yewale Mumbai

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

Merge Requests

Comments & Activities

  • Issue created by @omkar_yewale
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India omkar_yewale Mumbai

    Please review !3 MR.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
    -    // @Todo check if we need this.
    +    // @todo check if we need this.
    

    What follows @todo is a sentence: The first word must be capitalized and the sentence must end with a period.

    +/**
    + * @file
    + * Installation functions for Term Reference Fancytree module.
    + */

    The usual description is Installation and update hooks for [module name].

    /**
    - * @var $form_state \Drupal\Core\Form\FormState
    + * @var \Drupal\Core\Form\FormState $form_state
    */

    Those comments are written in a single line, not three.

    /** @var \Drupal\Core\Form\FormState $form_state */

    See User::baseFieldDefinitions(), for example.

        /** @var \Drupal\Core\Field\BaseFieldDefinition[] $fields */
        $fields = parent::baseFieldDefinitions($entity_type);
        $fields['uid']
          ->setLabel(t('User ID'))
          ->setDescription(t('The user ID.'));
        $fields['uuid']
          ->setDescription(t('The user UUID.'));
    
  • 🇮🇳India omkar_yewale Mumbai

    Hi @apaderno MR updated Please check.
    and for @todo statement reference

  • Status changed to Needs work over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    That is a still-open issue, which means nothing has been yet changed in the coding standards.
    Until then, what follows @todo must be a sentence, which (as per sentence definition) must start with a capitalized word and end with a period.

  • 🇮🇳India omkar_yewale Mumbai

    We will get this warning if we change @todo to @Todo
    WARNING | [x] '@Todo check if we need this.' should match the format '@todo Fix problem X here.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    @todo is not part of the sentence. That is why I said what follows @todo must be a sentence.

  • Status changed to Needs review over 1 year ago
  • 🇮🇳India omkar_yewale Mumbai

    MR updated Please review.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • Status changed to Needs work 3 months ago
  • The reported Problem/Motivation aren't the only phpcs errors that was thrown. Please see below:

    ➜  contrib git:(main) ✗ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig term_reference_fancytree
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue/web/modules/contrib/term_reference_fancytree/term_reference_fancytree.install
    ----------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------------------------------------
     1 | ERROR | [x] Missing file doc comment
    ----------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue/web/modules/contrib/term_reference_fancytree/docs/how-it-works.md
    ----------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 10 WARNINGS AFFECTING 10 LINES
    ----------------------------------------------------------------------------------------------------------------------
      5 | WARNING | Line exceeds 80 characters; contains 121 characters
      8 | WARNING | Line exceeds 80 characters; contains 132 characters
     18 | WARNING | Line exceeds 80 characters; contains 170 characters
     25 | WARNING | Line exceeds 80 characters; contains 186 characters
     31 | WARNING | Line exceeds 80 characters; contains 118 characters
     35 | WARNING | Line exceeds 80 characters; contains 126 characters
     41 | WARNING | Line exceeds 80 characters; contains 110 characters
     43 | WARNING | Line exceeds 80 characters; contains 110 characters
     45 | WARNING | Line exceeds 80 characters; contains 254 characters
     49 | WARNING | Line exceeds 80 characters; contains 156 characters
    ----------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue/web/modules/contrib/term_reference_fancytree/docs/index.md
    ---------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 5 WARNINGS AFFECTING 6 LINES
    ---------------------------------------------------------------------------------------------------------------
      5 | WARNING | [ ] Line exceeds 80 characters; contains 147 characters
      9 | WARNING | [ ] Line exceeds 80 characters; contains 156 characters
     11 | WARNING | [ ] Line exceeds 80 characters; contains 178 characters
     13 | WARNING | [ ] Line exceeds 80 characters; contains 174 characters
     17 | WARNING | [ ] Line exceeds 80 characters; contains 173 characters
     38 | ERROR   | [x] Expected 1 newline at end of file; 2 found
    ---------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue/web/modules/contrib/term_reference_fancytree/readme.md
    -----------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 7 WARNINGS AFFECTING 8 LINES
    -----------------------------------------------------------------------------------------------------------
      5 | WARNING | [ ] Line exceeds 80 characters; contains 147 characters
      9 | WARNING | [ ] Line exceeds 80 characters; contains 156 characters
     11 | WARNING | [ ] Line exceeds 80 characters; contains 178 characters
     13 | WARNING | [ ] Line exceeds 80 characters; contains 174 characters
     17 | WARNING | [ ] Line exceeds 80 characters; contains 173 characters
     34 | WARNING | [ ] Line exceeds 80 characters; contains 121 characters
     37 | WARNING | [ ] Line exceeds 80 characters; contains 132 characters
     42 | ERROR   | [x] Expected 1 newline at end of file; 2 found
    -----------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue/web/modules/contrib/term_reference_fancytree/src/Plugin/Field/FieldWidget/TreeWidget.php
    ----------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 6 ERRORS AND 4 WARNINGS AFFECTING 10 LINES
    ----------------------------------------------------------------------------------------------------------------------------------------------
       9 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Field\FieldItemListInterface.
      60 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
      61 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
      62 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
      63 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
      64 | ERROR   | [x] Array closing indentation error, expected 4 spaces but found 6
      95 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
      99 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     100 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     101 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    ----------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue/web/modules/contrib/term_reference_fancytree/src/Element/TermReferenceFancytree.php
    ----------------------------------------------------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AND 2 WARNINGS AFFECTING 4 LINES
    ----------------------------------------------------------------------------------------------------------------------------------------
       8 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Component\Utility\Html.
     159 | WARNING | [x] '@Todo check if we need this.' should match the format '@todo Fix problem X here.'
     271 | WARNING | [x] The variable name should be defined after the type
     273 | ERROR   | [x] Expected one space after the comma, 0 found
    ----------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue/web/modules/contrib/term_reference_fancytree/src/Controller/SubTreeController.php
    ---------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------------------------------------------------------------
     10 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\term_reference_fancytree\Element\TermReferenceFancytree.
    ---------------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 295ms; Memory: 12MB

    Kindly check

    Thanks,
    Jake

  • Pipeline finished with Success
    3 months ago
    Total: 3687s
    #259577
  • Pipeline finished with Success
    3 months ago
    Total: 3686s
    #259578
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    avpaderno changed the visibility of the branch 3348621-gitlab-ci-reports to hidden.

Production build 0.71.5 2024