| Conditions | 4 |
| Paths | 19 |
| Total Lines | 56 |
| Code Lines | 33 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 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 |
||
| 37 | public function handle(): int |
||
| 38 | { |
||
| 39 | $groupId = $this->argument('groupId'); |
||
| 40 | |||
| 41 | if (!is_numeric($groupId)) { |
||
| 42 | $this->error('Group ID must be numeric.'); |
||
| 43 | |||
| 44 | return self::FAILURE; |
||
| 45 | } |
||
| 46 | |||
| 47 | try { |
||
| 48 | $group = UsenetGroup::find($groupId); |
||
| 49 | |||
| 50 | if ($group === null) { |
||
| 51 | $this->error("Group not found with id {$groupId}"); |
||
| 52 | |||
| 53 | return self::FAILURE; |
||
| 54 | } |
||
| 55 | |||
| 56 | $groupMySQL = $group->toArray(); |
||
| 57 | $nntp = $this->getNntp(); |
||
| 58 | $backFill = new Backfill(); |
||
| 59 | |||
| 60 | // Update the group for new binaries |
||
| 61 | $this->info("Updating binaries for group: {$groupMySQL['name']}"); |
||
| 62 | (new Binaries())->updateGroup($groupMySQL); |
||
| 63 | |||
| 64 | // BackFill the group with 20k articles |
||
| 65 | $this->info("Backfilling group: {$groupMySQL['name']}"); |
||
| 66 | $backFill->backfillAllGroups($groupMySQL['name'], 20000, 'normal'); |
||
| 67 | |||
| 68 | // Create releases |
||
| 69 | $this->info("Processing releases for group: {$groupMySQL['name']}"); |
||
| 70 | $this->processReleases(new ProcessReleases(), (string) $groupId); |
||
| 71 | |||
| 72 | // Post process the releases |
||
| 73 | $this->info("Post-processing additional for group: {$groupMySQL['name']}"); |
||
| 74 | (new ProcessAdditional(['Echo' => true, 'NNTP' => $nntp]))->start($groupId); |
||
| 75 | |||
| 76 | $this->info("Processing NFO files for group: {$groupMySQL['name']}"); |
||
| 77 | (new Nfo())->processNfoFiles( |
||
| 78 | $nntp, |
||
| 79 | $groupId, |
||
| 80 | '', |
||
| 81 | (bool)Settings::settingValue('lookupimdb'), |
||
| 82 | (bool)Settings::settingValue('lookuptv') |
||
| 83 | ); |
||
| 84 | |||
| 85 | $this->info("Completed all processing for group: {$groupMySQL['name']}"); |
||
| 86 | |||
| 87 | return self::SUCCESS; |
||
| 88 | } catch (\Throwable $e) { |
||
| 89 | Log::error($e->getTraceAsString()); |
||
| 90 | $this->error($e->getMessage()); |
||
| 91 | |||
| 92 | return self::FAILURE; |
||
| 93 | } |
||
| 141 |
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