Conditions | 24 |
Paths | 14 |
Total Lines | 34 |
Code Lines | 32 |
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 |
||
32 | public static function getType(IndexInfo $index) |
||
33 | { |
||
34 | if ($index->isText()) { |
||
35 | return "TEXT"; |
||
36 | } else if ($index->isUnique() && !$index->isSparse() && !static::checkDescending($index)) { |
||
37 | return "UNIQUE"; |
||
38 | } else if ($index->isUnique() && !$index->isSparse() && static::checkDescending($index)) { |
||
39 | return "UNIQUE_DESC"; |
||
40 | } else if ($index->isSparse() && !static::checkDescending($index)) { |
||
41 | return "SPARSE"; |
||
42 | } else if ($index->isSparse() && $index->isUnique() && !static::checkDescending($index)) { |
||
43 | return "SPARSE_UNIQUE"; |
||
44 | } else if ($index->isSparse() && $index->isUnique() && static::checkDescending($index)) { |
||
45 | return "SPARSE_UNIQUE_DESC"; |
||
46 | } else if ($index->isSparse() && static::checkDescending($index)) { |
||
47 | return "SPARSE_DESC"; |
||
48 | } else if ($index->is2dSphere()) { |
||
49 | return "2DSPARSE"; |
||
50 | } else if ($index->isTtl()) { |
||
51 | return "TTL"; |
||
52 | } else if ($index->isGeoHaystack()) { |
||
53 | return "GEOHAYSTACK"; |
||
54 | } else { |
||
55 | $name = $index->getName(); |
||
56 | $partials = explode("_", $name); |
||
57 | $type = end($partials); |
||
58 | if ($type == 'asc') { |
||
59 | return "ASC"; |
||
60 | } else if ($type == 'index') { |
||
61 | return "INDEX"; |
||
62 | } else if ($type == 'desc') { |
||
63 | return "DESC"; |
||
64 | } else { |
||
65 | return ""; |
||
66 | } |
||
158 |
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