| Conditions | 1 |
| Paths | 1 |
| Total Lines | 52 |
| 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 |
||
| 44 | public function getErrorList($testFile) |
||
| 45 | { |
||
| 46 | return array( |
||
| 47 | // The "do ... while" construct. |
||
| 48 | 5 => 1, |
||
| 49 | 7 => 1, |
||
| 50 | 10 => 1, |
||
| 51 | 12 => 1, |
||
| 52 | 14 => 1, |
||
| 53 | 17 => 1, |
||
| 54 | // The "while" construct. |
||
| 55 | 23 => 1, |
||
| 56 | 25 => 1, |
||
| 57 | 27 => 1, |
||
| 58 | // The "switch" construct. |
||
| 59 | 33 => 1, |
||
| 60 | 35 => 1, |
||
| 61 | 37 => 1, |
||
| 62 | // The "for" construct. |
||
| 63 | 43 => 1, |
||
| 64 | 45 => 1, |
||
| 65 | 47 => 1, |
||
| 66 | // The "if" construct. |
||
| 67 | 53 => 1, |
||
| 68 | 55 => 1, |
||
| 69 | 57 => 1, |
||
| 70 | // The "foreach" construct. |
||
| 71 | 63 => 1, |
||
| 72 | 65 => 1, |
||
| 73 | 67 => 1, |
||
| 74 | // The "elseif" construct. |
||
| 75 | 76 => 1, |
||
| 76 | 80 => 1, |
||
| 77 | 84 => 1, |
||
| 78 | 88 => 1, |
||
| 79 | // The "else" construct. |
||
| 80 | 97 => 1, |
||
| 81 | 101 => 1, |
||
| 82 | 105 => 1, |
||
| 83 | // The "do" construct. |
||
| 84 | 111 => 1, |
||
| 85 | 113 => 1, |
||
| 86 | // The "try" construct. |
||
| 87 | 121 => 1, |
||
| 88 | 125 => 1, |
||
| 89 | // The "catch" construct. |
||
| 90 | 136 => 1, |
||
| 91 | 139 => 1, |
||
| 92 | 143 => 1, |
||
| 93 | 147 => 1, |
||
| 94 | ); |
||
| 95 | }//end getErrorList() |
||
| 96 | |||
| 113 |