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