Coding Standard issues

Created on 29 February 2024, 10 months ago
Updated 16 March 2024, 9 months ago

Problem/Motivation

Found coding standard issues at the module.

Steps to reproduce

I have used the folloe=wing command
vendor/bin/phpcbf --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml ./
List of issues:


FILE:/insert_view_adv/src/Form/InsertViewDialog.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 3 WARNINGS AFFECTING 6 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
  16 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\field\Entity\FieldStorageConfig.
  24 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
 101 | WARNING | [ ] Line exceeds 80 characters; contains 92 characters
 162 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 293 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 430 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------


FILE: /insert_view_adv/src/Plugin/CKEditor5Plugin/InsertView.php
--------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------
 27 | ERROR | [x] Each PHP statement must be on a line by itself
--------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------


FILE: /insert_view_adv/src/Ajax/InsertViewCommand.php
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------------
 7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Ajax\CommandWithAttachedAssetsInterface.
---------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------


FILE: /insert_view_adv/src/Controller/AdvancedInsertViewController.php
--------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------
 21 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
--------------------------------------------------------------------------------------------------------------------------


FILE: /insert_view_adv/modules/bueditor/src/Plugin/BUEditorPlugin/DrupalViews.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------------------
  6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\bueditor\BUEditorPluginBase.
 32 | ERROR | [ ] Public method name "DrupalViews::alterEditorJS" is not in lowerCamel format
-------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------

Time: 223ms; Memory: 14MB

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇮🇳India adwivedi008

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

Production build 0.71.5 2024