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

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

VladimirAus created an issue. See original summary.

vladimiraus’s picture

Issue summary: View changes
Status: Active » Needs work

Added automatic fixed. More issues need fixing:


FILE: /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: /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: /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: /linkchecker/tests/src/Kernel/LinkcheckerLinkExtractorServiceTest.php
----------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------
 166 | WARNING | Unused variable $relativeUrl.
----------------------------------------------------------------------------------------------------------


FILE: /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: /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: /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: /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: /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: /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: /linkchecker/src/LinkCheckerLinkAccessControlHandler.php
---------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------
 53 | ERROR | Unnecessarily gendered language in a comment
---------------------------------------------------------------------------------------------


FILE: /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


vladimiraus’s picture

Issue summary: View changes
vladimiraus’s picture

spriya2896’s picture

Assigned: Unassigned » spriya2896

I will work on this issue.

spriya2896’s picture

Assigned: spriya2896 » Unassigned
Status: Needs work » Needs review
nayana_mvr’s picture

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

Rashmisoni made their first commit to this issue’s fork.

avpaderno’s picture

Title: Fix coding standards for D10 » Fix the issues reported by phpcs
Issue tags: - +Coding standards
vladimiraus’s picture

Status: Needs review » Reviewed & tested by the community

No phpcs warnings. Happy with that!
Thank for your contributions! 🍻

vladimiraus’s picture

Issue summary: View changes
vladimiraus’s picture

Status: Reviewed & tested by the community » Needs review
jannakha’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -ContributionWeekend2023

phpcs is green

vladimiraus’s picture

  • VladimirAus committed bd7d6ff0 on 2.0.x
    Issue #3336977 by VladimirAus, spriya2896, Rassoni, jannakha: Fix the...
vladimiraus’s picture

Status: Reviewed & tested by the community » Fixed

Committed! Thank you! 🍻

Status: Fixed » Closed (fixed)

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