Conditions | 12 |
Paths | 72 |
Total Lines | 64 |
Code Lines | 41 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 1 | 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 |
||
67 | public function buildModelCriteria() |
||
68 | { |
||
69 | $search = FeatureAvQuery::create(); |
||
70 | |||
71 | /* manage translations */ |
||
72 | $this->configureI18nProcessing($search); |
||
73 | |||
74 | $id = $this->getId(); |
||
75 | |||
76 | if (null !== $id) { |
||
77 | $search->filterById($id, Criteria::IN); |
||
78 | } |
||
79 | |||
80 | $exclude = $this->getExclude(); |
||
81 | |||
82 | if (null !== $exclude) { |
||
83 | $search->filterById($exclude, Criteria::NOT_IN); |
||
84 | } |
||
85 | |||
86 | $feature = $this->getFeature(); |
||
87 | |||
88 | if (null !== $feature) { |
||
89 | $search->filterByFeatureId($feature, Criteria::IN); |
||
90 | } |
||
91 | |||
92 | $orders = $this->getOrder(); |
||
93 | |||
94 | foreach ($orders as $order) { |
||
95 | switch ($order) { |
||
96 | case 'id': |
||
97 | $search->orderById(Criteria::ASC); |
||
98 | break; |
||
99 | case 'id_reverse': |
||
100 | $search->orderById(Criteria::DESC); |
||
101 | break; |
||
102 | case "alpha": |
||
103 | $search->addAscendingOrderByColumn('i18n_TITLE'); |
||
104 | break; |
||
105 | case "alpha_reverse": |
||
106 | case "alpha-reverse": |
||
107 | $search->addDescendingOrderByColumn('i18n_TITLE'); |
||
108 | break; |
||
109 | case "manual": |
||
110 | $search->orderByPosition(Criteria::ASC); |
||
111 | break; |
||
112 | case "manual_reverse": |
||
113 | $search->orderByPosition(Criteria::DESC); |
||
114 | break; |
||
115 | } |
||
116 | } |
||
117 | |||
118 | // Search only non-freetext feature values. |
||
119 | $search |
||
120 | ->useFeatureProductQuery() |
||
121 | ->filterByIsFreeText(false) |
||
122 | ->_or() |
||
123 | ->filterByIsFreeText(null) //does not belong to any product |
||
124 | ->endUse() |
||
125 | ; |
||
126 | |||
127 | // Joining with FeatureProduct may result in multiple occurences of the same FeatureAv. Juste get one. |
||
128 | $search->distinct(); |
||
129 | |||
130 | return $search; |
||
131 | } |
||
155 |
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