Conditions | 10 |
Paths | 14 |
Total Lines | 21 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 25.6155 |
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 |
||
7 | 13 | public static function getColonneLink($paricevuti, &$modellocolonne) |
|
8 | { |
||
9 | 13 | $output = GrigliaParametriUtils::getOuputType($paricevuti); |
|
10 | 13 | $colonne_link = isset($paricevuti['colonne_link']) ? $paricevuti['colonne_link'] : array(); |
|
11 | 13 | if (($output == 'stampa') || !isset($colonne_link)) { |
|
12 | return; |
||
13 | } |
||
14 | |||
15 | 13 | foreach ($colonne_link as $colonna_link) { |
|
16 | foreach ($colonna_link as $nomecolonna => $parametricolonna) { |
||
17 | foreach ($modellocolonne as $key => $value) { |
||
18 | foreach ($value as $keyv => $valuev) { |
||
19 | if (($keyv == 'name') && ($valuev == $nomecolonna)) { |
||
20 | $modellocolonne[$key]['formatter'] = 'showlink'; |
||
21 | $modellocolonne[$key]['formatoptions'] = $parametricolonna; |
||
22 | } |
||
23 | } |
||
24 | } |
||
25 | } |
||
26 | } |
||
27 | 13 | } |
|
28 | } |
||
29 |