| Conditions | 11 |
| Paths | 64 |
| Total Lines | 40 |
| Code Lines | 17 |
| 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 |
||
| 32 | public static function renderIcon($icon, array $params = []) |
||
| 33 | { |
||
| 34 | $el = \Nette\Utils\Html::el('i'); |
||
|
|
|||
| 35 | |||
| 36 | $type = $params['type'] ?? 's'; |
||
| 37 | $fw = $params['fw'] ?? true; |
||
| 38 | |||
| 39 | $el->addAttributes(['class' => "fa{$type} fa-{$icon}"]); |
||
| 40 | |||
| 41 | if ($fw) |
||
| 42 | { |
||
| 43 | $el->appendAttribute('class', 'fa-fw'); |
||
| 44 | } |
||
| 45 | |||
| 46 | if (isset($params['size'])) |
||
| 47 | { |
||
| 48 | $el->appendAttribute('class', 'fa-'.$params['size']); |
||
| 49 | } |
||
| 50 | |||
| 51 | if (isset($params['spin']) && $params['spin']) |
||
| 52 | { |
||
| 53 | $el->appendAttribute('class', 'fa-spin'); |
||
| 54 | } |
||
| 55 | |||
| 56 | if (isset($params['pulse']) && $params['pulse']) |
||
| 57 | { |
||
| 58 | $el->appendAttribute('class', 'fa-pulse'); |
||
| 59 | } |
||
| 60 | |||
| 61 | if (isset($params['rotate']) && $params['rotate']) |
||
| 62 | { |
||
| 63 | $el->appendAttribute('class', 'fa-rotate-'.$params['rotate']); |
||
| 64 | } |
||
| 65 | |||
| 66 | if (isset($params['flip']) && $params['flip']) |
||
| 67 | { |
||
| 68 | $el->appendAttribute('class', 'fa-flip-'.$params['flip']); |
||
| 69 | } |
||
| 70 | |||
| 71 | return $el; |
||
| 72 | } |
||
| 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