Fix the issues reported by phpcs

Created on 16 July 2024, 5 months ago
Updated 17 July 2024, 5 months ago

Problem/Motivation

Command : phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml,twig web/modules/contrib/copy_field/

FILE: /var/www/html/d10/web/modules/contrib/copy_field/clipboardjs/clipboard.js
-------------------------------------------------------------------------------------------------
FOUND 157 ERRORS AFFECTING 122 LINES
-------------------------------------------------------------------------------------------------
   8 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
   8 | ERROR | [x] Inline control structures are not allowed
   9 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  10 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  10 | ERROR | [x] Inline control structures are not allowed
  11 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  12 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  12 | ERROR | [x] Inline control structures are not allowed
  13 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  14 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  14 | ERROR | [x] Inline control structures are not allowed
  15 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  16 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
  17 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
  18 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
  21 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
  27 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
  49 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
  52 | ERROR | [x] Space found before semicolon; expected "};" but found "}\n;"
  53 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
  93 | ERROR | [x] Space found before semicolon; expected "};" but found "}\n;"
  94 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 3 empty lines
 118 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
 128 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 142 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 3 empty lines
 144 | ERROR | [ ] More than 2 empty lines are not allowed
 163 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
 178 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
 185 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
 200 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 200 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 200 | ERROR | [x] Inline control structures are not allowed
 200 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 202 | ERROR | [x] Inline control structures are not allowed
 202 | ERROR | [x] Inline control structures are not allowed
 204 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 204 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 204 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 204 | ERROR | [x] Inline control structures are not allowed
 214 | ERROR | [x] Inline control structures are not allowed
 214 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 214 | ERROR | [x] Inline control structures are not allowed
 214 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 214 | ERROR | [x] Inline control structures are not allowed
 214 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 214 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 214 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 217 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 6 empty lines
 219 | ERROR | [ ] More than 2 empty lines are not allowed
 220 | ERROR | [ ] More than 2 empty lines are not allowed
 221 | ERROR | [ ] More than 2 empty lines are not allowed
 222 | ERROR | [ ] More than 2 empty lines are not allowed
 242 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
 271 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
 422 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 446 | ERROR | [x] Expected 0 spaces before opening parenthesis; 1 found
 457 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
 462 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 482 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 501 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 508 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 508 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 532 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 542 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
 547 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 555 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 567 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 582 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 593 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 598 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
 603 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 657 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 673 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 678 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 679 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 700 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
 705 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 750 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
 755 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 757 | ERROR | [x] Expected 0 spaces before opening parenthesis; 1 found
 776 | ERROR | [x] Expected 0 spaces before opening parenthesis; 1 found
 805 | ERROR | [x] Inline control structures are not allowed
 824 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
 828 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 830 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 831 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 832 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 832 | ERROR | [x] Whitespace found at end of line
 833 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 834 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 835 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 836 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 837 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 838 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 839 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 840 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 841 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 842 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 843 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 844 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 845 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 845 | ERROR | [x] Whitespace found at end of line
 846 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 847 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 848 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 848 | ERROR | [x] Whitespace found at end of line
 849 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 850 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 851 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 852 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 852 | ERROR | [x] Whitespace found at end of line
 854 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 855 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 855 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 856 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 857 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 857 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 858 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 859 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 859 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 860 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 860 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 861 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 862 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 863 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 864 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 865 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 865 | ERROR | [x] Whitespace found at end of line
 866 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 867 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 867 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 868 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 869 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 869 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 870 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 871 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 872 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 872 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 873 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 874 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 875 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 876 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 877 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 877 | ERROR | [x] Whitespace found at end of line
 878 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 879 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 879 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 880 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 880 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 881 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 882 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 882 | ERROR | [x] Whitespace found at end of line
 884 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 885 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 886 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 887 | ERROR | [x] Spaces must be used for alignment; tabs are not allowed
 890 | ERROR | [x] Expected 1 newline at end of file; 0 found
-------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 152 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------


