nunomaduro/phpinsights
PHP Insights is a terminal tool to analyze PHP code quality, style, architecture, and complexity. Works out of the box with Laravel (artisan insights), Symfony, Yii, Magento, and more, with built-in checks for reliability and loose coupling.
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,
]
How can I help you explore Laravel packages today?