AI writes code faster than you can review it.
Catch what got worse, in seconds.

AST Metrics measures complexity, coupling, architecture, bus factor and test quality for PHP, Go, Python, Rust, Java, C# and TypeScript. On a pull request, ast-metrics review flags only what got worse. No server, no noise, same code, same verdict.

  • Open source, MIT
  • Nothing leaves your machine

Install with brew npx pipx curl composer docker go

The whole tool is a single self-contained binary.

brew install ast-metrics/tap/ast-metrics
  • No runtime, no dependencies
  • Analysis runs locally

One command

Run it once.
Read your project like a map.

ast-metrics analyze --report-html=report . builds this report: a plain-language verdict, then every metric behind it.

Overview page of the AST Metrics HTML report: a plain-language verdict followed by scores for complexity, focused classes, method size, maintainability, test isolation and bus factor

Want to see it on real code first? Try it online, nothing to install.

Continuous integration

One line of YAML,
zero noise in your reviews.

On every pull request, the action runs ast-metrics review and comments with only the new or worsened findings. Legacy code stays quiet, and fail-on decides what blocks the merge.

MCP server

Your metrics, readable by AI agents.

The built-in MCP server lets Claude, Cursor and other coding agents query complexity, coupling and architecture directly. Start it with ast-metrics mcp and you are done.

analyze_project find_risky_code get_coupling get_communities get_test_quality list_components + 3 more tools
Set up the MCP server

Curious what these metrics actually mean?

Every metric has its own page: what it measures, how to read it, and how to improve it.

Explore the metrics guide