Drupal Coding Standard Fixes.

Created on 7 July 2021, over 3 years ago
Updated 17 July 2024, 6 months ago

FILE: /var/www/html/drupal_contrib/web/modules/contrib/content_type_dependency/src/Controller/ContentTypeDependencyController.php
---------------------------------------------------------------------------------------------------------------------------------
FOUND 11 ERRORS AND 1 WARNING AFFECTING 9 LINES
---------------------------------------------------------------------------------------------------------------------------------
15 | ERROR | [ ] Public method name "ContentTypeDependencyController::content_type_dependency_list" is not in lowerCamel
| | format
15 | ERROR | [x] Missing function doc comment
16 | WARNING | [x] There must be no blank line following an inline comment
18 | ERROR | [x] Short array syntax must be used to define arrays
38 | ERROR | [x] Short array syntax must be used to define arrays
66 | ERROR | [x] Short array syntax must be used to define arrays
98 | ERROR | [ ] Public method name "ContentTypeDependencyController::content_type_dependency_enable" is not in lowerCamel
| | format
98 | ERROR | [x] Missing function doc comment
107 | ERROR | [x] Expected newline after closing brace
112 | ERROR | [ ] Public method name "ContentTypeDependencyController::content_type_dependency_disable" is not in lowerCamel
| | format
112 | ERROR | [x] Missing function doc comment
121 | ERROR | [x] Expected newline after closing brace
---------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupal_contrib/web/modules/contrib/content_type_dependency/src/Form/ContentTypeDependencyDeleteConfirm.php
------------------------------------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AND 1 WARNING AFFECTING 7 LINES
------------------------------------------------------------------------------------------------------------------------------
8 | WARNING | [x] Unused use statement
12 | ERROR | [x] There must be exactly one newline after the class comment
34 | ERROR | [x] Short array syntax must be used to define arrays
65 | ERROR | [ ] Parameter $form is not described in comment
65 | ERROR | [ ] Parameter $form_state is not described in comment
82 | ERROR | [x] There should be no white space before a closing ")"
85 | ERROR | [x] Expected 1 blank line after function; 0 found
86 | ERROR | [x] The closing brace for the class must have an empty line before it
------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupal_contrib/web/modules/contrib/content_type_dependency/src/Form/ContentTypeDependencyModify.php
---------------------------------------------------------------------------------------------------------------------------------
FOUND 41 ERRORS AND 5 WARNINGS AFFECTING 43 LINES
---------------------------------------------------------------------------------------------------------------------------------
7 | WARNING | [x] Unused use statement
12 | ERROR | [x] Missing class doc comment
21 | ERROR | [x] Missing function doc comment
28 | ERROR | [x] Short array syntax must be used to define arrays
34 | ERROR | [x] Short array syntax must be used to define arrays
38 | ERROR | [x] Short array syntax must be used to define arrays
43 | ERROR | [x] Short array syntax must be used to define arrays
46 | ERROR | [x] Expected one space after the comma, 0 found
52 | ERROR | [x] Short array syntax must be used to define arrays
61 | ERROR | [x] Short array syntax must be used to define arrays
66 | ERROR | [x] Short array syntax must be used to define arrays
75 | ERROR | [x] Short array syntax must be used to define arrays
85 | ERROR | [x] Short array syntax must be used to define arrays
93 | ERROR | [x] Short array syntax must be used to define arrays
99 | ERROR | [x] Short array syntax must be used to define arrays
108 | ERROR | [x] Short array syntax must be used to define arrays
112 | ERROR | [x] Short array syntax must be used to define arrays
114 | WARNING | [x] A comma should follow the last multiline array item. Found: )
119 | ERROR | [x] Missing function doc comment
120 | ERROR | [x] There should be no white space before a closing ")"
123 | ERROR | [x] There should be no white space before a closing ")"
133 | ERROR | [x] Expected one space after the comma, 0 found
140 | ERROR | [x] Concat operator must be surrounded by a single space
144 | ERROR | [x] Space found before comma in argument list
148 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
148 | ERROR | [x] 4 spaces found before inline comment; expected "// // Checking rule exists in new rule form." but found "//
| | // Checking rule exists in new rule form."
150 | ERROR | [x] Expected one space after the comma, 0 found
156 | ERROR | [x] Concat operator must be surrounded by a single space
160 | WARNING | [x] A comma should follow the last multiline array item. Found: $url
164 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
164 | ERROR | [x] Expected one space after the comma, 0 found
169 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
170 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
170 | ERROR | [x] Concat operator must be surrounded by a single space
171 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
172 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
173 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
174 | ERROR | [x] Space found before comma in argument list
176 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
183 | WARNING | [x] A comma should follow the last multiline array item. Found: 'no_of_modify'
189 | ERROR | [ ] is_integer() is a function name alias, use is_int() instead
194 | ERROR | [x] Missing function doc comment
218 | ERROR | [x] Inline comments must start with a capital letter
246 | WARNING | [x] A comma should follow the last multiline array item. Found: $msg
250 | ERROR | [x] Expected 1 blank line after function; 0 found
251 | ERROR | [x] The closing brace for the class must have an empty line before it
---------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 45 MARKED SNIFF VIOLATIONS AUTOMATICALLY

