Conditions | 9 |
Paths | 53 |
Total Lines | 67 |
Code Lines | 44 |
Lines | 0 |
Ratio | 0 % |
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 |
||
123 | function qa_report_projects() { |
||
124 | $ret = '<h3>Projects</h3>'; |
||
125 | drupal_static_reset('update_get_projects'); |
||
126 | $GLOBALS['conf']['update_check_disabled'] = TRUE; |
||
127 | $projects = update_get_projects(); |
||
128 | ksort($projects); |
||
129 | $ret .= kprint_r($projects, TRUE); |
||
130 | |||
131 | $ret .= '<h3>Modules info</h3>'; |
||
132 | list($modules, $projects) = Module::getInfo(); |
||
133 | |||
134 | $header = array( |
||
135 | t('Project'), |
||
136 | t('Module'), |
||
137 | t('Module status'), |
||
138 | t('Project status'), |
||
139 | ); |
||
140 | |||
141 | $rows = array(); |
||
142 | $previous_project = ''; |
||
143 | /** @var \Drupal\qa\System\Project $project */ |
||
144 | foreach ($projects as $name => $project) { |
||
145 | $row = array(); |
||
146 | $project_cell = array( |
||
147 | 'data' => $name, |
||
148 | ); |
||
149 | $count = $project->useCount(); |
||
150 | if ($count > 1) { |
||
151 | //$project_cell['rowspan'] = $count; |
||
152 | } |
||
153 | if ($name != $previous_project) { |
||
154 | $previous_project = $name; |
||
155 | } |
||
156 | |||
157 | $enabled = t('Enabled'); |
||
158 | $disabled = t('Disabled'); |
||
159 | |||
160 | /** @var \Drupal\qa\System\Module $module */ |
||
161 | foreach (array_values($project->modules) as $index => $module) { |
||
162 | $row = array(); |
||
163 | $row[] = ($index === 0) ? $project_cell : ''; |
||
164 | |||
165 | $row[] = $module->name; |
||
166 | $row[] = $module->isEnabled() ? $enabled : $disabled; |
||
167 | |||
168 | if ($index === 0) { |
||
169 | if ($count === 0) { |
||
170 | $last_cell = array( |
||
171 | 'style' => 'background-color: #ff8080', |
||
172 | 'data' => $count, |
||
173 | ); |
||
174 | } |
||
175 | else { |
||
176 | $last_cell = $count; |
||
177 | } |
||
178 | } |
||
179 | else { |
||
180 | $last_cell = ''; |
||
181 | } |
||
182 | $row[] = $last_cell; |
||
183 | |||
184 | $rows[] = $row; |
||
185 | } |
||
186 | } |
||
187 | return theme('table', array( |
||
188 | 'header' => $header, |
||
189 | 'rows' => $rows, |
||
190 | )); |
||
193 |
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