| Conditions | 10 |
| Paths | 64 |
| Total Lines | 30 |
| Lines | 21 |
| Ratio | 70 % |
| 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 |
||
| 122 | private function renderUrlOutput() |
||
| 123 | { |
||
| 124 | $this->output->writeln("\n\n <comment>Passed tests:</comment> \n"); |
||
| 125 | |||
| 126 | View Code Duplication | foreach ($this->results as $results) { |
|
| 127 | foreach ($results as $result) { |
||
| 128 | if ($result->getStatus() === CheckResult::STATUS_SUCCESS) { |
||
| 129 | $this->renderSuccess($result); |
||
| 130 | } |
||
| 131 | } |
||
| 132 | } |
||
| 133 | |||
| 134 | $this->output->writeln("\n <comment>Failed tests:</comment> \n"); |
||
| 135 | |||
| 136 | View Code Duplication | foreach ($this->results as $results) { |
|
| 137 | foreach ($results as $result) { |
||
| 138 | if ($result->getStatus() === CheckResult::STATUS_FAILURE) { |
||
| 139 | $this->renderFailure($result); |
||
| 140 | } |
||
| 141 | } |
||
| 142 | } |
||
| 143 | |||
| 144 | View Code Duplication | foreach ($this->results as $results) { |
|
| 145 | foreach ($results as $result) { |
||
| 146 | if ($result->getStatus() === CheckResult::STATUS_SKIPPED) { |
||
| 147 | $this->renderSkipped($result); |
||
| 148 | } |
||
| 149 | } |
||
| 150 | } |
||
| 151 | } |
||
| 152 | } |
||
| 153 |