Fix the issues reported by phpcs

Created on 14 December 2022, over 1 year ago
Updated 29 May 2023, about 1 year ago

Problem/Motivation

While checking for coding standards in the written code by executing code sniffer command, found that there are lot of issues which needs to be fixed. For checking errors, see: Error-List →

Steps to reproduce

Execute:- "phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig site_audit/"

For issues:

1. Missing parameter comment: Follow issue https://www.drupal.org/project/site_audit/issues/3327016 📌 Missing parameter comment Needs review
2. Line exceeds 80 characters: Follow issue https://www.drupal.org/project/site_audit/issues/3327015 📌 Line exceeds 80 characters Needs review

Remaining Tasks

FILE: ...var/www/html/contribution/drupal8/web/modules/site_audit-3327022/README.md
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
72 | WARNING | Line exceeds 80 characters; contains 86 characters
--------------------------------------------------------------------------------

FILE: .../drupal8/web/modules/site_audit-3327022/src/Plugin/SiteAuditReportBase.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
116 | WARNING | Unused variable $this_def.
--------------------------------------------------------------------------------

FILE: ...web/modules/site_audit-3327022/src/Plugin/SiteAuditCheck/ExtensionsDev.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
--------------------------------------------------------------------------------
42 | WARNING | Unused variable $ret_val.
45 | WARNING | Unused variable $show_table.
47 | WARNING | Unused variable $show_table.
--------------------------------------------------------------------------------

FILE: ...modules/site_audit-3327022/src/Plugin/SiteAuditCheck/UsersCountBlocked.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------
32 | WARNING | Code after the RETURN statement on line 30 cannot be executed
35 | WARNING | Code after the RETURN statement on line 34 cannot be executed
--------------------------------------------------------------------------------

FILE: ...modules/site_audit-3327022/src/Plugin/SiteAuditCheck/DatabaseCollation.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
93 | ERROR | The array declaration extends to column 117 (the limit is 80).
| | The array content should be split up over multiple lines
--------------------------------------------------------------------------------

FILE: ...eb/modules/site_audit-3327022/src/Plugin/SiteAuditCheck/WatchdogSyslog.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AND 2 WARNINGS AFFECTING 3 LINES
--------------------------------------------------------------------------------
55 | WARNING | Line exceeds 80 characters; contains 119 characters
56 | WARNING | Line exceeds 80 characters; contains 161 characters
56 | ERROR | Comment indentation error, expected only 1 spaces
68 | ERROR | Comment indentation error, expected only 1 spaces
--------------------------------------------------------------------------------

FILE: ...n/drupal8/web/modules/site_audit-3327022/src/Plugin/SiteAuditCheckBase.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
332 | ERROR | The array declaration extends to column 111 (the limit is 80).
| | The array content should be split up over multiple lines
--------------------------------------------------------------------------------

FILE: ...pal8/web/modules/site_audit-3327022/src/Controller/SiteAuditController.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
93 | WARNING | \Drupal calls should be avoided in classes, use dependency
| | injection instead
--------------------------------------------------------------------------------

FILE: .../contribution/drupal8/web/modules/site_audit-3327022/src/Renderer/Html.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
192 | ERROR | No key specified for array entry; first entry specifies key
365 | ERROR | No key specified for array entry; first entry specifies key
--------------------------------------------------------------------------------

FILE: ...tribution/drupal8/web/modules/site_audit-3327022/src/Renderer/Markdown.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
36 | WARNING | Do not concatenate strings to translatable strings, they should
| | be part of the t() argument and you should use placeholders
--------------------------------------------------------------------------------

FILE: ...ntribution/drupal8/web/modules/site_audit-3327022/src/Renderer/Console.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------
302 | WARNING | Unused variable $class.
305 | WARNING | Unused variable $class.
--------------------------------------------------------------------------------

Time: 4.16 secs; Memory: 14MB

📌 Task
Status

Needs review

Version

3.0

Component

Code

Created by

🇮🇳India urvashi_vora Madhya Pradesh, India

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

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024