| Conditions | 2 |
| Paths | 1 |
| Total Lines | 127 |
| Code Lines | 75 |
| 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 |
||
| 42 | public function getDictionary(): array |
||
| 43 | { |
||
| 44 | return [ |
||
| 45 | 'values.*' => 'MeasureUnitToInt', |
||
| 46 | 'values.collection.data' => function ($value) { |
||
| 47 | if (is_array($value)) { |
||
| 48 | return reset($value); |
||
| 49 | } |
||
| 50 | |||
| 51 | return $value; |
||
| 52 | }, |
||
| 53 | 'parent' => [ |
||
| 54 | 'AddAbstractSkuIfNotExist', |
||
| 55 | ], |
||
| 56 | 'categories' => [ |
||
| 57 | [ |
||
| 58 | 'ArrayToString', |
||
| 59 | 'options' => [ |
||
| 60 | 'glue' => ',', |
||
| 61 | ], |
||
| 62 | ], |
||
| 63 | ], |
||
| 64 | 'values' => [ |
||
| 65 | [ |
||
| 66 | 'EnrichAttributes', |
||
| 67 | 'options' => [ |
||
| 68 | 'map' => $this->getAttributeMap(), |
||
| 69 | 'excludeKeys' => [ |
||
| 70 | 'country_availability', |
||
| 71 | ], |
||
| 72 | ], |
||
| 73 | ], |
||
| 74 | [ |
||
| 75 | 'ValuesToAttributes', |
||
| 76 | 'options' => [ |
||
| 77 | 'locales' => $this->config->getLocalesForImport(), |
||
| 78 | ], |
||
| 79 | ], |
||
| 80 | [ |
||
| 81 | 'DefaultValuesToLocalizedAttributes', |
||
| 82 | 'options' => [ |
||
| 83 | 'locales' => $this->config->getLocalesForImport(), |
||
| 84 | ], |
||
| 85 | ], |
||
| 86 | ], |
||
| 87 | 'values.localizedAttributes' => [ |
||
| 88 | [ |
||
| 89 | 'AddMissingLocales', |
||
| 90 | 'options' => [ |
||
| 91 | 'locales' => $this->config->getLocalesForImport(), |
||
| 92 | ], |
||
| 93 | ], |
||
| 94 | [ |
||
| 95 | 'LocaleKeysToIds', |
||
| 96 | 'options' => [ |
||
| 97 | 'map' => $this->getLocaleMap(), |
||
| 98 | ], |
||
| 99 | ], |
||
| 100 | [ |
||
| 101 | 'MoveLocalizedAttributesToAttributes', |
||
| 102 | 'options' => [ |
||
| 103 | 'blacklist' => [ |
||
| 104 | 'name', |
||
| 105 | 'title', |
||
| 106 | 'product_description', |
||
| 107 | 'tax_set', |
||
| 108 | 'is_active_per_locale', |
||
| 109 | 'price', |
||
| 110 | 'bild_information', |
||
| 111 | 'picto_informationen', |
||
| 112 | 'meta_title', |
||
| 113 | 'meta_description', |
||
| 114 | 'meta_keywords', |
||
| 115 | ], |
||
| 116 | ], |
||
| 117 | ], |
||
| 118 | ], |
||
| 119 | 'values.price' => [ |
||
| 120 | [ |
||
| 121 | 'DefaultPriceSelector', |
||
| 122 | 'options' => [ |
||
| 123 | DefaultPriceSelector::OPTION_STORES => $this->config->getActiveStoresForProducts(), |
||
| 124 | DefaultPriceSelector::OPTION_LOCALE_TO_PRICE_MAP => $this->config->getLocaleToPriceMap(), |
||
| 125 | ], |
||
| 126 | ], |
||
| 127 | ], |
||
| 128 | 'values.localizedAttributes.*' => [ |
||
| 129 | [ |
||
| 130 | 'ExcludeKeysAssociativeFilter', |
||
| 131 | 'options' => [ |
||
| 132 | 'excludeKeys' => [ |
||
| 133 | 'price', |
||
| 134 | 'bild_information', |
||
| 135 | 'picto_information', |
||
| 136 | 'tax_set', |
||
| 137 | ], |
||
| 138 | ], |
||
| 139 | ], |
||
| 140 | [ |
||
| 141 | 'AddMissingAttributes', |
||
| 142 | 'options' => [ |
||
| 143 | 'attributes' => [ |
||
| 144 | 'name' => '', |
||
| 145 | 'description' => '', |
||
| 146 | 'meta_title' => '', |
||
| 147 | 'meta_description' => '', |
||
| 148 | 'meta_keywords' => '', |
||
| 149 | 'is_searchable' => true, |
||
| 150 | ], |
||
| 151 | ], |
||
| 152 | ], |
||
| 153 | [ |
||
| 154 | 'AddUrlToLocalizedAttributes', |
||
| 155 | ], |
||
| 156 | ], |
||
| 157 | 'values.attributes' => [ |
||
| 158 | [ |
||
| 159 | 'ExcludeKeysAssociativeFilter', |
||
| 160 | 'options' => [ |
||
| 161 | 'excludeKeys' => [ |
||
| 162 | 'price', |
||
| 163 | 'country_availability', |
||
| 164 | ], |
||
| 165 | ], |
||
| 166 | ], |
||
| 167 | [ |
||
| 168 | 'AddFamilyAttribute', |
||
| 169 | ], |
||
| 206 |
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