🐛 Bug report
Status

Needs work

Version

3.0

Component

Code

Created by

🇮🇳India swatichouhan012

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.

  • 🇮🇳India riddhi.addweb

    I applied the patch and it has been applied cleanly, but errors are still not resolved.

    FILE: /var/www/html/web/Drupal_9.5/web/modules/custom/content_type_dependency-3222510/content_type_dependency.module
    -----------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 4 ERRORS AFFECTING 4 LINES
    -----------------------------------------------------------------------------------------------------------------------------------------------
      9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\FormStateInterface.
     44 | ERROR | [ ] unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
     59 | ERROR | [ ] Missing parameter type
     80 | ERROR | [ ] Missing parameter type
    -----------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /var/www/html/web/Drupal_9.5/web/modules/custom/content_type_dependency-3222510/src/Controller/ContentTypeDependencyController.php
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AND 8 WARNINGS AFFECTING 10 LINES
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      30 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
      35 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
      52 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
      63 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     104 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     105 | ERROR   | The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get('token') instead
     107 | 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
     123 | ERROR   | The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get('token') instead
     125 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /var/www/html/web/Drupal_9.5/web/modules/custom/content_type_dependency-3222510/src/Form/ContentTypeDependencyDeleteConfirm.php
    -------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------------------
     7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\FormStateInterface.
    -------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /var/www/html/web/Drupal_9.5/web/modules/custom/content_type_dependency-3222510/src/Form/ContentTypeDependencyModify.php
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 19 ERRORS AND 6 WARNINGS AFFECTING 18 LINES
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      29 | WARNING | Role::loadMultiple calls should be avoided in classes, use dependency injection instead
      40 | WARNING | NodeType::loadMultiple calls should be avoided in classes, use dependency injection instead
      49 | ERROR   | The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get('cd_id') instead
      50 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
      53 | ERROR   | The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get('cd_id') instead
      64 | ERROR   | The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get('cd_id') instead
      64 | ERROR   | The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get('cd_id') instead
      78 | ERROR   | The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get('cd_id') instead
      78 | ERROR   | The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get('cd_id') instead
      84 | ERROR   | The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get('cd_id') instead
      84 | ERROR   | The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get('cd_id') instead
      96 | ERROR   | The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get('cd_id') instead
      96 | ERROR   | The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get('cd_id') instead
      96 | ERROR   | unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
     102 | ERROR   | The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get('cd_id') instead
     102 | ERROR   | The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get('cd_id') instead
     108 | ERROR   | The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get('cd_id') instead
     108 | ERROR   | The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get('cd_id') instead
     138 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     140 | ERROR   | The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get('cd_id') instead
     145 | ERROR   | The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get('cd_id') instead
     231 | ERROR   | The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get('cd_id') instead
     232 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     240 | ERROR   | The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get('cd_id') instead
     246 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
Production build 0.71.5 2024