Skip to content

Feature: Allow to use cognitive instead of cyclomatic complexity #354

@haraldreingruber

Description

@haraldreingruber

Cognitive complexity seems to have some advantages over cyclomatic complexity, for the understandability of code.

For example, a long but simple switch/case block has a very high cyclomatic complexity but a low cognitive complexity.
Here is a good description of the differences: https://docs.codeclimate.com/docs/cognitive-complexity

Maybe the analyzer from https://github.com/Rarst/phpcs-cognitive-complexity can be used to add this alternative metric?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions