coding standards and best practices

Created on 21 December 2022, almost 2 years ago
Updated 24 January 2023, almost 2 years ago

Problem/Motivation

While reviewing the module for best practices and standards. I have found issues.

FILE: /var/www/html/dcontri/responsive_class_field/src/Normalizer/ResponsiveClassItemNormalizer.php
-------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------
 23 | ERROR | unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
-------------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/dcontri/responsive_class_field/src/Plugin/Field/FieldType/ResponsiveClassItem.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
 106 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 306 | ERROR   | unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
 333 | ERROR   | unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
----------------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/dcontri/responsive_class_field/src/Plugin/Field/FieldWidget/ResponsiveClassWidget.php
---------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------
  95 | ERROR | [x] Use null coalesce operator instead of ternary operator.
 139 | ERROR | [x] Use null coalesce operator instead of ternary operator.
---------------------------------------------------------------------------------------------------------


FILE: /var/www/html/dcontri/responsive_class_field/src/Plugin/DataType/ResponsiveClassClassesData.php
-----------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------
 29 | ERROR | [x] Use null coalesce operator instead of ternary operator.
-----------------------------------------------------------------------------------------------------


FILE: /var/www/html/dcontri/responsive_class_field/src/Plugin/DataType/ResponsiveClassData.php
----------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------
 18 | ERROR | Missing member variable doc comment
----------------------------------------------------------------------------------------------


🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India akshay.singh Noida

Live updates comments and jobs are added and updated live.
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.71.5 2024