Rarst / phpcs-cognitive-complexity

Cognitive Complexity implementation for PHP_CodeSniffer
Other
26 stars 4 forks source link
php phpcs phpcs-standard

PHPCS Cognitive Complexity

Make it maintainable or else.

Tests Status Latest Stable Version PHP from Packagist PDS Skeleton

The project implements Cognitive Complexity metric by SonarSource as PHP_CodeSniffer standard.

Install

Composer

composer init --no-interaction
composer require rarst/phpcs-cognitive-complexity squizlabs/php_codesniffer dealerdirect/phpcodesniffer-composer-installer
vendor/bin/phpcs --standard=CognitiveComplexity /path/to/scan

Standalone

git clone https://github.com/Rarst/phpcs-cognitive-complexity
phpcs --standard=phpcs-cognitive-complexity/src/CognitiveComplexity /path/to/scan

Limitations

Credits

Initial code forked from Symplify Coding Standard.

License

MIT