https://git.drupal.org/project/haystack 8.x-1.x

Primary tabs

Review of the 8.x-1.x branch (commit f86e617):
  • README.md or README.txt is missing, see the guidelines for in-project documentation.
  • Remove all .sass-cache files from your repository.
  • The haystack.module does not implement hook_help(). See https://www.drupal.org/docs/develop/documenting-your-project/module-docu... .
  • Bad line endings were found, always use unix style terminators. See https://www.drupal.org/coding-standards#indenting
    
    icons/haystack.svg
    
  • Coder Sniffer has found some issues with your code (please check the Drupal coding standards). See attachment.
  • ESLint has found some issues with your code (please check the JavaScript coding standards).
    /var/vhosts/c214000000/site1101/web/vendor/drupal/pareviewsh/pareview_temp/js/haystack-loader.js: line 1, col 2, Error - Use the function form of 'use strict'. (strict)
    /var/vhosts/c214000000/site1101/web/vendor/drupal/pareviewsh/pareview_temp/js/haystack-loader.js: line 9, col 4, Error - Missing semicolon. (semi)
    /var/vhosts/c214000000/site1101/web/vendor/drupal/pareviewsh/pareview_temp/js/haystack-loader.js: line 10, col 36, Error - Newline required at end of file but not found. (eol-last)
    
    3 problems
    
  • DrupalPractice has found some issues with your code, but could be false positives.
    
    FILE: ...1101/web/vendor/drupal/pareviewsh/pareview_temp/src/HaystackCore.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 12 WARNINGS AFFECTING 12 LINES
    --------------------------------------------------------------------------
     121 | WARNING | NodeType::loadMultiple calls should be avoided in
         |         | classes, use dependency injection instead
     165 | WARNING | t() calls should be avoided in classes, use dependency
         |         | injection and $this->t() instead
     187 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     211 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     214 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     239 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     264 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     371 | WARNING | There must be no blank line following an inline comment
     424 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     430 | WARNING | There must be no blank line following an inline comment
     487 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     548 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
    --------------------------------------------------------------------------
    
    
    FILE: ...1/web/vendor/drupal/pareviewsh/pareview_temp/src/HaystackContent.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
    --------------------------------------------------------------------------
     102 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     136 | 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
     162 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     165 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
    --------------------------------------------------------------------------
    
    
    FILE: .../site1101/web/vendor/drupal/pareviewsh/pareview_temp/haystack.module
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
    --------------------------------------------------------------------------
     15 | WARNING | Global constants should not be used, move it to a class
        |         | or interface
     16 | WARNING | Global constants should not be used, move it to a class
        |         | or interface
     17 | WARNING | Global constants should not be used, move it to a class
        |         | or interface
     18 | WARNING | Global constants should not be used, move it to a class
        |         | or interface
    --------------------------------------------------------------------------
    
    Time: 1.55 secs; Memory: 6Mb
    
  • No automated test cases were found, did you consider writing PHPUnit tests? This is not a requirement but encouraged for professional software development.
This automated report was generated with PAReview.sh, your friendly project application review script.

FILE: ...site1101/web/vendor/drupal/pareviewsh/pareview_temp/css/haystack.css
--------------------------------------------------------------------------
FOUND 11 ERRORS AFFECTING 1 LINE
--------------------------------------------------------------------------
 1 | ERROR | [x] Expected 1 space before opening brace of class
   |       |     definition; 0 found
 1 | ERROR | [x] Opening brace should be the last content on the line
 1 | ERROR | [ ] Style definitions must end with a semicolon
 1 | ERROR | [x] Expected 1 space after colon in style definition; 0
   |       |     found
 1 | ERROR | [x] Closing brace of class definition must be on new line
 1 | ERROR | [x] Expected 1 space before opening brace of class
   |       |     definition; 0 found
 1 | ERROR | [x] Opening brace should be the last content on the line
 1 | ERROR | [x] Each style definition must be on a line by itself
 1 | ERROR | [ ] Style definitions must end with a semicolon
 1 | ERROR | [x] Expected 1 space after colon in style definition; 0
   |       |     found
 1 | ERROR | [x] Closing brace of class definition must be on new line
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...reviewsh/pareview_temp/config/install/image.style.haystack_thumb.yml
--------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------
 12 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...drupal/pareviewsh/pareview_temp/config/install/haystack.settings.yml
