Complex is better
than complicated
We build complex
software
We don’t want
complicated code
Cyclomatic complexity
• M = E − N + 2P
• E = the number of edges of the graph.
• N = the number of nodes of the graph.
• P = the number of connected components.
• https://en.wikipedia.org/wiki/Cyclomatic_complexity
Limiting complicated code
• National Institute of Standards and Technology - 10
• Either
• Under the limit
• Provide a written explanation of why it become so
complicated
Software
• C/C++/Objective C - https://github.com/terryyin/
lizard
• golang - https://github.com/fzipp/gocyclo
• Python - https://github.com/rubik/radon
• Javascript - https://github.com/es-analysis/plato
It can’t help
• Stupid architect design
• Human readability
• Software Quality
Brought to you by Oursky
Build your mobile app fast
skygear.io (open source)

Using cyclomatic complexity to measure code complexity