Open
Description
Is your feature request related to a problem?
While working on #684, I noticed some divergences between how PHPCS and PHPMD/PHP Depend count cyclomatic complexity. For example, PHPCS increases the cyclomatic complexity by one whenever it finds a default statement, while PHPMD/PHP Depend doesn't.
Maybe there needs to be a review of the sniff to ensure that it is correctly counting cyclomatic complexity? This issue is somewhat related to #726, which presents another case that the sniff considers but that potentially it should not.
I'm not sure if PHPCS or PHPMD is correct, and I was not able to find what is the definition of cyclomatic complexity that is used by the sniff to check if it is following it or not.
- I have read the Contribution Guidelines and this is not a support question.
- I intend to create a pull request to implement this feature.