bronek / code-complexity
Simple tool to measure code cyclomatic complexity as described on https://phpmd.org/rules/codesize.html
Installs: 17
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- nikic/php-parser: ^3.1
- symfony/console: ^3.3
Requires (Dev)
- phpspec/phpspec: ^4.0
- phpunit/phpunit: ^6.3
This package is auto-updated.
Last update: 2025-03-21 00:19:27 UTC
README
Class for check code complexity score of php code.
Install
composer require bronek/code-complexity
Usage
<?php $calculator = new \Bronek\CodeComplexity\CodeComplexityCalculator(); $complexityScore = $calculator->calculate(file_get_contents('file.php')); echo "Code Complexity of file file.php is $complexityScore"