| Conditions | 4 |
| Paths | 2 |
| Total Lines | 67 |
| Code Lines | 31 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 15 | public function run() |
||
| 16 | { |
||
| 17 | /* |
||
| 18 | * Blocked Types |
||
| 19 | * |
||
| 20 | */ |
||
| 21 | $BlockedTypes = [ |
||
| 22 | [ |
||
| 23 | 'slug' => 'email', |
||
| 24 | 'name' => 'E-mail', |
||
| 25 | ], |
||
| 26 | [ |
||
| 27 | 'slug' => 'ipAddress', |
||
| 28 | 'name' => 'IP Address', |
||
| 29 | ], |
||
| 30 | [ |
||
| 31 | 'slug' => 'domain', |
||
| 32 | 'name' => 'Domain Name', |
||
| 33 | ], |
||
| 34 | [ |
||
| 35 | 'slug' => 'user', |
||
| 36 | 'name' => 'User', |
||
| 37 | ], |
||
| 38 | [ |
||
| 39 | 'slug' => 'city', |
||
| 40 | 'name' => 'City', |
||
| 41 | ], |
||
| 42 | [ |
||
| 43 | 'slug' => 'state', |
||
| 44 | 'name' => 'State', |
||
| 45 | ], |
||
| 46 | [ |
||
| 47 | 'slug' => 'country', |
||
| 48 | 'name' => 'Country', |
||
| 49 | ], |
||
| 50 | [ |
||
| 51 | 'slug' => 'countryCode', |
||
| 52 | 'name' => 'Country Code', |
||
| 53 | ], |
||
| 54 | [ |
||
| 55 | 'slug' => 'continent', |
||
| 56 | 'name' => 'Continent', |
||
| 57 | ], |
||
| 58 | [ |
||
| 59 | 'slug' => 'region', |
||
| 60 | 'name' => 'Region', |
||
| 61 | ], |
||
| 62 | ]; |
||
| 63 | |||
| 64 | /* |
||
| 65 | * Add Blocked Types |
||
| 66 | * |
||
| 67 | */ |
||
| 68 | if (config('laravelblocker.seedPublishedBlockedTypes')) { |
||
| 69 | foreach ($BlockedTypes as $BlockedType) { |
||
| 70 | $newBlockedType = BlockedType::where('slug', '=', $BlockedType['slug']) |
||
| 71 | ->withTrashed() |
||
| 72 | ->first(); |
||
| 73 | if ($newBlockedType === null) { |
||
| 74 | $newBlockedType = BlockedType::create([ |
||
| 75 | 'slug' => $BlockedType['slug'], |
||
| 76 | 'name' => $BlockedType['name'], |
||
| 77 | ]); |
||
| 78 | } |
||
| 79 | } |
||
| 80 | } |
||
| 81 | echo "\e[32mSeeding:\e[0m BlockedTypeTableSeeder\r\n"; |
||
| 82 | } |
||
| 84 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths