Conditions | 2 |
Paths | 1 |
Total Lines | 97 |
Code Lines | 58 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
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 |
||
41 | public function getDictionary(): array |
||
42 | { |
||
43 | return [ |
||
44 | 'categories' => [ |
||
45 | [ |
||
46 | 'ArrayToString', |
||
47 | 'options' => [ |
||
48 | 'glue' => ',', |
||
49 | ], |
||
50 | ], |
||
51 | ], |
||
52 | 'values.*' => 'MeasureUnitToInt', |
||
53 | 'values.collection.data' => function ($value) { |
||
54 | if (is_array($value)) { |
||
55 | return reset($value); |
||
56 | } |
||
57 | |||
58 | return $value; |
||
59 | }, |
||
60 | 'values' => [ |
||
61 | [ |
||
62 | 'EnrichAttributes', |
||
63 | 'options' => [ |
||
64 | 'map' => $this->getAttributeMap(), |
||
65 | 'excludeKeys' => [ |
||
66 | 'country_availability', |
||
67 | ], |
||
68 | ], |
||
69 | ], |
||
70 | [ |
||
71 | 'ValuesToAttributes', |
||
72 | 'options' => [ |
||
73 | 'locales' => $this->config->getLocalesForImport(), |
||
74 | ], |
||
75 | ], |
||
76 | [ |
||
77 | 'DefaultValuesToLocalizedAttributes', |
||
78 | 'options' => [ |
||
79 | 'locales' => $this->config->getLocalesForImport(), |
||
80 | ], |
||
81 | ], |
||
82 | ], |
||
83 | 'values.localizedAttributes' => [ |
||
84 | [ |
||
85 | 'AddMissingLocales', |
||
86 | 'options' => [ |
||
87 | 'locales' => $this->config->getLocalesForImport(), |
||
88 | ], |
||
89 | ], |
||
90 | [ |
||
91 | 'LocaleKeysToIds', |
||
92 | 'options' => [ |
||
93 | 'map' => $this->getLocaleMap(), |
||
94 | ], |
||
95 | ], |
||
96 | [ |
||
97 | 'MoveLocalizedAttributesToAttributes', |
||
98 | 'options' => [ |
||
99 | 'blacklist' => [ |
||
100 | 'name', |
||
101 | 'title', |
||
102 | 'product_description', |
||
103 | 'meta_keywords', |
||
104 | 'meta_title', |
||
105 | 'meta_description', |
||
106 | 'tax_set', |
||
107 | 'is_active_per_locale', |
||
108 | 'bild_information', |
||
109 | 'picto_informationen', |
||
110 | ], |
||
111 | ], |
||
112 | ], |
||
113 | ], |
||
114 | 'values.localizedAttributes.*' => [ |
||
115 | [ |
||
116 | 'AddMissingAttributes', |
||
117 | 'options' => [ |
||
118 | 'attributes' => [ |
||
119 | 'name' => '', |
||
120 | 'description' => '', |
||
121 | 'meta_title' => '', |
||
122 | 'meta_description' => '', |
||
123 | 'meta_keywords' => '', |
||
124 | ], |
||
125 | ], |
||
126 | ], |
||
127 | [ |
||
128 | 'AddUrlToLocalizedAttributes', |
||
129 | ], |
||
130 | ], |
||
131 | 'values.attributes' => [ |
||
132 | [ |
||
133 | 'ExcludeKeysAssociativeFilter', |
||
134 | 'options' => [ |
||
135 | 'excludeKeys' => [ |
||
136 | 'price', |
||
137 | 'country_availability', |
||
138 | ], |
||
171 |
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