Home▸Computer Science▸Cyclomatic Complexity Explorer (2D)

Cyclomatic Complexity Explorer (2D)

Build a control-flow graph by adding IF branches, LOOPs and SWITCH statements on a pannable, zoomable 2D canvas, and watch McCabe's Cyclomatic Complexity M = E - N + 2 update live — the exact metric linters like ESLint, SonarQube and Android Lint flag as a maintainability risk.

Computer Science2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-mobile-code-quality-linting ↗ Open standalone

Every static-analysis linter — ESLint, SonarQube, Android Lint, Detekt — flags functions once their control-flow graph gets too tangled, and the number they check is McCabe's Cyclomatic Complexity: M = E − N + 2, the count of edges minus nodes in the function's graph plus two. This simulator lets you build that graph construct by construct — straight-line statements, IF/ELSE branches, LOOPs with back-edges, and multi-way SWITCH statements — and renders it live as a pannable, zoomable 2D control-flow graph while every metric a linter would report (node count, edge count, decision points, minimum test paths, and M itself) updates in real time against a configurable lint threshold, exactly the rule a CI pipeline runs on every commit.

⚙ Under the hood

Build a control-flow graph out of IF/ELSE branches, LOOPs and SWITCH statements on a pannable, zoomable 2D canvas, and watch McCabe's Cyclomatic Complexity (M = E - N + 2) update live against a configurable linter threshold.

code qualitystatic analysislintingcontrol flow graphsoftware metricsalgorithms

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)