| Conditions | 13 |
| Paths | 80 |
| Total Lines | 34 |
| Code Lines | 24 |
| 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 |
||
| 56 | public function handle() |
||
| 57 | { |
||
| 58 | $force = $this->option('force', false); |
||
|
1 ignored issue
–
show
|
|||
| 59 | if ($force) { |
||
| 60 | $this->error("Force mode active."); |
||
| 61 | } |
||
| 62 | $current_version = false; |
||
| 63 | try { |
||
| 64 | if (file_exists($this->filename)) { |
||
| 65 | $fn = fopen($this->filename, "r"); |
||
| 66 | if ($fn !== false) { |
||
| 67 | for ($i=0; !$current_version && $i < 20 && !feof($fn); $i++) { |
||
| 68 | $line = fgets($fn, 30); |
||
| 69 | preg_match_all("/@version ((\d([\.-]|$))+)/", $line, $m); |
||
| 70 | if (!empty($m[1])) { |
||
| 71 | $current_version = $m[1][0]; |
||
| 72 | } |
||
| 73 | } |
||
| 74 | } |
||
| 75 | } |
||
| 76 | } catch (\Throwable $e) { |
||
| 77 | // current_version is false |
||
| 78 | } |
||
| 79 | if ($current_version) { |
||
| 80 | $this->info("Lumener: Current ".$current_version); |
||
| 81 | } else { |
||
| 82 | $this->error("Lumener: Adminer not found."); |
||
| 83 | } |
||
| 84 | $version = $this->_getVersion(); |
||
| 85 | if ($force || !file_exists($this->filename) |
||
| 86 | || $version != $current_version) { |
||
| 87 | $this->_downloadVersion($version); |
||
| 88 | } else { |
||
| 89 | $this->info('Lumener: Up to date.'); |
||
| 90 | } |
||
| 179 |
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