Cognitive complexity implementation for PHP_CodeSniffer
0.2 2019-12-24 14:23 UTC
Make it maintainable or else.
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
git clone https://github.com/Rarst/phpcs-cognitive-complexity phpcs --standard=phpcs-cognitive-complexity/src/CognitiveComplexity /path/to/scan
- detection of boolean operator chains is not perfect, due to complexity of many possible cases.
Initial code forked from Symplify Coding Standard.