| Conditions | 10 |
| Paths | 12 |
| Total Lines | 25 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 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 |
||
| 55 | public function afterSuite(SuiteEvent $event): void |
||
|
|
|||
| 56 | { |
||
| 57 | if ($this->skipCoverage) { |
||
| 58 | if ($this->io && $this->io->isVerbose()) { |
||
| 59 | $this->io->writeln('Skipping code coverage generation'); |
||
| 60 | } |
||
| 61 | |||
| 62 | return; |
||
| 63 | } |
||
| 64 | |||
| 65 | if ($this->io && $this->io->isVerbose()) { |
||
| 66 | $this->io->writeln(); |
||
| 67 | } |
||
| 68 | |||
| 69 | foreach ($this->reports as $format => $report) { |
||
| 70 | if ($this->io && $this->io->isVerbose()) { |
||
| 71 | $this->io->writeln(sprintf('Generating code coverage report in %s format ...', $format)); |
||
| 72 | } |
||
| 73 | |||
| 74 | if ($report instanceof Report\Text) { |
||
| 75 | $this->io->writeln( |
||
| 76 | $report->process($this->coverage, $this->io->isDecorated()) |
||
| 77 | ); |
||
| 78 | } else { |
||
| 79 | $report->process($this->coverage, $this->options['output'][$format]); |
||
| 80 | } |
||
| 131 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.