Conditions | 11 |
Paths | 11 |
Total Lines | 24 |
Code Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Tests | 20 |
CRAP Score | 11.013 |
Changes | 2 | ||
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 |
||
40 | public function toLogLevelValue(string $level) |
||
41 | 141 | { |
|
42 | 141 | switch (strtolower($level)) { |
|
43 | 28 | case 'debug': |
|
44 | 113 | return 1; |
|
45 | 25 | case 'info': |
|
46 | 88 | return 2; |
|
47 | 11 | case 'notice': // PSR-3 |
|
48 | 77 | return 3; |
|
49 | 66 | case 'warn': |
|
50 | 22 | case 'warning': // PSR-3 |
|
51 | 55 | return 4; |
|
52 | 11 | case 'error': |
|
53 | 44 | return 5; |
|
54 | 11 | case 'critical': // PSR-3 |
|
55 | 33 | return 6; |
|
56 | 11 | case 'alert': // PSR-3 |
|
57 | 22 | return 7; |
|
58 | 11 | case 'emergency': // PSR-3 |
|
59 | 11 | return 8; |
|
60 | 11 | case 'fatal': |
|
61 | return 9; |
||
62 | default: |
||
63 | throw new LoggerException("Undefined log level: $level"); |
||
64 | } |
||
67 |
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