Fix Coding Standards Issues

Created on 30 December 2018, over 6 years ago
Updated 23 September 2024, 7 months ago

Found the following coding standards issues:

FILE: ...wnloads/views_published_or_roles/views_published_or_roles.module
----------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
----------------------------------------------------------------------
  1 | ERROR   | [x] Missing file doc comment
 13 | WARNING | [ ] Format should be "* Implements hook_foo().", "*
    |         |     Implements hook_foo_BAR_ID_bar() for
    |         |     xyz_bar().",, "* Implements hook_foo_BAR_ID_bar()
    |         |     for xyz-bar.html.twig.", "* Implements
    |         |     hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or
    |         |     "* Implements hook_foo_BAR_ID_bar() for block
    |         |     templates."
 34 | WARNING | [ ] Avoid backslash escaping in translatable strings
    |         |     when possible, use "" quotes instead
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...Downloads/views_published_or_roles/views_published_or_roles.info
----------------------------------------------------------------------
FOUND 2 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
  1 | WARNING | [ ] Remove "project" from the info file, it will be
    |         |     added by drupal.org packaging automatically
  1 | WARNING | [ ] Remove "version" from the info file, it will be
    |         |     added by drupal.org packaging automatically
  1 | ERROR   | [ ] Duplicate entry for "core" in info file
 16 | ERROR   | [x] Expected 1 newline at end of file; 2 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: /Users/albertski/Downloads/views_published_or_roles/README.txt
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
 14 | WARNING | Line exceeds 80 characters; contains 267 characters
 16 | WARNING | Line exceeds 80 characters; contains 146 characters
----------------------------------------------------------------------


FILE: ...lers/views_handler_filter_views_published_or_roles_has_roles.inc
----------------------------------------------------------------------
FOUND 19 ERRORS AFFECTING 7 LINES
----------------------------------------------------------------------
 13 | ERROR | [ ] Class name must begin with a capital letter
 13 | ERROR | [ ] Class name must use UpperCamel naming without
    |       |     underscores
 15 | ERROR | [x] Visibility must be declared on method "can_expose"
 15 | ERROR | [ ] Method name
    |       |     "views_handler_filter_views_published_or_roles_has_roles::can_expose"
    |       |     is not in lowerCamel format
 15 | ERROR | [x] Missing function doc comment
 15 | ERROR | [x] Opening brace must be the last content on the line
 15 | ERROR | [x] There should be no white space after an opening "{"
 15 | ERROR | [x] There should be no white space before a closing "}"
 15 | ERROR | [x] Closing brace must be on a line by itself
 17 | ERROR | [x] Visibility must be declared on method
    |       |     "get_value_options"
 17 | ERROR | [ ] Method name
    |       |     "views_handler_filter_views_published_or_roles_has_roles::get_value_options"
    |       |     is not in lowerCamel format
 17 | ERROR | [x] Missing function doc comment
 24 | ERROR | [x] Visibility must be declared on method "value_form"
 24 | ERROR | [ ] Method name
    |       |     "views_handler_filter_views_published_or_roles_has_roles::value_form"
    |       |     is not in lowerCamel format
 24 | ERROR | [x] Missing function doc comment
 34 | ERROR | [x] Visibility must be declared on method "query"
 34 | ERROR | [x] Missing function doc comment
 47 | ERROR | [x] Expected 1 blank line after function; 0 found
 48 | ERROR | [x] The closing brace for the class must have an empty
    |       |     line before it
----------------------------------------------------------------------
PHPCBF CAN FIX THE 14 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...ndler_filter_views_published_or_roles_current_user_has_roles.inc
----------------------------------------------------------------------
FOUND 19 ERRORS AND 1 WARNING AFFECTING 8 LINES
----------------------------------------------------------------------
  5 | WARNING | [ ] Line exceeds 80 characters; contains 86
    |         |     characters
 13 | ERROR   | [ ] Class name must begin with a capital letter
 13 | ERROR   | [ ] Class name must use UpperCamel naming without
    |         |     underscores
 15 | ERROR   | [x] Visibility must be declared on method
    |         |     "can_expose"
 15 | ERROR   | [ ] Method name
    |         |     "views_handler_filter_views_published_or_roles_current_user_has_roles::can_expose"
    |         |     is not in lowerCamel format
 15 | ERROR   | [x] Missing function doc comment
 15 | ERROR   | [x] Opening brace must be the last content on the
    |         |     line
 15 | ERROR   | [x] There should be no white space after an opening
    |         |     "{"
 15 | ERROR   | [x] There should be no white space before a closing
    |         |     "}"
 15 | ERROR   | [x] Closing brace must be on a line by itself
 17 | ERROR   | [x] Visibility must be declared on method
    |         |     "get_value_options"
 17 | ERROR   | [ ] Method name
    |         |     "views_handler_filter_views_published_or_roles_current_user_has_roles::get_value_options"
    |         |     is not in lowerCamel format
 17 | ERROR   | [x] Missing function doc comment
 24 | ERROR   | [x] Visibility must be declared on method
    |         |     "value_form"
 24 | ERROR   | [ ] Method name
    |         |     "views_handler_filter_views_published_or_roles_current_user_has_roles::value_form"
    |         |     is not in lowerCamel format
 24 | ERROR   | [x] Missing function doc comment
 34 | ERROR   | [x] Visibility must be declared on method "query"
 34 | ERROR   | [x] Missing function doc comment
 41 | ERROR   | [x] Expected 1 blank line after function; 0 found
 42 | ERROR   | [x] The closing brace for the class must have an
    |         |     empty line before it
----------------------------------------------------------------------
PHPCBF CAN FIX THE 14 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Time: 53ms; Memory: 6Mb

Also, in qurey() we should remove $table = $this->ensure_my_table(); since it gets overwritten.

πŸ› Bug report
Status

Closed: won't fix

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States albertski

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