Skip to content
Developer & CodeLocal · Stays on device

Code Complexity Estimator

Estimate the cyclomatic complexity of each function in pasted JavaScript, TypeScript, Python or C-like code.

  • JavaScript / TypeScript, Python, Java, C#, C/C++, Go, PHP
  • Free to use
  • No sign-up or watermark
code-complexity-estimatorOn this device
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
JavaScript / TypeScriptPythonJava, C#, C/C++, Go, PHP
Open Code Complexity Estimator

About this tool

Cyclomatic complexity counts the independent paths through a function: one, plus one for every if, loop, case, catch, boolean && / || and ternary. Functions that score high are harder to test and more likely to hide bugs, so the number is a quick way to find refactoring candidates. This tool scans pasted code, finds each function and lists its estimated complexity with a simple/moderate/complex rating, its branches, parameter count and deepest nesting.

It’s an estimate made by scanning the text after blanking out comments and strings, not by fully parsing the language, so unusual syntax can be missed and dedicated analysers (ESLint’s complexity rule, radon, Lizard) may differ by a point or two. Nested functions are scored on their own. The code is never run. Everything runs in your browser. Your data is never uploaded, logged or stored.

  1. Input

    Your code or text

    JavaScript / TypeScript, Python, Java, C#, C/C++, Go, PHP

  2. Processing

    Processed in this browser

    Instant, in-browser. Nothing is uploaded.

  3. Output

    Your result

    Ready to download or copy

Local processing pipelineInstant, in-browser

How to use it

  1. 1

    Pick the language and paste one or more functions.

  2. 2

    Read the table, highest complexity first.

  3. 3

    Split up functions rated complex, or add tests for each branch.

Zero-upload architecture

How to use Code Complexity Estimator for free, with no upload

Free, with no sign-up or watermark · Your files stay on your device

  1. 1

    Open Code Complexity Estimator

    Launch the app and add your file. There is nothing to install and no account to create.

  2. 2

    Work through it

    Read the table, highest complexity first.

  3. 3

    Get your result

    Split up functions rated complex, or add tests for each branch.

  • Local

    Line Counter

    Count code, comment and blank lines by language for pasted code, files or a whole project ZIP.

    Open tool
  • Local

    JavaScript Formatter

    Beautify minified or messy JavaScript with configurable indentation and brace style, plus a syntax check that parses the code without running it.

    Open tool
  • Local

    Diff Checker

    Compare two texts or code snippets line by line, word by word or character by character, side by side or as a unified diff.

    Open tool
  • Local

    JSON Formatter

    Pretty-print, beautify and validate JSON with precise error locations, key sorting and custom indentation.

    Open tool