FILE: /var/www/html/d10/web/modules/contrib/copy_field/clipboardjs/copy-to-clipboard.js
---------------------------------------------------------------------------------------
FOUND 13 ERRORS AFFECTING 4 LINES
---------------------------------------------------------------------------------------
  3 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
  8 | ERROR | [x] Expected 1 space after "<"; 0 found
  8 | ERROR | [x] Expected 1 space before "="; 0 found
  8 | ERROR | [x] Expected 1 space after "="; 0 found
  8 | ERROR | [x] Expected 1 space before ">"; 0 found
  8 | ERROR | [x] Expected 1 space after ">"; 0 found
  8 | ERROR | [x] Expected 1 space before "<"; 0 found
  8 | ERROR | [x] Expected 1 space after "<"; 0 found
  8 | ERROR | [x] Expected 1 space before "/"; 0 found
  8 | ERROR | [x] Expected 1 space after "/"; 0 found
  8 | ERROR | [x] Expected 1 space before ">"; 0 found
 25 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 35 | ERROR | [x] Expected 1 newline at end of file; 0 found
---------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 13 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------


FILE: /var/www/html/d10/web/modules/contrib/copy_field/clipboardjs/clipboard.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/d10/web/modules/contrib/copy_field/copy_field.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
-------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/d10/web/modules/contrib/copy_field/copy_field.module
---------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------
 57 | ERROR | [ ] copy_field_uninstall() is an installation hook and must be declared in an install file
 77 | ERROR | [x] Expected 1 newline at end of file; 0 found
---------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------

Time: 339ms; Memory: 20MB



Steps to reproduce

Run PHPCS on Config Pages module.

Proposed resolution

Fixed the coding standards.

Remaining tasks

Submit the patch either MR.

📌 Task
Status

RTBC

Version

1.1

Component

Code

Created by

🇮🇳India hetal.solanki

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 @hetal.solanki
  • Pipeline finished with Success
    5 months ago
    Total: 165s
    #225501
  • Merge request !5Coding Standard Issue → (Open) created by hetal.solanki
  • Pipeline finished with Success
    5 months ago
    Total: 174s
    #225519
  • Issue was unassigned.
  • Status changed to Needs work 5 months ago
  • 🇮🇳India bhaveshdas

    I applied MR!5 and I still encountered some issues after I ran vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml,twig modules/custom/copy_field-3461761/

    FILE: /var/www/html/drupal-contri-d10/modules/custom/copy_field-3461761/clipboardjs/clipboard.js
    ------------------------------------------------------------------------------------------------
    FOUND 24 ERRORS AFFECTING 17 LINES
    ------------------------------------------------------------------------------------------------
      18 | ERROR | [x] Opening brace must be the last content on the line
      28 | ERROR | [x] Opening brace must be the last content on the line
     136 | ERROR | [x] Opening brace must be the last content on the line
     136 | ERROR | [x] Opening brace must be the last content on the line
     136 | ERROR | [x] Opening brace must be the last content on the line
     186 | ERROR | [x] Opening brace must be the last content on the line
     186 | ERROR | [x] Opening brace must be the last content on the line
     186 | ERROR | [x] Opening brace must be the last content on the line
     188 | ERROR | [x] Opening brace must be the last content on the line
     190 | ERROR | [x] Opening brace must be the last content on the line
     193 | ERROR | [x] Opening brace must be the last content on the line
     197 | ERROR | [x] Opening brace must be the last content on the line
     200 | ERROR | [x] Opening brace must be the last content on the line
     200 | ERROR | [x] Opening brace must be the last content on the line
     202 | ERROR | [x] Opening brace must be the last content on the line
     202 | ERROR | [x] Opening brace must be the last content on the line
     204 | ERROR | [x] Opening brace must be the last content on the line
     206 | ERROR | [x] Opening brace must be the last content on the line
     208 | ERROR | [x] Opening brace must be the last content on the line
     213 | ERROR | [x] Opening brace must be the last content on the line
     213 | ERROR | [x] Opening brace must be the last content on the line
     844 | ERROR | [x] Opening brace must be the last content on the line
     845 | ERROR | [x] Opening brace must be the last content on the line
     865 | ERROR | [x] Opening brace must be the last content on the line
    ------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 24 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------
    
    Time: 179ms; Memory: 20MB
    
  • Pipeline finished with Success
    5 months ago
    Total: 165s
    #225618
  • Status changed to Needs review 5 months ago
  • 🇮🇳India bhaveshdas

    I have fixed remaining phpcs issues.
    Could you please review it.

    Thankyou !

  • Assigned to hetal.solanki
  • Issue was unassigned.
  • Status changed to RTBC 5 months ago
  • 🇮🇳India hetal.solanki

    @bhaveshdas

    As I have reviewed MR!5, there is no PHPCS issue left. So I am moving this to RTBC.

    Thank you!!

Production build 0.71.5 2024