A term that I see every now and then is \"Cyclomatic Complexity\". Here on SO I saw some Questions about \"how to calculate the CC of Language X\" or \"How do I do Y with th
Consider the control flow graph of your function, with an additional edge running from the exit to the entrance. The cyclomatic complexity is the maximum number of cuts we can make without separating the graph into two pieces.
For example:
function F:
if condition1:
...
else:
...
if condition2:
...
else:
...
![]()
Control Flow Graph
You can probably intuitively see why the linked graph has a cyclomatic complexity of 3.