| Conditions | 1 |
| Paths | 1 |
| Total Lines | 58 |
| Code Lines | 47 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 48 |
| CRAP Score | 1 |
| 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 |
||
| 23 | 290 | public static function createMetadata() : MetadataCollection |
|
| 24 | { |
||
| 25 | 290 | return new TransientMetadataCollection( |
|
| 26 | 290 | new AnnotationMetadata( |
|
| 27 | 290 | Attribute::class, |
|
| 28 | 290 | AnnotationTarget::annotation(), |
|
| 29 | 290 | false, |
|
| 30 | 290 | new PropertyMetadata( |
|
| 31 | 290 | 'name', |
|
| 32 | 290 | new StringType(), |
|
| 33 | 290 | true, |
|
| 34 | 290 | true |
|
| 35 | ), |
||
| 36 | 290 | new PropertyMetadata( |
|
| 37 | 290 | 'type', |
|
| 38 | 290 | new StringType(), |
|
| 39 | 290 | true |
|
| 40 | ), |
||
| 41 | 290 | new PropertyMetadata( |
|
| 42 | 290 | 'required', |
|
| 43 | 290 | new BooleanType() |
|
| 44 | ) |
||
| 45 | ), |
||
| 46 | 290 | new AnnotationMetadata( |
|
| 47 | 290 | Attributes::class, |
|
| 48 | 290 | AnnotationTarget::class(), |
|
| 49 | 290 | false, |
|
| 50 | 290 | new PropertyMetadata( |
|
| 51 | 290 | 'value', |
|
| 52 | 290 | new ArrayType(new MixedType(), new ObjectType(Attribute::class)), |
|
| 53 | 290 | true, |
|
| 54 | 290 | true |
|
| 55 | ) |
||
| 56 | ), |
||
| 57 | 290 | new AnnotationMetadata( |
|
| 58 | 290 | Enum::class, |
|
| 59 | 290 | AnnotationTarget::property(), |
|
| 60 | 290 | true, |
|
| 61 | 290 | new PropertyMetadata( |
|
| 62 | 290 | 'value', |
|
| 63 | 290 | new ArrayType(new MixedType(), new MixedType()), |
|
| 64 | 290 | true, |
|
| 65 | 290 | true |
|
| 66 | ), |
||
| 67 | 290 | new PropertyMetadata( |
|
| 68 | 290 | 'literal', |
|
| 69 | 290 | new ArrayType(new MixedType(), new MixedType()) |
|
| 70 | ) |
||
| 71 | ), |
||
| 72 | 290 | new AnnotationMetadata( |
|
| 73 | 290 | Target::class, |
|
| 74 | 290 | AnnotationTarget::class(), |
|
| 75 | 290 | true, |
|
| 76 | 290 | new PropertyMetadata( |
|
| 77 | 290 | 'value', |
|
| 78 | 290 | new ArrayType(new MixedType(), new StringType()), |
|
| 79 | 290 | false, |
|
| 80 | 290 | true |
|
| 81 | ) |
||
| 86 |
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