Conditions | 14 |
Paths | 17 |
Total Lines | 24 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 34.4273 |
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 |
||
12 | 6 | public function generateForProperty(FieldMetadata $field, Constraint $constraint, Generator $faker) |
|
13 | { |
||
14 | /* |
||
15 | * @var IpConstraint |
||
16 | */ |
||
17 | 6 | switch ($constraint->version) { |
|
18 | 6 | case IpConstraint::V6: |
|
19 | 3 | case IpConstraint::V6_NO_PRIV: |
|
20 | 3 | case IpConstraint::V6_NO_RES: |
|
21 | 3 | case IpConstraint::V6_ONLY_PUBLIC: |
|
22 | 3 | return $faker->ipv6; |
|
23 | |||
24 | default: |
||
25 | 3 | case IpConstraint::V4: |
|
26 | case IpConstraint::V4_NO_PRIV: |
||
27 | case IpConstraint::V4_NO_RES: |
||
28 | case IpConstraint::V4_ONLY_PUBLIC: |
||
29 | 3 | return $faker->ipv4; |
|
30 | |||
31 | case IpConstraint::ALL: |
||
32 | case IpConstraint::ALL_NO_PRIV: |
||
33 | case IpConstraint::ALL_NO_RES: |
||
34 | case IpConstraint::ALL_ONLY_PUBLIC: |
||
35 | return $faker->{mt_rand(0, 1) ? 'ipv4' : 'ipv6'}; |
||
36 | } |
||
39 |
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