https://git.drupal.org/project/opencalais_ui.git

Primary tabs

Review of the 8.x-1.x branch (commit 1253f6a):
  • README.md or README.txt is missing, see the guidelines for in-project documentation.
  • ./opencalais_ui.install: All functions should be prefixed with your module/theme name (opencalais_ui) to avoid name clashes. See https://www.drupal.org/node/318#naming
    function opencalais_entities() {
    
  • ./opencalais_ui.module: All functions should be prefixed with your module/theme name (opencalais_ui) to avoid name clashes. See https://www.drupal.org/node/318#naming
    function opencalais_make_machine_name($name) {
    
  • The opencalais_ui.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: ...101/web/vendor/drupal/pareviewsh/pareview_temp/src/CalaisService.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------
     110 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
    --------------------------------------------------------------------------
    
    
    FILE: ...101/web/vendor/drupal/pareviewsh/pareview_temp/src/Form/TagsForm.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 11 WARNINGS AFFECTING 11 LINES
    --------------------------------------------------------------------------
      78 | WARNING | NodeType::load calls should be avoided in classes, use
         |         | dependency injection instead
      80 | WARNING | t() calls should be avoided in classes, use dependency
         |         | injection and $this->t() instead
      86 | WARNING | t() calls should be avoided in classes, use dependency
         |         | injection and $this->t() instead
     175 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     176 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     178 | WARNING | Unused variable $langcode.
     185 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     195 | WARNING | t() calls should be avoided in classes, use dependency
         |         | injection and $this->t() instead
     200 | WARNING | t() calls should be avoided in classes, use dependency
         |         | injection and $this->t() instead
     241 | WARNING | Unused variable $key.
     266 | WARNING | NodeType::load calls should be avoided in classes, use
         |         | dependency injection instead
    --------------------------------------------------------------------------
    
    
    FILE: ...dor/drupal/pareviewsh/pareview_temp/src/Form/GeneralSettingsForm.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
    --------------------------------------------------------------------------
     37 | WARNING | t() calls should be avoided in classes, use dependency
        |         | injection and $this->t() instead
     40 | WARNING | t() calls should be avoided in classes, use dependency
        |         | injection and $this->t() instead
     48 | WARNING | t() calls should be avoided in classes, use dependency
        |         | injection and $this->t() instead
     51 | WARNING | t() calls should be avoided in classes, use dependency
        |         | injection and $this->t() instead
    --------------------------------------------------------------------------
    
    
    FILE: ...1101/web/vendor/drupal/pareviewsh/pareview_temp/opencalais_ui.module
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    --------------------------------------------------------------------------
     40 | WARNING | Unused variable $field_name.
     50 | WARNING | Messages are user facing text and must run through t()
        |         | for translation
    --------------------------------------------------------------------------
    
    Time: 886ms; Memory: 4Mb
    
This automated report was generated with PAReview.sh, your friendly project application review script.

FILE: ...101/web/vendor/drupal/pareviewsh/pareview_temp/src/JsonProcessor.php
--------------------------------------------------------------------------
FOUND 24 ERRORS AND 4 WARNINGS AFFECTING 28 LINES
--------------------------------------------------------------------------
   5 | ERROR   | [x] Missing class doc comment
  12 | ERROR   | [ ] Class property $decoded_response should use
     |         |     lowerCamel naming without underscores
  26 | ERROR   | [ ] Doc comment short description must be on a single
     |         |     line, further text should be a separate paragraph
  28 | ERROR   | [ ] Missing parameter type
  29 | ERROR   | [x] Parameter comment indentation must be 3 spaces,
     |         |     found 4 spaces
  32 | ERROR   | [x] Return comment indentation must be 3 spaces, found 4
     |         |     spaces
  34 | ERROR   | [ ] Public method name "JsonProcessor::parse_json" is
     |         |     not in lowerCamel format
  43 | ERROR   | [ ] Protected method name
     |         |     "JsonProcessor::build_entities" is not in lowerCamel
     |         |     format
  49 | ERROR   | [x] Case breaking statements must be followed by a
     |         |     single blank line
  52 | ERROR   | [x] Case breaking statements must be followed by a
     |         |     single blank line
  55 | ERROR   | [x] Case breaking statements must be followed by a
     |         |     single blank line
  58 | ERROR   | [x] Case breaking statements must be followed by a
     |         |     single blank line
  61 | ERROR   | [x] Case breaking statements must be followed by a
     |         |     single blank line
  74 | ERROR   | [ ] Missing parameter type
  76 | ERROR   | [ ] Missing parameter type
  84 | WARNING | [x] A comma should follow the last multiline array item.
     |         |     Found: $importance
  91 | ERROR   | [ ] Missing parameter type
  93 | ERROR   | [ ] Missing parameter type
 101 | WARNING | [x] A comma should follow the last multiline array item.
     |         |     Found: $score
 108 | ERROR   | [ ] Missing parameter type
 110 | ERROR   | [ ] Missing parameter type
 118 | WARNING | [x] A comma should follow the last multiline array item.
     |         |     Found: $relevance
 125 | ERROR   | [ ] Missing parameter type
 127 | ERROR   | [ ] Missing parameter type
 134 | WARNING | [x] A comma should follow the last multiline array item.
     |         |     Found: ]
 142 | ERROR   | [ ] Missing parameter type
 144 | ERROR   | [ ] Missing parameter type
 147 | ERROR   | [ ] Protected method name
     |         |     "JsonProcessor::extractDefaultLangID" is not in
     |         |     lowerCamel format
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 12 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...r/drupal/pareviewsh/pareview_temp/src/Tests/OpenCalaisUiTestBase.php
--------------------------------------------------------------------------
FOUND 5 ERRORS AND 3 WARNINGS AFFECTING 7 LINES
--------------------------------------------------------------------------
  20 | ERROR   | [ ] Class property $admin_user should use lowerCamel
     |         |     naming without underscores
  27 | ERROR   | [ ] Class property $admin_permissions should use
     |         |     lowerCamel naming without underscores
  56 | WARNING | [x] A comma should follow the last multiline array item.
     |         |     Found: 'administer content types'
  73 | ERROR   | [x] Visibility must be declared on method "loginAsAdmin"
  73 | ERROR   | [ ] Type hint "array" missing for
     |         |     $additional_permissions
  93 | WARNING | [x] A comma should follow the last multiline array item.
     |         |     Found: 'test_key'
 100 | ERROR   | [x] There must be exactly one blank line before the tags
     |         |     in a doc comment
 105 | WARNING | [x] A comma should follow the last multiline array item.
     |         |     Found: $field_name
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: .../drupal/pareviewsh/pareview_temp/src/Tests/OpenCalaisUiAdminTest.php
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------
 51 | WARNING | [x] A comma should follow the last multiline array item.
    |         |     Found: TRUE
 57 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...r/drupal/pareviewsh/pareview_temp/src/Tests/OpenCalaisUiTagsTest.php
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------
 23 | WARNING | [x] A comma should follow the last multiline array item.
    |         |     Found: 'comment'
 41 | WARNING | [x] A comma should follow the last multiline array item.
    |         |     Found: TRUE
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: .../vendor/drupal/pareviewsh/pareview_temp/src/Element/RelevanceBar.php
--------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
--------------------------------------------------------------------------
 44 | ERROR | [ ] Doc comment short description must start with a capital
    |       |     letter
 53 | ERROR | [ ] Type hint "array" missing for $element
 60 | ERROR | [x] Case breaking statements must be followed by a single
    |       |     blank line
 63 | ERROR | [x] Case breaking statements must be followed by a single
    |       |     blank line
 70 | ERROR | [x] Case breaking statements must be followed by a single
    |       |     blank line
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...101/web/vendor/drupal/pareviewsh/pareview_temp/src/CalaisService.php
--------------------------------------------------------------------------
FOUND 5 ERRORS AND 2 WARNINGS AFFECTING 7 LINES
--------------------------------------------------------------------------
   8 | ERROR   | [x] Missing class doc comment
  52 | ERROR   | [ ] Parameter $json_processor is not described in
     |         |     comment
  55 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
  59 | ERROR   | [ ] Missing parameter name
  77 | ERROR   | [ ] Missing parameter type
  81 | ERROR   | [x] Separate the @param and @return sections by a blank
     |         |     line.
 129 | WARNING | [x] A comma should follow the last multiline array item.
     |         |     Found: 'relevance'
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...101/web/vendor/drupal/pareviewsh/pareview_temp/src/Form/TagsForm.php
--------------------------------------------------------------------------
FOUND 1 ERROR AND 11 WARNINGS AFFECTING 11 LINES
--------------------------------------------------------------------------
  82 | WARNING | [x] A comma should follow the last multiline array item.
     |         |     Found: )
  85 | ERROR   | [x] Use "elseif" in place of "else if"
  88 | WARNING | [x] A comma should follow the last multiline array item.
     |         |     Found: )
 135 | WARNING | [x] A comma should follow the last multiline array item.
     |         |     Found: )
 141 | WARNING | [x] A comma should follow the last multiline array item.
     |         |     Found: )
 147 | WARNING | [x] A comma should follow the last multiline array item.
     |         |     Found: )
 155 | WARNING | [ ] Only string literals should be passed to t() where
     |         |     possible
 155 | WARNING | [x] A comma should follow the last multiline array item.
     |         |     Found: )
 237 | WARNING | [x] A comma should follow the last multiline array item.
     |         |     Found: )
 243 | WARNING | [x] A comma should follow the last multiline array item.
     |         |     Found: 'container'
 247 | WARNING | [ ] Only string literals should be passed to t() where
     |         |     possible
 297 | WARNING | [x] A comma should follow the last multiline array item.
     |         |     Found: $key_id
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...dor/drupal/pareviewsh/pareview_temp/src/Form/GeneralSettingsForm.php
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
--------------------------------------------------------------------------
 42 | WARNING | [x] A comma should follow the last multiline array item.
    |         |     Found: )
 43 | WARNING | [x] A comma should follow the last multiline array item.
    |         |     Found: )
 60 | WARNING | [ ] Possible useless method overriding detected
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...101/web/vendor/drupal/pareviewsh/pareview_temp/opencalais_ui.install
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------
 72 | WARNING | [x] A comma should follow the last multiline array item.
    |         |     Found: 'URL'
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...1101/web/vendor/drupal/pareviewsh/pareview_temp/opencalais_ui.module
--------------------------------------------------------------------------
FOUND 3 ERRORS AND 3 WARNINGS AFFECTING 5 LINES
--------------------------------------------------------------------------
  3 | ERROR   | [ ] Missing short description in doc comment
 21 | WARNING | [ ] Line exceeds 80 characters; contains 90 characters
 21 | ERROR   | [x] Doc comment short description must end with a full
    |         |     stop
 43 | ERROR   | [x] Object operator not indented correctly; expected 8
    |         |     spaces but found 10
 83 | WARNING | [x] A comma should follow the last multiline array item.
    |         |     Found: 0
 85 | WARNING | [x] A comma should follow the last multiline array item.
    |         |     Found: ]
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------

Time: 1.46 secs; Memory: 6Mb