| Conditions | 18 |
| Paths | 18 |
| Total Lines | 47 |
| Code Lines | 31 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 1 | 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 |
||
| 140 | public function __call($method, $args = []) |
||
| 141 | { |
||
| 142 | $model = models($this->model->getClass()); |
||
| 143 | |||
| 144 | if (method_exists($model, $method)) { |
||
| 145 | $model->row = $this; |
||
| 146 | |||
| 147 | if (false !== ($result = call_user_func_array([&$model, $method], $args))) { |
||
| 148 | $this->offsetSet($method, $result); |
||
| 149 | |||
| 150 | return $result; |
||
| 151 | } |
||
| 152 | } elseif (strpos($method, 'Url')) { |
||
| 153 | $key = str_replace('Url', '', $method); |
||
| 154 | |||
| 155 | if ($key === $model->uploadedImageKey) { |
||
| 156 | if (isset($model->uploadedImageFilePath)) { |
||
| 157 | if (is_file($filePath = $model->uploadedImageFilePath . $this->offsetGet($key))) { |
||
| 158 | return images_url($filePath); |
||
| 159 | } elseif (is_file($filePath = PATH_STORAGE . 'images/default/not-found.jpg')) { |
||
| 160 | return images_url($filePath); |
||
| 161 | } elseif (is_file($filePath = PATH_STORAGE . 'images/default/not-found.png')) { |
||
| 162 | return images_url($filePath); |
||
| 163 | } |
||
| 164 | } |
||
| 165 | } elseif (in_array($key, $model->uploadedImageKeys)) { |
||
| 166 | if (isset($model->uploadedImageFilePath)) { |
||
| 167 | if (is_file($filePath = $model->uploadedImageFilePath . $this->offsetGet($key))) { |
||
| 168 | return images_url($filePath); |
||
| 169 | } elseif (is_file($filePath = PATH_STORAGE . 'images/default/not-found.jpg')) { |
||
| 170 | return images_url($filePath); |
||
| 171 | } elseif (is_file($filePath = PATH_STORAGE . 'images/default/not-found.png')) { |
||
| 172 | return images_url($filePath); |
||
| 173 | } |
||
| 174 | } |
||
| 175 | } elseif ($key === $model->uploadedFileKey) { |
||
| 176 | if (isset($model->uploadedFileFilepath)) { |
||
| 177 | return storage_url($model->uploadedFileFilepath . $this->offsetGet($key)); |
||
| 178 | } |
||
| 179 | } elseif (in_array($key, $model->uploadedFileKeys)) { |
||
| 180 | if (isset($model->uploadedFileFilepath)) { |
||
| 181 | return storage_url($model->uploadedFileFilepath . $this->offsetGet($key)); |
||
| 182 | } |
||
| 183 | } |
||
| 184 | } |
||
| 185 | |||
| 186 | return null; |
||
| 187 | } |
||
| 219 | } |
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