| Conditions | 15 | 
| Paths | 208 | 
| Total Lines | 56 | 
| Code Lines | 38 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 4 | ||
| 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 | ||
| 66 | public function run($request) | ||
| 67 |     { | ||
| 68 | $classes = $this->getAllVersionedDataClasses(); | ||
| 69 |         if ($request && $request->requestVar('verbose')) { | ||
| 70 |             $this->verbose = $request->requestVar('verbose'); | ||
| 71 | } | ||
| 72 | |||
| 73 |         if ($request && $request->requestVar('dry')) { | ||
| 74 |             $this->dryRun = $request->requestVar('dry'); | ||
| 75 | } | ||
| 76 | |||
| 77 |         if ($request && $request->requestVar('limit')) { | ||
| 78 |             $this->limit = $request->requestVar('limit'); | ||
| 79 | } | ||
| 80 | |||
| 81 |         DB::alteration_message('Pruning all DataObjects with a maximum of ' . self::MAX_ITEMS_PER_CLASS . ' per class.'); | ||
| 82 | $totalTotalDeleted = 0; | ||
| 83 | $runObject = RunForOneObject::inst() | ||
| 84 | ->setVerbose($this->verbose) | ||
| 85 | ->setDryRun($this->dryRun) | ||
| 86 | ; | ||
| 87 |         DB::alteration_message('settings (set as parameters)'); | ||
| 88 |         DB::alteration_message('-------------------- '); | ||
| 89 |         DB::alteration_message('verbose: ' . ($this->verbose ? 'yes' : 'no'), 'created'); | ||
| 90 |         DB::alteration_message('dry run: ' . ($this->dryRun ? 'yes' : 'no'), 'created'); | ||
| 91 |         DB::alteration_message('limit per class: ' . $this->limit, 'created'); | ||
| 92 |         DB::alteration_message('-------------------- '); | ||
| 93 |         foreach ($classes as $className) { | ||
| 94 | $objects = $this->getObjectsPerClassName($runObject, $className); | ||
| 95 | $noData = ''; | ||
| 96 |             if(! $objects->exists()) { | ||
| 97 | $noData = '- nothing to do'; | ||
| 98 | } | ||
| 99 |             DB::alteration_message('... Looking at ' . $className. ' '.$noData); | ||
| 100 | $totalDeleted = 0; | ||
| 101 | |||
| 102 |             foreach ($objects as $object) { | ||
| 103 | // check if stages are present | ||
| 104 |                 if($this->verbose) { | ||
| 105 |                     DB::alteration_message('... ... Checking #ID: ' . $object->ID); | ||
| 106 | } | ||
| 107 | $totalDeleted += $runObject->deleteSuperfluousVersions($object); | ||
| 108 | } | ||
| 109 | |||
| 110 |             if ($totalDeleted > 0) { | ||
| 111 |                 DB::alteration_message('... ... Deleted ' . $totalDeleted . ' version records'); | ||
| 112 | $totalTotalDeleted += $totalDeleted; | ||
| 113 | } | ||
| 114 | } | ||
| 115 | |||
| 116 |         DB::alteration_message('-------------------- '); | ||
| 117 |         DB::alteration_message('Completed, pruned ' . $totalTotalDeleted . ' version records'); | ||
| 118 |         DB::alteration_message('-------------------- '); | ||
| 119 | $array = $runObject->getCountRegister(); | ||
| 120 |         foreach ($array as $table => $count) { | ||
| 121 |             DB::alteration_message('... '.$table . ' has ' . $count . ' version records left.'); | ||
| 122 | } | ||
| 163 | 
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