Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function cognitive complexity #16

Open
JoshuaOndieki opened this issue Jun 27, 2018 · 0 comments
Open

Function cognitive complexity #16

JoshuaOndieki opened this issue Jun 27, 2018 · 0 comments
Labels
codeclimate Review by codeclimate help wanted 🙏 Extra attention is needed question Further information is requested

Comments

@JoshuaOndieki
Copy link
Owner

JoshuaOndieki commented Jun 27, 2018

Should not exceed 5

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"
@JoshuaOndieki JoshuaOndieki added help wanted 🙏 Extra attention is needed question Further information is requested codeclimate Review by codeclimate labels Jun 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codeclimate Review by codeclimate help wanted 🙏 Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant