Perl::Critic::CognitiveComplexity - Cognitive Complexity, Because Testability != Understandability
Perl::Critic::Policy::CognitiveComplexity::ProhibitExcessCognitiveComplexity is a rule that checks the cognitive complexity score of your subroutines. It is based on a new scoring algorithm introduced by SonarSource. See SonarSource blog entry.
The default complexity score before code starts to be reported with medium severity, is 10. This can be changed by changing the warn_level parameter. By default all subroutines with complexity level of more than 0 are reported in lowest severity level. This allows third-party tools to pick up these values as code metrics.
warn_level
[Perl::Critic::Policy::CognitiveComplexity::ProhibitExcessCognitiveComplexity] warn_level = 10 info_level = 1
Perl::Critic
Copyright (C) 2017 Oliver Trosien
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Oliver Trosien <cpan@pocket-design.de>
To install Perl::Critic::CognitiveComplexity, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perl::Critic::CognitiveComplexity
CPAN shell
perl -MCPAN -e shell install Perl::Critic::CognitiveComplexity
For more information on module installation, please visit the detailed CPAN module installation guide.