Revision of http://git.drupal.org/project/country_state_city from Thu, 03/26/2020 - 02:08

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 4e042f3):
  • Bad line endings were found, always use unix style terminators. See https://www.drupal.org/coding-standards#indenting
    ./data/cities.json:                                                     ASCII text, with very long lines, with no line terminators
    
    
  • 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: ...sh/pareview_temp/src/Plugin/Field/FieldFormatter/ContryFormatter.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------
     60 | WARNING | \Drupal calls should be avoided in classes, use
        |         | dependency injection instead
    --------------------------------------------------------------------------
    
    
    FILE: ...ew_temp/src/Plugin/Field/FieldFormatter/ContryStateCityFormatter.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
    --------------------------------------------------------------------------
     60 | WARNING | \Drupal calls should be avoided in classes, use
        |         | dependency injection instead
     61 | WARNING | \Drupal calls should be avoided in classes, use
        |         | dependency injection instead
     62 | WARNING | \Drupal calls should be avoided in classes, use
        |         | dependency injection instead
    --------------------------------------------------------------------------
    
    
    FILE: ...areview_temp/src/Plugin/Field/FieldFormatter/ContryISO3Formatter.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------
     60 | WARNING | \Drupal calls should be avoided in classes, use
        |         | dependency injection instead
    --------------------------------------------------------------------------
    
    
    FILE: ...areview_temp/src/Plugin/Field/FieldFormatter/ContryISO2Formatter.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------
     60 | WARNING | \Drupal calls should be avoided in classes, use
        |         | dependency injection instead
    --------------------------------------------------------------------------
    
    
    FILE: ...review_temp/src/Plugin/Field/FieldFormatter/ContryStateFormatter.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    --------------------------------------------------------------------------
     60 | WARNING | \Drupal calls should be avoided in classes, use
        |         | dependency injection instead
     61 | WARNING | \Drupal calls should be avoided in classes, use
        |         | dependency injection instead
    --------------------------------------------------------------------------
    
    
    FILE: ...sh/pareview_temp/src/Plugin/Field/FieldWidget/CountryStateWidget.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 6 WARNINGS AFFECTING 6 LINES
    --------------------------------------------------------------------------
      91 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
      99 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     103 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     130 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     137 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     141 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
    --------------------------------------------------------------------------
    
    
    FILE: ...areview_temp/src/Plugin/Field/FieldWidget/CountryStateCityWidget.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 10 WARNINGS AFFECTING 10 LINES
    --------------------------------------------------------------------------
      92 | 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
     104 | 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
     129 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     133 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     163 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     170 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     174 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     232 | WARNING | t() calls should be avoided in classes, use dependency
         |         | injection and $this->t() instead
    --------------------------------------------------------------------------
    
    
    FILE: ...eviewsh/pareview_temp/src/Plugin/Field/FieldWidget/CountryWidget.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
    --------------------------------------------------------------------------
      99 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     106 | 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
    --------------------------------------------------------------------------
    
    Time: 2.71 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: ...sh/pareview_temp/src/Plugin/Field/FieldWidget/CountryStateWidget.php
--------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------
 159 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected
     |       |     "TRUE" but found "True"
 181 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected
     |       |     "TRUE" but found "True"
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...areview_temp/src/Plugin/Field/FieldWidget/CountryStateCityWidget.php
--------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------
 192 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected
     |       |     "TRUE" but found "True"
 214 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected
     |       |     "TRUE" but found "True"
 235 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected
     |       |     "TRUE" but found "True"
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...eviewsh/pareview_temp/src/Plugin/Field/FieldWidget/CountryWidget.php
--------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------
 29 | ERROR | [x] Array closing indentation error, expected 4 spaces but
    |       |     found 6
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...endor/drupal/pareviewsh/pareview_temp/src/Form/StateSettingsForm.php
--------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 6 LINES
--------------------------------------------------------------------------
  23 | ERROR | [ ] Parameter $string_translation is not described in
     |       |     comment
  26 | ERROR | [ ] Missing parameter comment
  27 | ERROR | [ ] Missing parameter comment
  27 | ERROR | [ ] Doc comment for parameter $config_factory does not
     |       |     match actual variable name $string_translation
  28 | ERROR | [ ] Missing parameter name
  29 | ERROR | [x] Parameter comment indentation must be 3 spaces, found
     |       |     1 spaces
 135 | ERROR | [x] Expected 1 space before "/"; 0 found
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...vendor/drupal/pareviewsh/pareview_temp/src/Form/CitySettingsForm.php
--------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 6 LINES
--------------------------------------------------------------------------
  23 | ERROR | [ ] Parameter $string_translation is not described in
     |       |     comment
  26 | ERROR | [ ] Missing parameter comment
  27 | ERROR | [ ] Missing parameter comment
  27 | ERROR | [ ] Doc comment for parameter $config_factory does not
     |       |     match actual variable name $string_translation
  28 | ERROR | [ ] Missing parameter name
  29 | ERROR | [x] Parameter comment indentation must be 3 spaces, found
     |       |     1 spaces
 135 | ERROR | [x] Expected 1 space before "/"; 0 found
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...dor/drupal/pareviewsh/pareview_temp/src/Form/CountrySettingsForm.php
--------------------------------------------------------------------------
FOUND 8 ERRORS AFFECTING 6 LINES
--------------------------------------------------------------------------
  23 | ERROR | [ ] Parameter $string_translation is not described in
     |       |     comment
  26 | ERROR | [x] Expected 3 space(s) before asterisk; 2 found
  26 | ERROR | [ ] Missing parameter comment
  27 | ERROR | [ ] Missing parameter comment
  27 | ERROR | [ ] Doc comment for parameter $config_factory does not
     |       |     match actual variable name $string_translation
  28 | ERROR | [ ] Missing parameter name
  29 | ERROR | [x] Parameter comment indentation must be 3 spaces, found
     |       |     1 spaces
 137 | ERROR | [x] Expected 1 space before "/"; 0 found
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------

Time: 4.9 secs; Memory: 8Mb