Cyclomatic Complexity Estimator
Estimates cyclomatic complexity per function by counting branch points in real code.
Loading the tool…
How to use this tool
- Paste one or more functions.
- Select Estimate.
- Start at the top of the table — it is sorted with the most complex function first.
- Treat anything above 10 as a candidate for splitting, not as a defect.
What complexity estimator does
Cyclomatic complexity counts the independent paths through a function: one, plus one for every branch. It maps directly onto testing effort, because that count is the minimum number of test cases needed to reach every path. A function scoring 25 is not badly written by definition, but it does need twenty-five tests before you can say it works.
This is an estimate, and it says so on every result. It counts branch keywords and logical operators in code that is genuinely code, ignoring anything in a comment or a string, but it has no parser behind it: a compiler-grade tool will disagree at the edges. Use it to find the two functions in a file that need attention, which it does reliably, rather than to defend a number to three decimal places.