Revision of https://git.drupal.org/project/imagefield_default_alt_and_title.git 8.x-1.x from Wed, 11/27/2019 - 16:58

Revisions allow you to track differences between multiple versions of your content, and revert back to older versions.

Review of the 8.x-1.x branch (commit 1db5512):
  • Your README.txt does not follow best practices (headings need to be uppercase). See https://www.drupal.org/node/2181737 .
    • The REQUIREMENTS section is missing.
  • The imagefield_default_alt_and_title.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.
  • 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/imagefield_default_alt_and_title.js: line 24, col 36, Error - Properties shouldn't be quoted as all quotes are redundant. (quote-props)
    /var/vhosts/c214000000/site1101/web/vendor/drupal/pareviewsh/pareview_temp/js/imagefield_default_alt_and_title.js: line 34, col 42, Error - Properties shouldn't be quoted as all quotes are redundant. (quote-props)
    
    2 problems
    
  • DrupalPractice has found some issues with your code, but could be false positives.
    
    FILE: ...l/pareviewsh/pareview_temp/src/ImagefieldDefaultAltAndTitleBatch.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------
     15 | WARNING | Unused variable $results.
    --------------------------------------------------------------------------
    
    
    FILE: ...reviewsh/pareview_temp/src/Form/ImagefieldDefaultAltAndTitleForm.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
    --------------------------------------------------------------------------
     38 | WARNING | t() calls should be avoided in classes, use dependency
        |         | injection and $this->t() instead
     63 | WARNING | \Drupal calls should be avoided in classes, use
        |         | dependency injection instead
     67 | WARNING | \Drupal calls should be avoided in classes, use
        |         | dependency injection instead
    --------------------------------------------------------------------------
    
    
    FILE: ...wsh/pareview_temp/src/Form/ImagefieldDefaultAltAndTitleBatchForm.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 9 WARNINGS AFFECTING 9 LINES
    --------------------------------------------------------------------------
      91 | 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
     110 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     121 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     136 | WARNING | t() calls should be avoided in classes, use dependency
         |         | injection and $this->t() instead
     137 | WARNING | t() calls should be avoided in classes, use dependency
         |         | injection and $this->t() instead
     138 | WARNING | t() calls should be avoided in classes, use dependency
         |         | injection and $this->t() instead
     148 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     152 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
    --------------------------------------------------------------------------
    
    Time: 541ms; Memory: 4Mb
    
  • 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: ...pal/pareviewsh/pareview_temp/imagefield_default_alt_and_title.module
--------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------
  1 | ERROR | [x] The PHP open tag must be followed by exactly one blank
    |       |     line
 17 | ERROR | [x] Namespaced classes/interfaces/traits should be
    |       |     referenced with use statements
 20 | ERROR | [x] Object operator not indented correctly; expected 6
    |       |     spaces but found 27
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...00000/site1101/web/vendor/drupal/pareviewsh/pareview_temp/README.txt
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------
 33 | WARNING | Line exceeds 80 characters; contains 81 characters
--------------------------------------------------------------------------


