Fix the issues reported by phpcs

Created on 22 March 2024, 3 months ago
Updated 26 April 2024, 2 months ago

Problem/Motivation

FILE: /var/www/html/drupal-contri-d10/modules/contrib/captchetat/src/Form/CaptchetatSettingsForm.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------
39 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupal-contri-d10/modules/contrib/captchetat/src/Controller/CaptchetatController.php
------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 7 WARNINGS AFFECTING 11 LINES
------------------------------------------------------------------------------------------------------------------
10 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
16 | ERROR | Description for the @return value is missing
20 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
47 | ERROR | Description for the @return value is missing
50 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
86 | ERROR | Description for the @return value is missing
90 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
91 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
117 | ERROR | Description for the @return value is missing
121 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
122 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupal-contri-d10/modules/contrib/captchetat/src/Plugin/WebformElement/WebformCaptchetatElement.php
-----------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------
43 | WARNING | Possible useless method overriding detected
-----------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupal-contri-d10/modules/contrib/captchetat/css/captchetat.css
-----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------
1 | ERROR | [x] Additional whitespace found at start of file
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------

FILE: /var/www/html/drupal-contri-d10/modules/contrib/captchetat/README.md
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------
52 | WARNING | Line exceeds 80 characters; contains 85 characters
--------------------------------------------------------------------------

FILE: /var/www/html/drupal-contri-d10/modules/contrib/captchetat/js/jquery-captcha.min.js
-----------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------
1 | WARNING | File appears to be minified and cannot be processed
-----------------------------------------------------------------------------------------

FILE: /var/www/html/drupal-contri-d10/modules/contrib/captchetat/captchetat.module
----------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
----------------------------------------------------------------------------------
3 | ERROR | Missing short description in doc comment
40 | WARNING | Line exceeds 80 characters; contains 86 characters
50 | ERROR | Comment indentation error, expected only 1 spaces
----------------------------------------------------------------------------------

FILE: /var/www/html/drupal-contri-d10/modules/contrib/captchetat/captchetat.info.yml
-------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
1 | WARNING | Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically
1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
-------------------------------------------------------------------------------------------------------------

Time: 201ms; Memory: 12MB

Steps to reproduce

vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml modules/custom/google_translator/

Proposed resolution

Fixed the coding standards.

Remaining tasks

Submit the patch either MR .

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India bhaveshdas

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 @bhaveshdas
  • 🇮🇳India bhaveshdas

    hello,

    fixed all issue.
    But still there are one issues left.
    could you please review it.

    FILE: /var/www/html/drupal-contri-d10/modules/contrib/captchetat/css/captchetat.css
    -----------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -----------------------------------------------------------------------------------
     1 | ERROR | [x] Expected 1 newline at end of file; 0 found
    -----------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------
    
    Time: 216ms; Memory: 12MB
    
  • 🇱🇧Lebanon ewehbe

    Hi,
    I took into consideration the patch that you have provided.
    But, this patch causes problem in the CaptchetatController.
    So I have applied the code standards with phpcs and modified the CaptchetatController.

  • Status changed to RTBC 3 months ago
  • 🇱🇧Lebanon ewehbe
  • Status changed to Fixed 2 months ago
  • 🇱🇧Lebanon ewehbe
  • Status changed to Fixed 2 months ago
  • 🇱🇧Lebanon ewehbe
Production build 0.69.0 2024