Module has some code styling issues - mostly missing doc blocks. Should be fixed to bring the code up to current Drupal coding standards.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

aburke626 created an issue. See original summary.

aburke626’s picture

Patch to bring code up to current Drupal standards - mostly adding missing doc blocks.

aburke626’s picture

Status: Active » Needs review
sanduhrs’s picture

Status: Needs review » Needs work

Hi Alanna, thanks for cleaning this up.

What tool are you using to verify the coding standards?
I'm using PHP_CodeSniffer [1] with the sniffs defined in coder module [2] latest version (8.x-2.7).

[1] https://github.com/squizlabs/PHP_CodeSniffer
[2] https://www.drupal.org/project/coder

After applying your patch I still see a lot of violations of the current standard:

> phpcs --standard=Drupal annotator/

FILE: ...home/sauditor/Workspace/modules/7/annotator/js/annotator_tags.js
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | ERROR | [x] Missing file doc comment
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...uditor/Workspace/modules/7/annotator/js/annotator_permissions.js
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | ERROR | [x] Missing file doc comment
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...me/sauditor/Workspace/modules/7/annotator/js/annotator_filter.js
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | ERROR | [x] Missing file doc comment
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...uditor/Workspace/modules/7/annotator/js/annotator_unsupported.js
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | ERROR | [x] Missing file doc comment
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: /home/sauditor/Workspace/modules/7/annotator/js/annotator.js
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | ERROR | [x] Missing file doc comment
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: .../sauditor/Workspace/modules/7/annotator/js/annotator_markdown.js
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | ERROR | [x] Missing file doc comment
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...home/sauditor/Workspace/modules/7/annotator/js/annotator_auth.js
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | ERROR | [x] Missing file doc comment
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...les/7/annotator/plugins/annotator/PermissionsAnnotatorPlugin.inc
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 4 | ERROR | [x] Doc comment short description must end with a full
   |       |     stop
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...odules/7/annotator/plugins/annotator/MarkdownAnnotatorPlugin.inc
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 4 | ERROR | [x] Doc comment short description must end with a full
   |       |     stop
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...ules/7/annotator/plugins/annotator/I18nAnnotatorPlugin.class.inc
----------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
----------------------------------------------------------------------
  4 | ERROR | [x] Doc comment short description must end with a full
    |       |     stop
  8 | ERROR | [x] Doc comment short description must end with a full
    |       |     stop
 14 | ERROR | [x] Expected 1 blank line before function; 0 found
 26 | ERROR | [x] Expected 1 blank line after function; 0 found
 27 | ERROR | [x] The closing brace for the class must have an empty
    |       |     line before it
----------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...ce/modules/7/annotator/plugins/annotator/I18nAnnotatorPlugin.inc
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 4 | ERROR | [x] Doc comment short description must end with a full
   |       |     stop
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...les/7/annotator/plugins/annotator/UnsupportedAnnotatorPlugin.inc
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 4 | ERROR | [x] Doc comment short description must end with a full
   |       |     stop
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...ules/7/annotator/plugins/annotator/AuthAnnotatorPlugin.class.inc
----------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
----------------------------------------------------------------------
  4 | ERROR | [x] Doc comment short description must end with a full
    |       |     stop
  8 | ERROR | [x] Doc comment short description must end with a full
    |       |     stop
 14 | ERROR | [x] Expected 1 blank line before function; 0 found
 53 | ERROR | [x] Expected 1 blank line after function; 0 found
 54 | ERROR | [x] The closing brace for the class must have an empty
    |       |     line before it
----------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...ce/modules/7/annotator/plugins/annotator/TagsAnnotatorPlugin.inc
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 4 | ERROR | [x] Doc comment short description must end with a full
   |       |     stop
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...ce/modules/7/annotator/plugins/annotator/AuthAnnotatorPlugin.inc
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 4 | ERROR | [x] Doc comment short description must end with a full
   |       |     stop
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...annotator/plugins/annotator/PermissionsAnnotatorPlugin.class.inc
----------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
----------------------------------------------------------------------
  4 | ERROR | [x] Doc comment short description must end with a full
    |       |     stop
 14 | ERROR | [x] Expected 1 blank line before function; 0 found
 97 | ERROR | [x] Expected 1 blank line after function; 0 found
 98 | ERROR | [x] The closing brace for the class must have an empty
    |       |     line before it
----------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...es/7/annotator/plugins/annotator/FilterAnnotatorPlugin.class.inc
----------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
----------------------------------------------------------------------
  4 | ERROR | [x] Doc comment short description must end with a full
    |       |     stop
  8 | ERROR | [x] Doc comment short description must end with a full
    |       |     stop
 14 | ERROR | [x] Expected 1 blank line before function; 0 found
 16 | ERROR | [x] Expected 1 blank line after function; 0 found
 17 | ERROR | [x] The closing brace for the class must have an empty
    |       |     line before it
----------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...ules/7/annotator/plugins/annotator/TagsAnnotatorPlugin.class.inc
----------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
----------------------------------------------------------------------
  4 | ERROR | [x] Doc comment short description must end with a full
    |       |     stop
 14 | ERROR | [x] Expected 1 blank line before function; 0 found
 16 | ERROR | [x] Expected 1 blank line after function; 0 found
 17 | ERROR | [x] The closing brace for the class must have an empty
    |       |     line before it
----------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...annotator/plugins/annotator/UnsupportedAnnotatorPlugin.class.inc
----------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
----------------------------------------------------------------------
  4 | ERROR | [x] Doc comment short description must end with a full
    |       |     stop
  5 | ERROR | [x] There must be exactly one blank line after the file
    |       |     comment
 15 | ERROR | [x] Expected 1 blank line before function; 0 found
 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 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: .../modules/7/annotator/plugins/annotator/FilterAnnotatorPlugin.inc
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 4 | ERROR | [x] Doc comment short description must end with a full
   |       |     stop
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: .../7/annotator/plugins/annotator/MarkdownAnnotatorPlugin.class.inc
----------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
----------------------------------------------------------------------
  4 | ERROR | [x] Doc comment short description must end with a full
    |       |     stop
 14 | ERROR | [x] Expected 1 blank line before function; 0 found
 17 | ERROR | [x] Expected 1 blank line after function; 0 found
 18 | ERROR | [x] The closing brace for the class must have an empty
    |       |     line before it
----------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...Workspace/modules/7/annotator/includes/AnnotatorPlugin.class.inc
----------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
----------------------------------------------------------------------
  4 | ERROR | [x] Doc comment short description must end with a full
    |       |     stop
  8 | ERROR | [x] Doc comment short description must end with a full
    |       |     stop
 14 | ERROR | [x] Expected 1 blank line before function; 0 found
 45 | ERROR | [x] Expected 1 blank line after function; 0 found
 46 | ERROR | [x] The closing brace for the class must have an empty
    |       |     line before it
----------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: /home/sauditor/Workspace/modules/7/annotator/annotator.pages.inc
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 4 | ERROR | [x] Doc comment short description must end with a full
   |       |     stop
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Time: 190ms; Memory: 6Mb

sanduhrs’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
18.77 KB

Updated patch attached.

  • sanduhrs committed 69344ec on 7.x-1.x
    Issue #2745041 by aburke626, sanduhrs: Code Standards Cleanup
    
sanduhrs’s picture

Status: Reviewed & tested by the community » Closed (fixed)

Committed, thanks!