Conditions | 17 |
Paths | 384 |
Total Lines | 40 |
Code Lines | 35 |
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 | <div id="app-navigation-files" role="navigation"></div> |
||
25 | function NavigationListElements($item, $l, $pinned) { |
||
26 | strpos($item['classes'] ?? '', 'pinned') !== false ? $pinned++ : ''; ?> |
||
27 | <li |
||
28 | data-id="<?php p($item['id']) ?>" |
||
29 | <?php if (isset($item['dir'])) { ?> data-dir="<?php p($item['dir']); ?>" <?php } ?> |
||
30 | <?php if (isset($item['view'])) { ?> data-view="<?php p($item['view']); ?>" <?php } ?> |
||
31 | <?php if (isset($item['expandedState'])) { ?> data-expandedstate="<?php p($item['expandedState']); ?>" <?php } ?> |
||
32 | class="nav-<?php p($item['id']) ?> |
||
33 | <?php if (isset($item['classes'])) { |
||
34 | p($item['classes']); |
||
35 | } ?> |
||
36 | <?php p($pinned === 1 ? 'first-pinned' : '') ?> |
||
37 | <?php if (isset($item['defaultExpandedState']) && $item['defaultExpandedState']) { ?> open<?php } ?>" |
||
38 | <?php if (isset($item['folderPosition'])) { ?> folderposition="<?php p($item['folderPosition']); ?>" <?php } ?>> |
||
39 | |||
40 | <a href="<?php p(isset($item['href']) ? $item['href'] : '#') ?>" |
||
41 | class="nav-icon-<?php p(isset($item['icon']) && $item['icon'] !== '' ? $item['icon'] : $item['id']) ?> svg"><?php p($item['name']); ?></a> |
||
42 | |||
43 | |||
44 | <?php |
||
45 | NavigationElementMenu($item); |
||
46 | if (isset($item['sublist'])) { |
||
47 | ?> |
||
48 | <button class="collapse app-navigation-noclose" aria-expanded="<?= !empty($item['defaultExpandedState']) ? 'true' : 'false' ?>" |
||
49 | aria-label="<?php p($l->t('Toggle %1$s sublist', $item['name'])) ?>" |
||
50 | <?php if (sizeof($item['sublist']) == 0) { ?> style="display: none" <?php } ?>> |
||
51 | </button> |
||
52 | <ul id="sublist-<?php p($item['id']); ?>"> |
||
53 | <?php |
||
54 | foreach ($item['sublist'] as $item) { |
||
55 | $pinned = NavigationListElements($item, $l, $pinned); |
||
56 | } ?> |
||
57 | </ul> |
||
58 | <?php |
||
59 | } ?> |
||
60 | </li> |
||
61 | |||
62 | |||
63 | <?php |
||
64 | return $pinned; |
||
65 | } |
||
94 |
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