Fix the issues reported by phpcs

Created on 27 January 2023, almost 2 years ago
Updated 6 August 2024, 4 months ago

Couple more issues when running

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml $(pwd)

Result: See CI

โœจ Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

๐Ÿ‡ฆ๐Ÿ‡บAustralia VladimirAus Brisbane, Australia

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 @VladimirAus
  • Status changed to Needs work almost 2 years ago
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia VladimirAus Brisbane, Australia

    Added automatic fixed. More issues need fixing:

    
    FILE: /Users/tesboss/_PROJECTS/drupal/linkchecker/linkchecker.module
    ------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 10 ERRORS AFFECTING 9 LINES
    ------------------------------------------------------------------------------------------------------------------------------------------------
      35 | ERROR | [ ] Missing parameter type
      38 | ERROR | [ ] Missing parameter type
      44 | ERROR | [ ] Missing parameter type
      48 | ERROR | [ ] Missing parameter type
      50 | ERROR | [ ] Missing parameter type
      53 | ERROR | [x] Tag value indented incorrectly; expected 1 space but found 3
      53 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 1 spaces
     130 | ERROR | [ ] Doc comment is empty
     136 | ERROR | [ ] The array declaration extends to column 142 (the limit is 80). The array content should be split up over multiple lines
     296 | ERROR | [ ] unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
    ------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/tesboss/_PROJECTS/drupal/linkchecker/tests/src/Functional/LinkCheckerInterfaceTest.php
    ---------------------------------------------------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    ---------------------------------------------------------------------------------------------------------------------------------------
     151 | ERROR | The array declaration extends to column 151 (the limit is 80). The array content should be split up over multiple lines
     189 | ERROR | The array declaration extends to column 159 (the limit is 80). The array content should be split up over multiple lines
    ---------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/tesboss/_PROJECTS/drupal/linkchecker/tests/src/Functional/LinkCheckerLinkExtractionTest.php
    -----------------------------------------------------------------------------------------------------------------------------------------
    FOUND 6 ERRORS AND 4 WARNINGS AFFECTING 10 LINES
    -----------------------------------------------------------------------------------------------------------------------------------------
      36 | ERROR   | Doc comment is empty
     200 | ERROR   | The array declaration extends to column 151 (the limit is 80). The array content should be split up over multiple lines
     254 | ERROR   | The array declaration extends to column 199 (the limit is 80). The array content should be split up over multiple lines
     266 | ERROR   | The array declaration extends to column 270 (the limit is 80). The array content should be split up over multiple lines
     277 | ERROR   | The array declaration extends to column 151 (the limit is 80). The array content should be split up over multiple lines
     305 | WARNING | Line exceeds 80 characters; contains 210 characters
     308 | WARNING | Line exceeds 80 characters; contains 105 characters
     315 | ERROR   | The array declaration extends to column 270 (the limit is 80). The array content should be split up over multiple lines
     349 | WARNING | Line exceeds 80 characters; contains 110 characters
     377 | WARNING | Line exceeds 80 characters; contains 126 characters
    -----------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/tesboss/_PROJECTS/drupal/linkchecker/tests/src/Kernel/LinkcheckerLinkExtractorServiceTest.php
    ----------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------------
     166 | WARNING | Unused variable $relativeUrl.
    ----------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/tesboss/_PROJECTS/drupal/linkchecker/src/LinkCleanUp.php
    -----------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------
     15 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
    -----------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/tesboss/_PROJECTS/drupal/linkchecker/src/Form/LinkCheckerAdminSettingsForm.php
    -----------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 9 WARNINGS AFFECTING 9 LINES
    -----------------------------------------------------------------------------------------------------------------------------------------
     176 | WARNING | #options values usually have to run through t() for translation
     177 | WARNING | #options values usually have to run through t() for translation
     294 | WARNING | #options values usually have to run through t() for translation
     295 | WARNING | #options values usually have to run through t() for translation
     296 | WARNING | #options values usually have to run through t() for translation
     297 | WARNING | #options values usually have to run through t() for translation
     298 | WARNING | #options values usually have to run through t() for translation
     371 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     371 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     372 | ERROR   | The array declaration extends to column 880 (the limit is 80). The array content should be split up over multiple lines
    -----------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/tesboss/_PROJECTS/drupal/linkchecker/src/Plugin/LinkExtractor/LinkLinkExtractor.php
    -----------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------
     17 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
    -----------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/tesboss/_PROJECTS/drupal/linkchecker/src/Plugin/LinkExtractor/HtmlLinkExtractor.php
    ------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    ------------------------------------------------------------------------------------------------------------------
      20 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
     105 | WARNING | '@todo' should match the format '@todo Fix problem X here.'
    ------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/tesboss/_PROJECTS/drupal/linkchecker/src/Plugin/LinkStatusHandler/Repair301.php
    --------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------
     276 | WARNING | '@todo' should match the format '@todo Fix problem X here.'
    --------------------------------------------------------------------------------------------
    
    
    FILE: /Users/tesboss/_PROJECTS/drupal/linkchecker/src/LinkCheckerService.php
    -----------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------
     20 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
    -----------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/tesboss/_PROJECTS/drupal/linkchecker/src/LinkCheckerLinkAccessControlHandler.php
    ---------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------
     53 | ERROR | Unnecessarily gendered language in a comment
    ---------------------------------------------------------------------------------------------
    
    
    FILE: /Users/tesboss/_PROJECTS/drupal/linkchecker/src/Commands/LinkCheckerCommands.php
    --------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    --------------------------------------------------------------------------------------
     149 | WARNING | Exceptions should not be translated
     153 | WARNING | Exceptions should not be translated
    --------------------------------------------------------------------------------------
    
    Time: 2.94 secs; Memory: 14MB
    
    
    
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia VladimirAus Brisbane, Australia
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia VladimirAus Brisbane, Australia
  • Assigned to spriya2896
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia spriya2896

    I will work on this issue.

  • Issue was unassigned.
  • Status changed to Needs review almost 2 years ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nayana_mvr

    Reviewed MR!39 and there was a warning message while applying the patch

    39.diff:189: trailing whitespace.
          $form['error']['#description'] = $this->t('If enabled, outdated links in content providing a status 
    ....
    warning: 1 line adds whitespace errors.

    Also, there is one more coding standard issue that needs to be fixed

    FILE: ../linkchecker/linkchecker.module
    --------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------------------------------
     299 | ERROR | unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
    --------------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 1.47 secs; Memory: 16MB
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rassoni Bangalore

    Rashmisoni โ†’ made their first commit to this issueโ€™s fork.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
  • Status changed to RTBC over 1 year ago
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia VladimirAus Brisbane, Australia

    No phpcs warnings. Happy with that!
    Thank for your contributions! ๐Ÿป

  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia VladimirAus Brisbane, Australia
  • Status changed to Needs review 4 months ago
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia VladimirAus Brisbane, Australia
  • Status changed to RTBC 4 months ago
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia jannakha Brisbane!

    phpcs is green

  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia VladimirAus Brisbane, Australia
  • Pipeline finished with Skipped
    4 months ago
    #231815
  • Status changed to Fixed 4 months ago
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia VladimirAus Brisbane, Australia

    Committed! Thank you! ๐Ÿป

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024