Fix the issues reported by phpcs

Created on 15 May 2023, over 1 year ago
Updated 17 May 2023, over 1 year ago

Problem/Motivation

Module's code contains several Drupal Coding Standards issues. This task is created to fix them.

Steps to reproduce

Run the command:

phpcs --standard=Drupal
/web/modules/contrib/link_filebrowser/

Proposed resolution

Fix the following coding standards issues and upload the patch or create an MR with fixes.

FILE: \modules\contrib\link_filebrowser\css\filebrowser.css
-----------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
-----------------------------------------------------------------------------------------------------------


FILE: \modules\contrib\link_filebrowser\js\filebrowser-block.js
-----------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
 21 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 43 | ERROR | [x] Expected 1 space before "+"; 0 found
 43 | ERROR | [x] Expected 1 space after "+"; 0 found
 52 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
-----------------------------------------------------------------------------------------------------------


FILE: \web\modules\contrib\link_filebrowser\js\filebrowser.js
-----------------------------------------------------------------------------------------------------------
FOUND 126 ERRORS AFFECTING 20 LINES
-----------------------------------------------------------------------------------------------------------
   1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
  22 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
  78 | ERROR | [x] Expected 1 space after "<"; 0 found
  78 | ERROR | [x] Expected 1 space before "="; 0 found
  78 | ERROR | [x] Expected 1 space after "="; 0 found
  78 | ERROR | [x] Expected 1 space before "="; 0 found
  78 | ERROR | [x] Expected 1 space after "="; 0 found
  78 | ERROR | [x] Expected 1 space before "="; 0 found
  78 | ERROR | [x] Expected 1 space after "="; 0 found
  78 | ERROR | [x] Expected 1 space before ">"; 0 found
  79 | ERROR | [x] Expected 1 space after "<"; 0 found
  79 | ERROR | [x] Expected 1 space before "="; 0 found
  79 | ERROR | [x] Expected 1 space after "="; 0 found
  79 | ERROR | [x] Expected 1 space before "-"; 0 found
  79 | ERROR | [x] Expected 1 space after "-"; 0 found
  79 | ERROR | [x] Expected 1 space before "-"; 0 found
  79 | ERROR | [x] Expected 1 space after "-"; 0 found
  79 | ERROR | [x] Expected 1 space before "="; 0 found
  79 | ERROR | [x] Expected 1 space after "="; 0 found
  79 | ERROR | [x] Expected 1 space before "-"; 0 found
  79 | ERROR | [x] Expected 1 space after "-"; 0 found
  79 | ERROR | [x] Expected 1 space before "-"; 0 found
  79 | ERROR | [x] Expected 1 space after "-"; 0 found
  79 | ERROR | [x] Expected 1 space before "="; 0 found
  79 | ERROR | [x] Expected 1 space after "="; 0 found
  79 | ERROR | [x] Expected 1 space before "="; 0 found
  79 | ERROR | [x] Expected 1 space after "="; 0 found
  79 | ERROR | [x] Expected 1 space before "="; 0 found
  79 | ERROR | [x] Expected 1 space after "="; 0 found
  79 | ERROR | [x] Expected 1 space before ">"; 0 found
  79 | ERROR | [x] Expected 1 space after ">"; 0 found
  79 | ERROR | [x] Expected 1 space before "<"; 0 found
  79 | ERROR | [x] Expected 1 space after "<"; 0 found
  79 | ERROR | [x] Expected 1 space before "/"; 0 found
  79 | ERROR | [x] Expected 1 space after "/"; 0 found
  79 | ERROR | [x] Expected 1 space before ">"; 0 found
  80 | ERROR | [x] Expected 1 space after "<"; 0 found
  80 | ERROR | [x] Expected 1 space before "="; 0 found
  80 | ERROR | [x] Expected 1 space after "="; 0 found
  80 | ERROR | [x] Expected 1 space before ">"; 0 found
  81 | ERROR | [x] Expected 1 space after "<"; 0 found
  81 | ERROR | [x] Expected 1 space before "="; 0 found
  81 | ERROR | [x] Expected 1 space after "="; 0 found
  81 | ERROR | [x] Expected 1 space before ">"; 0 found
  82 | ERROR | [x] Expected 1 space after "<"; 0 found
  82 | ERROR | [x] Expected 1 space before "="; 0 found
  82 | ERROR | [x] Expected 1 space after "="; 0 found
  82 | ERROR | [x] Expected 1 space before ">"; 0 found
  83 | ERROR | [x] Expected 1 space after "<"; 0 found
  83 | ERROR | [x] Expected 1 space before "="; 0 found
  83 | ERROR | [x] Expected 1 space after "="; 0 found
  83 | ERROR | [x] Expected 1 space before "="; 0 found
  83 | ERROR | [x] Expected 1 space after "="; 0 found
  83 | ERROR | [x] Expected 1 space before ">"; 0 found
  84 | ERROR | [x] Expected 1 space after "<"; 0 found
  84 | ERROR | [x] Expected 1 space before "="; 0 found
  84 | ERROR | [x] Expected 1 space after "="; 0 found
  84 | ERROR | [x] Expected 1 space before ">"; 0 found
  84 | ERROR | [x] Expected 1 space after ">"; 0 found
  84 | ERROR | [x] Expected 1 space before "<"; 0 found
  84 | ERROR | [x] Expected 1 space after "<"; 0 found
  84 | ERROR | [x] Expected 1 space before "/"; 0 found
  84 | ERROR | [x] Expected 1 space after "/"; 0 found
  84 | ERROR | [x] Expected 1 space before ">"; 0 found
  85 | ERROR | [x] Expected 1 space after "<"; 0 found
  85 | ERROR | [x] Expected 1 space before "/"; 0 found
  85 | ERROR | [x] Expected 1 space after "/"; 0 found
  85 | ERROR | [x] Expected 1 space before ">"; 0 found
  86 | ERROR | [x] Expected 1 space after "<"; 0 found
  86 | ERROR | [x] Expected 1 space before "="; 0 found
  86 | ERROR | [x] Expected 1 space after "="; 0 found
  86 | ERROR | [x] Expected 1 space before "="; 0 found
  86 | ERROR | [x] Expected 1 space after "="; 0 found
  86 | ERROR | [x] Expected 1 space before "-"; 0 found
  86 | ERROR | [x] Expected 1 space after "-"; 0 found
  86 | ERROR | [x] Expected 1 space before "-"; 0 found
  86 | ERROR | [x] Expected 1 space after "-"; 0 found
  86 | ERROR | [x] Expected 1 space before "="; 0 found
  86 | ERROR | [x] Expected 1 space after "="; 0 found
  86 | ERROR | [x] Expected 1 space before "-"; 0 found
  86 | ERROR | [x] Expected 1 space after "-"; 0 found
  86 | ERROR | [x] Expected 1 space before "="; 0 found
  86 | ERROR | [x] Expected 1 space after "="; 0 found
  86 | ERROR | [x] Expected 1 space before "="; 0 found
  86 | ERROR | [x] Expected 1 space after "="; 0 found
  86 | ERROR | [x] Expected 1 space before ">"; 0 found
  86 | ERROR | [x] Expected 1 space after ">"; 0 found
  86 | ERROR | [x] Expected 1 space before "<"; 0 found
  86 | ERROR | [x] Expected 1 space after "<"; 0 found
  86 | ERROR | [x] Expected 1 space before "/"; 0 found
  86 | ERROR | [x] Expected 1 space after "/"; 0 found
  86 | ERROR | [x] Expected 1 space before ">"; 0 found
  87 | ERROR | [x] Expected 1 space after "<"; 0 found
  87 | ERROR | [x] Expected 1 space before "/"; 0 found
  87 | ERROR | [x] Expected 1 space after "/"; 0 found
  87 | ERROR | [x] Expected 1 space before ">"; 0 found
  88 | ERROR | [x] Expected 1 space after "<"; 0 found
  88 | ERROR | [x] Expected 1 space before "="; 0 found
  88 | ERROR | [x] Expected 1 space after "="; 0 found
  88 | ERROR | [x] Expected 1 space before ">"; 0 found
  88 | ERROR | [x] Expected 1 space after ">"; 0 found
  88 | ERROR | [x] Expected 1 space before "<"; 0 found
  88 | ERROR | [x] Expected 1 space after "<"; 0 found
  88 | ERROR | [x] Expected 1 space before "/"; 0 found
  88 | ERROR | [x] Expected 1 space after "/"; 0 found
  88 | ERROR | [x] Expected 1 space before ">"; 0 found
  89 | ERROR | [x] Expected 1 space after "<"; 0 found
  89 | ERROR | [x] Expected 1 space before "/"; 0 found
  89 | ERROR | [x] Expected 1 space after "/"; 0 found
  89 | ERROR | [x] Expected 1 space before ">"; 0 found
  90 | ERROR | [x] Expected 1 space after "<"; 0 found
  90 | ERROR | [x] Expected 1 space before "/"; 0 found
  90 | ERROR | [x] Expected 1 space after "/"; 0 found
  90 | ERROR | [x] Expected 1 space before ">"; 0 found
  91 | ERROR | [x] Expected 1 space after "<"; 0 found
  91 | ERROR | [x] Expected 1 space before "/"; 0 found
  91 | ERROR | [x] Expected 1 space after "/"; 0 found
  91 | ERROR | [x] Expected 1 space before ">"; 0 found
  91 | ERROR | [x] Expected 1 space after ">"; 0 found
  92 | ERROR | [x] Expected 1 space after "?"; 0 found
  92 | ERROR | [x] Expected 1 space before "?"; 0 found
  93 | ERROR | [x] Space after closing parenthesis of function call prohibited
  93 | ERROR | [x] Space found before semicolon; expected ");" but found ") ;"
 108 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 130 | ERROR | [x] Expected 1 space before "+"; 0 found
 130 | ERROR | [x] Expected 1 space after "+"; 0 found
