Skip to main content
mehen is a fast, deterministic CLI for code and documentation metrics. It analyzes eleven source languages plus SQL and Markdown, runs in seconds even on large monorepos, and ships a GitHub Action that publishes per-PR metric trends out of the box.
mehen metrics src/main.py --pretty
mehen top-offenders src --metric cognitive
mehen diff --from main --to HEAD --paths src

Get started

Run mehen against your project in under a minute.

GitHub Action

Add the action and start posting metric trends on PRs.

Code metrics

Cyclomatic, cognitive, Halstead, MI, ABC, LOC family, NOM, NPA, NPM, WMC.

SQL metrics

CTE graphs, join/subquery structure, object-touch risk, SQL Halstead, composite scores.

Markdown metrics

DMI, MRPC, MCC, link debt, filler/lazy risk, English/Japanese prose layer.

Why mehen?

Real language parsers

Ruff for Python, Oxc for TS/JS/JSX/TSX, Mago for PHP, Prism for Ruby, ra_ap_syntax for Rust, ANTLR for Kotlin and Java, sqruff for SQL, pulldown-cmark for Markdown, tree-sitter for Go, C, PowerShell.

Code, SQL, and documentation

One tool covers source-code complexity, first-class SQL structure metrics, and Markdown documentation health.

Deterministic, no network

Pure static analysis. Same input → same output. Safe for air-gapped CI.

PR-native reporting

Built-in mehen diff with sticky GitHub comment via the official action.

What mehen computes

For source code: For SQL: For Markdown documentation:

What is Mehen?

In Ophidiarium projects, names matter. Mehen is a mythical ancient Egyptian serpent associated with guarding Ra. In the same spirit, the mehen CLI helps guard your codebase and documentation from slowly collapsing under complexity.