Fix issues raised by PAReview for Security Opt-in application

Created on 13 March 2019, almost 6 years ago
Updated 1 November 2023, about 1 year ago

Review here: https://pareview.sh/pareview/https-git.drupal.org-project-social_course....

Review

Review of the 8.x-2.x branch (commit 8c904a5):

  • Your README.md does not follow best practices (headings need to be uppercase). See https://www.drupal.org/node/2181737 → .
    • The INTRODUCTION section is missing.
    • The REQUIREMENTS section is missing.
    • The INSTALLATION section is missing.
    • The CONFIGURATION section is missing.
  • The social_course.module does not implement hook_help(). See https://www.drupal.org/docs/develop/documenting-your-project/module-docu... → .
  • Coder Sniffer → has found some issues with your code (please check the Drupal coding standards → ). See attachment.
  • DrupalPractice → has found some issues with your code, but could be false positives.
    
    FILE: ...ndor/drupal/pareviewsh/pareview_temp/src/Routing/RouteSubscriber.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    --------------------------------------------------------------------------
     46 | WARNING | Unused variable $route_name.
     88 | WARNING | \Drupal calls should be avoided in classes, use
        |         | dependency injection instead
    --------------------------------------------------------------------------
    
    
    FILE: ...vendor/drupal/pareviewsh/pareview_temp/src/SocialCourseOverrides.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
    --------------------------------------------------------------------------
     461 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     507 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     524 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
    --------------------------------------------------------------------------
    
    
    FILE: ...wsh/pareview_temp/src/Plugin/Block/CourseMaterialNavigationBlock.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 9 WARNINGS AFFECTING 9 LINES
    --------------------------------------------------------------------------
      33 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
      41 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
      45 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
      48 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
      76 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
      97 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     100 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     124 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     139 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
    --------------------------------------------------------------------------
    
    
    FILE: ...reviewsh/pareview_temp/src/Plugin/Block/CourseMaterialPagerBlock.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 6 WARNINGS AFFECTING 6 LINES
    --------------------------------------------------------------------------
     32 | WARNING | \Drupal calls should be avoided in classes, use
        |         | dependency injection instead
     40 | WARNING | Unused variable $group_link.
     50 | WARNING | \Drupal calls should be avoided in classes, use
        |         | dependency injection instead
     53 | WARNING | \Drupal calls should be avoided in classes, use
        |         | dependency injection instead
     77 | WARNING | \Drupal calls should be avoided in classes, use
        |         | dependency injection instead
     92 | WARNING | \Drupal calls should be avoided in classes, use
        |         | dependency injection instead
    --------------------------------------------------------------------------
    
    
    FILE: ...ewsh/pareview_temp/src/Plugin/Block/CourseSectionNavigationBlock.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 8 WARNINGS AFFECTING 8 LINES
    --------------------------------------------------------------------------
      32 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
      40 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
      51 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
      66 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
      69 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
      93 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     108 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     113 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
    --------------------------------------------------------------------------
    
    
    FILE: ...l/pareviewsh/pareview_temp/src/Plugin/Block/CourseRelatedCourses.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------
     34 | WARNING | \Drupal calls should be avoided in classes, use
        |         | dependency injection instead
    --------------------------------------------------------------------------
    
    
    FILE: ...drupal/pareviewsh/pareview_temp/src/Controller/CoursesController.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 8 WARNINGS AFFECTING 8 LINES
    --------------------------------------------------------------------------
      31 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
      82 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     107 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     109 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     116 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     119 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     123 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     198 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
    --------------------------------------------------------------------------
    
    
    FILE: ...01/web/vendor/drupal/pareviewsh/pareview_temp/social_course.info.yml
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
    --------------------------------------------------------------------------
     11 | WARNING | All dependencies must be prefixed with the project name,
        |         | for example "drupal:"
     12 | WARNING | All dependencies must be prefixed with the project name,
        |         | for example "drupal:"
     13 | WARNING | All dependencies must be prefixed with the project name,
        |         | for example "drupal:"
     14 | WARNING | All dependencies must be prefixed with the project name,
        |         | for example "drupal:"
    --------------------------------------------------------------------------
    
    
    FILE: ...1101/web/vendor/drupal/pareviewsh/pareview_temp/social_course.module
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
    --------------------------------------------------------------------------
     30 | WARNING | Global constants should not be used, move it to a class
        |         | or interface
     31 | WARNING | Global constants should not be used, move it to a class
        |         | or interface
     32 | WARNING | Global constants should not be used, move it to a class
        |         | or interface
     34 | WARNING | Global constants should not be used, move it to a class
        |         | or interface
     35 | WARNING | Global constants should not be used, move it to a class
        |         | or interface
    --------------------------------------------------------------------------
    
    Time: 6.4 secs; Memory: 14Mb
    
  • No automated test cases were found, did you consider writing PHPUnit tests → ? This is not a requirement but encouraged for professional software development.


