mehen is a fast, deterministic CLI for code and documentation metrics. It analyzes nine source languages plus Markdown, runs in seconds even on large monorepos, and ships a GitHub Action that publishes per-PR metric trends out of the box.Documentation Index
Fetch the complete documentation index at: https://mehen.ophi.dev/llms.txt
Use this file to discover all available pages before exploring further.
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.
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,
pulldown-cmark for Markdown, tree-sitter for Go, C, Kotlin, PowerShell.
Code and documentation
A single tool covers source-code complexity 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.
- 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.