FILE: ...l/pareviewsh/pareview_temp/src/ImagefieldDefaultAltAndTitleBatch.php
--------------------------------------------------------------------------
FOUND 13 ERRORS AFFECTING 12 LINES
--------------------------------------------------------------------------
   9 | ERROR | [x] Missing class doc comment
  14 | ERROR | [x] Visibility must be declared on method "addedData"
  15 | ERROR | [x] Short array syntax must be used to define arrays
  17 | ERROR | [x] Object operator not indented correctly; expected 6
     |       |     spaces but found 21
  39 | ERROR | [x] Case breaking statements must be followed by a single
     |       |     blank line
  45 | ERROR | [x] Case breaking statements must be followed by a single
     |       |     blank line
  59 | ERROR | [x] Short array syntax must be used to define arrays
  76 | ERROR | [x] Visibility must be declared on method
     |       |     "addedDataFinishedCallback"
  79 | ERROR | [x] Object operator not indented correctly; expected 8
     |       |     spaces but found 24
  90 | ERROR | [x] Visibility must be declared on method "changeValue"
  90 | ERROR | [ ] Arguments with default values must be at the end of
     |       |     the argument list
 118 | ERROR | [x] Expected 1 blank line after function; 0 found
 119 | ERROR | [x] The closing brace for the class must have an empty
     |       |     line before it
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 12 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...reviewsh/pareview_temp/src/Form/ImagefieldDefaultAltAndTitleForm.php
--------------------------------------------------------------------------
FOUND 8 ERRORS AFFECTING 8 LINES
--------------------------------------------------------------------------
  3 | ERROR | [x] Namespaced classes, interfaces and traits should not
    |       |     begin with a file doc comment
 13 | ERROR | [x] Missing class doc comment
 18 | ERROR | [ ] Public method name
    |       |     "ImagefieldDefaultAltAndTitleForm::getFormID" is not in
    |       |     lowerCamel format
 51 | ERROR | [x] Object operator not indented correctly; expected 6
    |       |     spaces but found 24
 60 | ERROR | [ ] Public method name
    |       |     "ImagefieldDefaultAltAndTitleForm::ImagefieldDefaultAltAndTitleEntityList"
    |       |     is not in lowerCamel format
 68 | ERROR | [x] Object operator not indented correctly; expected 12
    |       |     spaces but found 37
 80 | ERROR | [x] Expected 1 blank line after function; 0 found
 81 | ERROR | [x] The closing brace for the class must have an empty line
    |       |     before it
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...wsh/pareview_temp/src/Form/ImagefieldDefaultAltAndTitleBatchForm.php
--------------------------------------------------------------------------
FOUND 20 ERRORS AFFECTING 20 LINES
--------------------------------------------------------------------------
   3 | ERROR | [x] Namespaced classes, interfaces and traits should not
     |       |     begin with a file doc comment
  22 | ERROR | [x] Expected 1 blank line before function; 0 found
  24 | ERROR | [x] Expected 1 blank line after function; 0 found
  30 | ERROR | [x] Short array syntax must be used to define arrays
  34 | ERROR | [x] Short array syntax must be used to define arrays
  41 | ERROR | [x] Short array syntax must be used to define arrays
  46 | ERROR | [x] Short array syntax must be used to define arrays
  54 | ERROR | [x] Short array syntax must be used to define arrays
  59 | ERROR | [x] Short array syntax must be used to define arrays
  67 | ERROR | [x] Short array syntax must be used to define arrays
  72 | ERROR | [x] Short array syntax must be used to define arrays
  78 | ERROR | [x] Short array syntax must be used to define arrays
  84 | ERROR | [x] Expected 1 blank line after function; 0 found
  92 | ERROR | [x] Object operator not indented correctly; expected 6
     |       |     spaces but found 11
 132 | ERROR | [x] Short array syntax must be used to define arrays
 146 | ERROR | [ ] Public method name
     |       |     "ImagefieldDefaultAltAndTitleBatchForm::ImagefieldDefaultAltAndTitleEntityListByType"
     |       |     is not in lowerCamel format
 147 | ERROR | [x] Short array syntax must be used to define arrays
 153 | ERROR | [x] Object operator not indented correctly; expected 12
     |       |     spaces but found 37
 165 | ERROR | [x] Expected 1 blank line after function; 0 found
 166 | ERROR | [x] The closing brace for the class must have an empty
     |       |     line before it
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 19 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...viewsh/pareview_temp/imagefield_default_alt_and_title.links.menu.yml
--------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------
 6 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...eviewsh/pareview_temp/imagefield_default_alt_and_title.libraries.yml
--------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------
 8 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...al/pareviewsh/pareview_temp/imagefield_default_alt_and_title.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: ...viewsh/pareview_temp/imagefield_default_alt_and_title.links.task.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
--------------------------------------------------------------------------


FILE: ...areviewsh/pareview_temp/imagefield_default_alt_and_title.routing.yml
--------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------
 15 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------

Time: 961ms; Memory: 4Mb