Conditions | 12 |
Paths | 7 |
Total Lines | 30 |
Code Lines | 14 |
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 |
||
20 | public function model() |
||
21 | { |
||
22 | // Plan |
||
23 | if ($this->model_table == 'plan') { |
||
24 | return $this->plan; |
||
25 | } elseif (inString($this->model_table, 'plan_management')) { |
||
26 | // Return Plan model if it exists |
||
27 | if ($this->planManagement->plan) { |
||
28 | return $this->planManagement->plan; |
||
29 | } |
||
30 | |||
31 | // Otherwise return the Project model |
||
32 | else { |
||
33 | return $this->planManagement->project; |
||
34 | } |
||
35 | } |
||
36 | |||
37 | // Project |
||
38 | elseif ($this->model_table == 'project') { |
||
39 | return $this->project; |
||
40 | } |
||
41 | |||
42 | // Task |
||
43 | elseif ($this->model_table == 'task_record' && $this->taskRecord && $this->taskRecord->task && $this->taskRecord->task->project) { |
||
44 | return $this->taskRecord->task->project; |
||
45 | } elseif ($this->model_table == 'task' && $this->task && $this->task->project) { |
||
46 | return $this->task->project; |
||
47 | } |
||
48 | |||
49 | return null; |
||
50 | } |
||
134 |
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