-------------------------------------------------------------------------------------------------------------


FILE: \web\modules\contrib\link_filebrowser\src\Controller\LinkFileBrowserController.php
-------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
-------------------------------------------------------------------------------------------------------------


FILE: \modules\contrib\link_filebrowser\src\Plugin\Block\FileBrowserBlock.php
-------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
-------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------


FILE:\modules\contrib\link_filebrowser\src\Plugin\Field\FieldFormatter\ExplorerLinkFormatter.php
-------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
-------------------------------------------------------------------------------------------------------------


FILE: \modules\contrib\link_filebrowser\src\Plugin\Field\FieldWidget\ExplorerLinkWidget.php
--------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
--------------------------------------------------------------------------------------------------------------
๐Ÿ“Œ Task
Status

Closed: won't fix

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia Shanu Chouhan

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.

  • Needs reroll

    The patch will have to be re-rolled with new suggestions/changes described in the comments in the issue.

Sign in to follow issues

Comments & Activities

  • Issue created by @Shanu Chouhan
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Shanu Chouhan

    Here's a patch for it.

  • Status changed to RTBC over 1 year ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines kenyoOwen

    Hi Shanu Chouhan

    I applied patch #2 to the โ€œLink file browserโ€ module and confirmed that the mentioned PHPCS issues are resolved. Please see the screenshots attached.

    For your review.
    Thank you.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    The patch changes only JavaScript files, but the report shows warnings/errors also for PHP files.

  • Status changed to Closed: won't fix over 1 year ago
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance lazzyvn paris

    @Shanu Chouhan are you serious ? You need to have basic javascript/HTML knowledge before you fix something.
    I reject all I don't think the reviewer ran this patch. In javascript true Not TRUE.
    + contextmenu: TRUE,
    nobody write html like this
    + < p class = "modal-body browser" > < / p >

Production build 0.71.5 2024