| Total Complexity | 7 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | final class ComToLoc |
||
| 10 | { |
||
| 11 | private bool $exceedThreshold = false; |
||
| 12 | |||
| 13 | public function __construct(private readonly array $thresholds) |
||
| 14 | { |
||
| 15 | } |
||
| 16 | |||
| 17 | public function prepareComToLoc(array $commentStatistics, int $linesOfCode): ComToLocDTO |
||
| 18 | { |
||
| 19 | $ratio = $this->getRatio($commentStatistics, $linesOfCode); |
||
| 20 | return new ComToLocDTO( |
||
| 21 | $ratio, |
||
| 22 | $this->getColorForRatio($ratio) |
||
| 23 | ); |
||
| 24 | } |
||
| 25 | |||
| 26 | public function hasExceededThreshold(): bool |
||
| 27 | { |
||
| 28 | return $this->exceedThreshold; |
||
| 29 | } |
||
| 30 | |||
| 31 | private function getRatio(array $commentStatistics, int $linesOfCode): float |
||
| 32 | { |
||
| 33 | $totalComments = array_sum($commentStatistics); |
||
| 34 | return round($totalComments / $linesOfCode, 2); |
||
| 35 | } |
||
| 36 | |||
| 37 | private function getColorForRatio(float $ratio): string |
||
| 47 | } |
||
| 48 | } |
||
| 49 |
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