π§ Cognitive Complexity
Explaining cognitive complexity measurement for writing cleaner & more maintainable code.
A new method published by SonarSource in 2017, overcomes the shortcomings of cyclomatic complexity, helping to better identify problematic code fragments in large codebases written in modern languages. It also tries to better reflect the mental model of a software developer, rather than strictly following an arbitrary mathematical model.
