docs/insights/complexity.md
For now the Complexity section is only one Metric consisting of multiple insights:
NunoMaduro\PhpInsights\Domain\Metrics\Complexity\Complexity <Badge text="Complexity" type="warn" vertical="middle"/>This insight checks total method cyclomatic complexity of each class, the lower the score the easier your code is to understand. It raises an issue if complexity is over 5.
Insight Class: NunoMaduro\PhpInsights\Domain\Insights\CyclomaticComplexityIsHigh
\NunoMaduro\PhpInsights\Domain\Insights\CyclomaticComplexityIsHigh::class => [
'maxComplexity' => 5,
]
This insight checks average class method cyclomatic complexity, the lower the score the easier your code is to understand. It raises an issue if complexity is over 5.0.
Insight Class: NunoMaduro\PhpInsights\Domain\Insights\ClassMethodAverageCyclomaticComplexityIsHigh
\NunoMaduro\PhpInsights\Domain\Insights\ClassMethodAverageCyclomaticComplexityIsHigh::class => [
'maxClassMethodAverageComplexity' => 5.0,
]
This insight checks cyclomatic complexity of your methods, the lower the score the easier your code is to understand. It raises an issue if complexity is over 5.
Insight Class: NunoMaduro\PhpInsights\Domain\Insights\MethodCyclomaticComplexityIsHigh
\NunoMaduro\PhpInsights\Domain\Insights\MethodCyclomaticComplexityIsHigh::class => [
'maxMethodComplexity' => 5,
]