Conditions | 11 |
Paths | 10 |
Total Lines | 51 |
Code Lines | 29 |
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 |
||
37 | public function __get (string $name) |
||
38 | { |
||
39 | switch (strtolower ($name)) |
||
40 | { |
||
41 | case 'count': |
||
42 | case 'length': |
||
43 | try |
||
44 | { |
||
45 | return $this->getProperty ('Count'); |
||
46 | } |
||
47 | |||
48 | catch (\WinformsException $e) |
||
1 ignored issue
–
show
|
|||
49 | { |
||
50 | return $this->getProperty ('Length'); |
||
51 | } |
||
52 | break; |
||
53 | |||
54 | case 'list': |
||
55 | $size = $this->count; |
||
1 ignored issue
–
show
|
|||
56 | $list = []; |
||
57 | |||
58 | for ($i = 0; $i < $size; ++$i) |
||
59 | $list[] = EngineAdditions::coupleSelector (VoidCore::getArrayValue ($this->selector, $i)); |
||
60 | |||
61 | return $list; |
||
62 | break; |
||
1 ignored issue
–
show
|
|||
63 | |||
64 | case 'names': |
||
65 | $size = $this->count; |
||
66 | $names = []; |
||
67 | |||
68 | for ($i = 0; $i < $size; ++$i) |
||
69 | try |
||
70 | { |
||
71 | $names[] = VoidCore::getProperty (VoidCore::getArrayValue ($this->selector, [$i, VC_OBJECT]), 'Text'); |
||
1 ignored issue
–
show
|
|||
72 | } |
||
73 | |||
74 | catch (\WinformsException $e) |
||
75 | { |
||
76 | $names[] = VoidCore::getArrayValue ($this->selector, [$i, VC_STRING]); |
||
1 ignored issue
–
show
|
|||
77 | } |
||
78 | |||
79 | return $names; |
||
80 | break; |
||
81 | } |
||
82 | |||
83 | if (method_exists ($this, $method = 'get_'. $name)) |
||
84 | return $this->$method (); |
||
85 | |||
86 | return isset ($this->$name) ? |
||
87 | $this->$name : EngineAdditions::coupleSelector ($this->getProperty ($name)); |
||
88 | } |
||
252 |
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