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:- Cyclomatic complexity, Cognitive complexity, Halstead metrics, Maintainability Index, ABC.
- Function & class shape: NOM, NARGS, NEXITS, NPA, NPM, WMC.
- The LOC family: SLOC, PLOC, LLOC, CLOC, blanks.
- Structural and cognitive complexity from CTE, join, subquery,
CASE, and window structure; a Review Burden Index and Change Risk Score; an SQL Halstead and maintainability index.
- Documentation Maintainability Index (DMI).
- Markdown Reading Path Complexity (MRPC), Markdown Cognitive Complexity (MCC), Markdown Halstead.
- Link Debt, Table Burden, Visual Scaffold, Artifact Debt.
- Repository Grounding, Evidence Coverage, Filler / Lazy Structure Risk, Review Criticality Index.
- An opt-in English readability ensemble and Japanese prose layer.
What is Mehen?
In Ophidiarium projects, names matter. Mehen is a mythical ancient Egyptian serpent associated with guarding Ra. In the same spirit, themehen CLI helps guard your codebase and documentation from
slowly collapsing under complexity.