--------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------
 17 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...or/drupal/pareviewsh/pareview_temp/config/schema/haystack.schema.yml
--------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------
 38 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...1101/web/vendor/drupal/pareviewsh/pareview_temp/src/HaystackCore.php
--------------------------------------------------------------------------
FOUND 74 ERRORS AND 16 WARNINGS AFFECTING 63 LINES
--------------------------------------------------------------------------
  10 | WARNING | [x] Unused use statement
 290 | ERROR   | [x] 4 spaces found before inline comment; expected "//
     |         |     $html = @file_get_contents($url);" but found "//   
     |         |     $html = @file_get_contents($url);"
 292 | WARNING | [ ] Line exceeds 80 characters; contains 183 characters
 292 | ERROR   | [ ] Comment indentation error, expected only 4 spaces
 295 | ERROR   | [ ] Comment indentation error, expected only 4 spaces
 300 | ERROR   | [ ] Comment indentation error, expected only 6 spaces
 303 | ERROR   | [ ] Comment indentation error, expected only 8 spaces
 309 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
 309 | ERROR   | [ ] Comment indentation error, expected only 4 spaces
 310 | WARNING | [ ] Line exceeds 80 characters; contains 93 characters
 312 | ERROR   | [x] Inline comments must end in full-stops, exclamation
     |         |     marks, colons, question marks, or closing
     |         |     parentheses
 338 | ERROR   | [x] There must be a single blank line after a tag group
 338 | ERROR   | [ ] Missing parameter comment
 341 | ERROR   | [ ] Description for the @return value is missing
 342 | ERROR   | [x] Separate the @return and @throws sections by a blank
     |         |     line.
 359 | ERROR   | [x] Array indentation error, expected 6 spaces but found
     |         |     8
 362 | ERROR   | [x] Array indentation error, expected 6 spaces but found
     |         |     8
 368 | ERROR   | [x] Expected 1 blank line after function; 2 found
 371 | WARNING | [x] There must be no blank line following an inline
     |         |     comment
 371 | ERROR   | [x] Inline comments must end in full-stops, exclamation
     |         |     marks, colons, question marks, or closing
     |         |     parentheses
 374 | ERROR   | [ ] Missing short description in doc comment
 375 | ERROR   | [ ] Missing parameter comment
 375 | ERROR   | [ ] Missing parameter type
 376 | ERROR   | [ ] Missing parameter comment
 377 | ERROR   | [ ] Missing parameter comment
 379 | ERROR   | [ ] Description for the @return value is missing
 382 | ERROR   | [x] Expected 1 blank line before function; 2 found
 390 | ERROR   | [x] Namespaced classes/interfaces/traits should be
     |         |     referenced with use statements
 391 | ERROR   | [x] Comments may not appear after statements
 391 | ERROR   | [x] Inline comments must end in full-stops, exclamation
     |         |     marks, colons, question marks, or closing
     |         |     parentheses
 398 | ERROR   | [x] There should be no white space after an opening "{"
 398 | ERROR   | [x] Comments may not appear after statements
 398 | ERROR   | [x] No space found before comment text; expected "// We
     |         |     need to keep the index alive" but found "//We need
     |         |     to keep the index alive"
 398 | ERROR   | [x] Inline comments must end in full-stops, exclamation
     |         |     marks, colons, question marks, or closing
     |         |     parentheses
 402 | ERROR   | [x] There should be no white space after an opening "{"
 402 | ERROR   | [x] Comments may not appear after statements
 402 | ERROR   | [x] No space found before comment text; expected "// We
     |         |     clear only one type" but found "//We clear only one
     |         |     type"
 402 | ERROR   | [x] Inline comments must end in full-stops, exclamation
     |         |     marks, colons, question marks, or closing
     |         |     parentheses
 406 | ERROR   | [x] There should be no white space after an opening "{"
 406 | ERROR   | [x] Comments may not appear after statements
 406 | ERROR   | [x] No space found before comment text; expected "// We
     |         |     clear only one type" but found "//We clear only one
     |         |     type"
 410 | ERROR   | [ ] Comment indentation error, expected only 6 spaces
 423 | ERROR   | [x] Expected newline after closing brace
 430 | WARNING | [x] There must be no blank line following an inline
     |         |     comment
 430 | ERROR   | [x] Inline comments must end in full-stops, exclamation
     |         |     marks, colons, question marks, or closing
     |         |     parentheses
 432 | ERROR   | [ ] Missing short description in doc comment
 433 | ERROR   | [ ] Description for the @return value is missing
 436 | ERROR   | [x] 2 spaces found before inline comment; expected "//
     |         |     // @FIXME" but found "//  // @FIXME"
 437 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
 437 | ERROR   | [x] No space found before comment text; expected "// //
     |         |     Could not extract the default value because it is
     |         |     either indeterminate, or" but found "//// Could not
     |         |     extract the default value because it is either
     |         |     indeterminate, or"
 438 | ERROR   | [x] No space found before comment text; expected "// //
     |         |     not scalar. You'll need to provide a default value
     |         |     in" but found "//// not scalar. You'll need to
     |         |     provide a default value in"
 439 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
 439 | ERROR   | [x] No space found before comment text; expected "// //
     |         |     config/install/haystack.settings.yml and
     |         |     config/schema/haystack.schema.yml." but found "////
     |         |     config/install/haystack.settings.yml and
     |         |     config/schema/haystack.schema.yml."
 440 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
 440 | ERROR   | [x] No space found before comment text; expected "//
     |         |     $types =
     |         |     \Drupal::config('haystack.settings')->get('haystack_content_types');"
     |         |     but found "//$types =
     |         |     \Drupal::config('haystack.settings')->get('haystack_content_types');"
 442 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
 442 | ERROR   | [x] No space found before comment text; expected "// //
     |         |     Could not extract the default value because it is
     |         |     either indeterminate, or" but found "//// Could not
     |         |     extract the default value because it is either
     |         |     indeterminate, or"
 443 | ERROR   | [x] No space found before comment text; expected "// //
     |         |     not scalar. You'll need to provide a default value
     |         |     in" but found "//// not scalar. You'll need to
     |         |     provide a default value in"
 444 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
 444 | ERROR   | [x] No space found before comment text; expected "// //
     |         |     config/install/haystack.settings.yml and
     |         |     config/schema/haystack.schema.yml." but found "////
     |         |     config/install/haystack.settings.yml and
     |         |     config/schema/haystack.schema.yml."
 445 | ERROR   | [x] No space found before comment text; expected "//
     |         |     $menus =
     |         |     \Drupal::config('haystack.settings')->get('haystack_menus');"
     |         |     but found "//$menus =
     |         |     \Drupal::config('haystack.settings')->get('haystack_menus');"
 447 | ERROR   | [ ] Comment indentation error, expected only 2 spaces
 448 | ERROR   | [ ] Comment indentation error, expected only 4 spaces
 452 | ERROR   | [ ] Comment indentation error, expected only 2 spaces
 453 | ERROR   | [ ] Comment indentation error, expected only 4 spaces
 457 | WARNING | [ ] Line exceeds 80 characters; contains 167 characters
 458 | WARNING | [ ] Line exceeds 80 characters; contains 178 characters
 460 | WARNING | [ ] Line exceeds 80 characters; contains 275 characters
 462 | WARNING | [ ] Line exceeds 80 characters; contains 119 characters
 465 | ERROR   | [ ] Comment indentation error, expected only 2 spaces
 466 | ERROR   | [x] Inline comments must end in full-stops, exclamation
     |         |     marks, colons, question marks, or closing
     |         |     parentheses
 468 | ERROR   | [x] Expected one space after the comma, 0 found
 468 | ERROR   | [x] Comments may not appear after statements
 468 | ERROR   | [x] No space found before comment text; expected "//
     |         |     $remaining," but found "//$remaining,"
 469 | ERROR   | [x] Expected one space after the comma, 0 found
 469 | ERROR   | [x] Comments may not appear after statements
 469 | ERROR   | [x] No space found before comment text; expected "//
     |         |     $total," but found "//$total,"
 470 | ERROR   | [x] Comments may not appear after statements
 470 | ERROR   | [x] No space found before comment text; expected "//
     |         |     Counts menu total in form encouraging results" but
     |         |     found "//Counts menu total in form encouraging
     |         |     results"
 471 | ERROR   | [x] No space found before comment text; expected "// }"
     |         |     but found "//}"
 471 | ERROR   | [x] Inline comments must end in full-stops, exclamation
     |         |     marks, colons, question marks, or closing
     |         |     parentheses
 474 | ERROR   | [ ] Missing short description in doc comment
 475 | ERROR   | [ ] Missing parameter comment
 475 | ERROR   | [ ] Missing parameter type
 476 | ERROR   | [ ] Missing parameter comment
 478 | ERROR   | [ ] Description for the @return value is missing
 486 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
 541 | ERROR   | [ ] Description for the @return value is missing
 559 | ERROR   | [x] Expected 1 blank line after function; 0 found
 560 | ERROR   | [x] The closing brace for the class must have an empty
     |         |     line before it
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 50 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...vendor/drupal/pareviewsh/pareview_temp/src/Form/HaystackSettings.php
--------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------
  13 | ERROR | [x] Missing class doc comment
 150 | ERROR | [x] Inline comments must end in full-stops, exclamation
     |       |     marks, colons, question marks, or closing parentheses
 168 | ERROR | [x] Inline comments must end in full-stops, exclamation
     |       |     marks, colons, question marks, or closing parentheses
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...site1101/web/vendor/drupal/pareviewsh/pareview_temp/haystack.install
--------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------
 1 | ERROR | [x] The PHP open tag must be followed by exactly one blank
   |       |     line
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: .../site1101/web/vendor/drupal/pareviewsh/pareview_temp/haystack.module
--------------------------------------------------------------------------
FOUND 28 ERRORS AFFECTING 24 LINES
--------------------------------------------------------------------------
  25 | ERROR | [x] Short array syntax must be used to define arrays
  42 | ERROR | [x] Short array syntax must be used to define arrays
  49 | ERROR | [x] Short array syntax must be used to define arrays
  91 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
  91 | ERROR | [x] 2 spaces found before inline comment; expected "// //
     |       |     Only process if the node is of the  types selected in
     |       |     configuration." but found "//  // Only process if the
     |       |     node is of the  types selected in configuration."
  92 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
  93 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
  94 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
  95 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
  95 | ERROR | [ ] Comment indentation error, expected only 2 spaces
  96 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
  96 | ERROR | [ ] Comment indentation error, expected only 4 spaces
  97 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
  98 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
  99 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
 100 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
 101 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
 102 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
 103 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
 103 | ERROR | [x] Inline comments must end in full-stops, exclamation
     |       |     marks, colons, question marks, or closing parentheses
 104 | ERROR | [x] Expected 1 blank line after function; 2 found
 114 | ERROR | [x] Short array syntax must be used to define arrays
 125 | ERROR | [x] Short array syntax must be used to define arrays
 184 | ERROR | [x] Short array syntax must be used to define arrays
 193 | ERROR | [x] Short array syntax must be used to define arrays
 227 | ERROR | [x] Functions must not contain multiple empty lines in a
     |       |     row; found 2 empty lines
 229 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
 232 | ERROR | [x] Namespaced classes/interfaces/traits should be
     |       |     referenced with use statements
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 26 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...1/web/vendor/drupal/pareviewsh/pareview_temp/haystack.links.menu.yml
--------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------
 11 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------

Time: 2.53 secs; Memory: 8Mb