FILE: .../vendor/drupal/pareviewsh/pareview_temp/assets/css/social_course.css
--------------------------------------------------------------------------
FOUND 75 ERRORS AFFECTING 59 LINES
--------------------------------------------------------------------------
   3 | ERROR | [x] Closing brace of class definition must be on new line
   4 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
   5 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
   5 | ERROR | [x] Closing brace of class definition must be on new line
   6 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
   7 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
   8 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
   9 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
   9 | ERROR | [x] Closing brace of class definition must be on new line
  10 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
  11 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  11 | ERROR | [x] Closing brace of class definition must be on new line
  12 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
  13 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
  14 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
  14 | ERROR | [x] Closing brace of class definition must be on new line
  15 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
  16 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  16 | ERROR | [x] Closing brace of class definition must be on new line
  17 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
  18 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  19 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  20 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  20 | ERROR | [x] Closing brace of class definition must be on new line
  21 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
  22 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  23 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
  24 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
  24 | ERROR | [x] Closing brace of class definition must be on new line
  25 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
  26 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
  27 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
  27 | ERROR | [x] Closing brace of class definition must be on new line
  28 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 8
  29 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 10
  30 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 10
  31 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 10
  31 | ERROR | [x] Closing brace of class definition must be on new line
  32 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
  33 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
  34 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
  35 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  35 | ERROR | [x] Closing brace of class definition must be on new line
  42 | ERROR | [x] Closing brace of class definition must be on new line
  43 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
  43 | ERROR | [x] Multiple selectors should each be on a single line
  44 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
  45 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
  46 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  46 | ERROR | [x] Closing brace of class definition must be on new line
  51 | ERROR | [x] Closing brace of class definition must be on new line
  60 | ERROR | [x] Closing brace of class definition must be on new line
  61 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
  62 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  63 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
  63 | ERROR | [x] Closing brace of class definition must be on new line
  67 | ERROR | [x] Closing brace of class definition must be on new line
  68 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
  69 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  70 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
  70 | ERROR | [x] Closing brace of class definition must be on new line
  84 | ERROR | [x] Closing brace of class definition must be on new line
  85 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
  86 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  86 | ERROR | [x] Closing brace of class definition must be on new line
  87 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
  88 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  89 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
  90 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
  91 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
  92 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
  93 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
  93 | ERROR | [x] Closing brace of class definition must be on new line
  97 | ERROR | [x] Closing brace of class definition must be on new line
 100 | ERROR | [x] Closing brace of class definition must be on new line
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 75 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...r/drupal/pareviewsh/pareview_temp/assets/css/social_course_admin.css
--------------------------------------------------------------------------
FOUND 49 ERRORS AFFECTING 38 LINES
--------------------------------------------------------------------------
  2 | ERROR | [x] Closing brace of class definition must be on new line
  4 | ERROR | [x] Closing brace of class definition must be on new line
  6 | ERROR | [x] Closing brace of class definition must be on new line
  7 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
  8 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  8 | ERROR | [x] Closing brace of class definition must be on new line
 12 | ERROR | [x] Closing brace of class definition must be on new line
 13 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
 14 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
 14 | ERROR | [x] Closing brace of class definition must be on new line
 15 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
 16 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
 16 | ERROR | [x] Closing brace of class definition must be on new line
 18 | ERROR | [x] Closing brace of class definition must be on new line
 20 | ERROR | [x] Closing brace of class definition must be on new line
 22 | ERROR | [x] Closing brace of class definition must be on new line
 23 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
 24 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
 25 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
 25 | ERROR | [x] Closing brace of class definition must be on new line
 26 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
 27 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
 28 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
 28 | ERROR | [x] Closing brace of class definition must be on new line
 29 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
 30 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
 31 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
 31 | ERROR | [x] Closing brace of class definition must be on new line
 32 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
 33 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
 33 | ERROR | [x] Closing brace of class definition must be on new line
 34 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
 35 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
 35 | ERROR | [x] Closing brace of class definition must be on new line
 37 | ERROR | [x] Closing brace of class definition must be on new line
 38 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
 39 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
 40 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
 40 | ERROR | [x] Closing brace of class definition must be on new line
 46 | ERROR | [x] Closing brace of class definition must be on new line
 47 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
 48 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
 48 | ERROR | [x] Closing brace of class definition must be on new line
 50 | ERROR | [x] Closing brace of class definition must be on new line
 54 | ERROR | [x] Closing brace of class definition must be on new line
 55 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
 56 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
 57 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
 57 | ERROR | [x] Closing brace of class definition must be on new line
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 49 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...01/web/vendor/drupal/pareviewsh/pareview_temp/social_course.info.yml
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------
 1 | WARNING | Remove "project" from the info file, it will be added by
   |         | drupal.org packaging automatically
--------------------------------------------------------------------------

Time: 9.48 secs; Memory: 16Mb
📌 Task
Status

Needs review

Version

4.1

Component

Miscellaneous

Created by

🇳🇱Netherlands kingdutch

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