Skip to content

codaviz

codaviz is a CLI that analyzes code complexity and emits a self-contained, interactive HTML report. It is a simpler, local alternative to SonarQube for spotting where to refactor.

Point it at a repo and it ranks complexity hotspots, draws a treemap (sized by lines of code, colored by a metric you pick), lets you inspect any module to read its functions and source, and flags circular imports and over-threshold functions.

codaviz needs no server and no database. The report is one HTML file you can open offline or email to a teammate.

codaviz interactive report: treemap, top-modules chart, and per-function drill-down with cyclomatic and cognitive complexity

In one command

uv run codaviz /path/to/project   # writes ./report.html

What it does

  • Hotspot ranking: modules and packages ordered by the metric you select, as a bar chart and a sortable table.
  • Treemap: the package/module tree as nested tiles, sized by SLOC and colored by badness. Click to zoom. A depth control keeps deep trees readable.
  • Function drill-down: every function with its cyclomatic and cognitive score, line number, and source snippet.
  • Circular imports: detected statically, without executing any code.
  • Threshold hints: functions over your configured cyclomatic or cognitive limits are flagged in place.
  • Exports: --format json or --format csv for the raw entity data.

Languages

Python works with no extra dependencies. JavaScript/TypeScript, Go, Ruby, Rust, Java, and PHP are analyzed via tree-sitter behind an optional extra. A single report can mix languages. See Languages.

Where to go next

Non-goals

Security scanning (use Bandit), runtime profiling (use cProfile or scalene), and test coverage (use pytest-cov) are out of scope. codaviz focuses on structural complexity.

License

codaviz is licensed under the Apache License 2.0.