# mehen ## Docs - [mehen diff](https://mehen.ophi.dev/commands/diff.md): Compare metrics between two git revisions and emit a per-file delta report as JSON or GitHub-flavored Markdown. - [mehen metrics](https://mehen.ophi.dev/commands/metrics.md): Analyze exactly one file and emit a metrics report as JSON, Markdown, YAML, or TOML. - [Commands overview](https://mehen.ophi.dev/commands/overview.md): The mehen CLI exposes three commands: metrics, diff, and top-offenders. - [mehen top-offenders](https://mehen.ophi.dev/commands/top-offenders.md): Walk one or more paths and rank the worst-offending files by one or more metrics. - [Architecture](https://mehen.ophi.dev/concepts/architecture.md): How mehen's parsers, analyzers, metric pipeline, and reporters compose. - [Output formats](https://mehen.ophi.dev/concepts/output-formats.md): Format support per command: JSON, Markdown, YAML, TOML. - [Spaces](https://mehen.ophi.dev/concepts/spaces.md): How mehen models functions, methods, classes, traits, and modules as nested containers. - [Thresholds and diffs](https://mehen.ophi.dev/concepts/thresholds-and-diffs.md): How `mehen diff` thresholds gate the GitHub Action. - [Implement LoC](https://mehen.ophi.dev/developers/loc.md): Implementation guide for the Lines of Code metric family inside a language analyzer. - [Add a new language](https://mehen.ophi.dev/developers/new-language.md): How to add a new language analyzer to mehen — pick a parser, implement the LanguageAnalyzer trait, and register the analyzer. - [Developers](https://mehen.ophi.dev/developers/overview.md): Build mehen, run the test suite, and contribute changes. - [Update grammars](https://mehen.ophi.dev/developers/update-grammars.md): Bump pinned tree-sitter grammar versions and regenerate the kind enums. - [GitHub Action](https://mehen.ophi.dev/guides/github-action.md): Drop the ophidiarium/mehen action into a workflow to publish per-PR metric trends. - [PR comment design](https://mehen.ophi.dev/guides/pr-comment-design.md): How mehen diff renders its Markdown sticky comment — anchors, table layout, cell format, callout catalog, and what is deliberately not in scope. - [Installation](https://mehen.ophi.dev/installation.md): Install mehen via npm, PyPI, or cargo binstall. Native binaries are published for Linux, macOS, and Windows on every release. - [Introduction](https://mehen.ophi.dev/introduction.md): mehen is a Rust-powered CLI for heuristic source code metrics — complexity, maintainability, lines of code, documentation health — at scale. - [ABC metric](https://mehen.ophi.dev/metrics/code/abc.md): Fitzpatrick's ABC count: Assignments, Branches, Conditions, with a magnitude that combines all three. - [Blank lines](https://mehen.ophi.dev/metrics/code/blank.md): Whitespace-only lines. - [CLOC — Comment Lines of Code](https://mehen.ophi.dev/metrics/code/cloc.md): Comment lines: line, block, and documentation comments. - [Cognitive complexity](https://mehen.ophi.dev/metrics/code/cognitive.md): How difficult code is to understand, weighted by nesting and control-flow breaks. - [Cyclomatic complexity](https://mehen.ophi.dev/metrics/code/cyclomatic.md): McCabe's count of linearly independent paths through a function. - [Halstead metrics](https://mehen.ophi.dev/metrics/code/halstead.md): Maurice Halstead's vocabulary-based suite — volume, difficulty, effort, bugs, and time. - [LLOC — Logical Lines of Code](https://mehen.ophi.dev/metrics/code/lloc.md): Logical lines — statements as defined by each language's grammar. - [LOC family](https://mehen.ophi.dev/metrics/code/loc.md): Lines of code measured five ways: SLOC, PLOC, LLOC, CLOC, and blank lines. - [Maintainability Index](https://mehen.ophi.dev/metrics/code/mi.md): Composite maintainability score that blends Halstead volume, cyclomatic complexity, and SLOC. - [NARGS — Number of Arguments](https://mehen.ophi.dev/metrics/code/nargs.md): Argument count per function or method, with file-level aggregates. - [NEXITS — Number of Exit Points](https://mehen.ophi.dev/metrics/code/nexits.md): Exit-point count per function or method (returns + throws + early breaks of control). - [NOM — Number of Methods](https://mehen.ophi.dev/metrics/code/nom.md): Number of functions and closures declared in a file, trait, or class. - [NPA — Number of Public Attributes](https://mehen.ophi.dev/metrics/code/npa.md): Number of public attributes declared on classes and interfaces. - [NPM — Number of Public Methods](https://mehen.ophi.dev/metrics/code/npm.md): Number of public methods declared on classes and interfaces. - [Code metrics overview](https://mehen.ophi.dev/metrics/code/overview.md): What mehen reports for source code: size, complexity, and function/class shape. - [PLOC — Physical Lines of Code](https://mehen.ophi.dev/metrics/code/ploc.md): Physical instruction lines — code lines with comments and blanks excluded. - [SLOC — Source Lines of Code](https://mehen.ophi.dev/metrics/code/sloc.md): Total physical lines of source code, including comments and blanks. - [WMC — Weighted Methods per Class](https://mehen.ophi.dev/metrics/code/wmc.md): Sum of cyclomatic complexity across all methods declared in a class or interface. - [Artifact Debt](https://mehen.ophi.dev/metrics/markdown/artifact-debt.md): Cost of unlabelled, unparsable, oversized, unexplained, or externally fragile artifacts. - [DMI — Documentation Maintainability Index](https://mehen.ophi.dev/metrics/markdown/dmi.md): Composite 0–100 score blending Markdown Halstead, MCC, MRPC, link/table/artifact debt, section balance, filler risk, and good scaffold. - [Effective Content Units (ECU)](https://mehen.ophi.dev/metrics/markdown/effective-content-units.md): Review-mass normalization across prose, code blocks, tables, diagrams, math, and HTML/MDX. - [Evidence Coverage](https://mehen.ophi.dev/metrics/markdown/evidence-coverage.md): Per-section structural support density across links, code, tables, and diagrams. - [Filler / Lazy Structure Risk](https://mehen.ophi.dev/metrics/markdown/filler-lazy-risk.md): Structural evidence for 'big but vacuous' documents — without claiming anything about how the text was written. - [Good Scaffold](https://mehen.ophi.dev/metrics/markdown/good-scaffold.md): Bonus credit for helpful technical structure: visuals, tables, code examples, navigation. - [Markdown Halstead](https://mehen.ophi.dev/metrics/markdown/halstead.md): Halstead vocabulary and volume measured over Markdown-native operators and operands. - [Link Debt](https://mehen.ophi.dev/metrics/markdown/link-debt.md): Link health and reference burden for Markdown documents. - [Markdown LOC family](https://mehen.ophi.dev/metrics/markdown/loc-family.md): Lines of Markdown by construct: physical, prose, code, tables, math, blanks, and artifacts. - [MCC — Markdown Cognitive Complexity](https://mehen.ophi.dev/metrics/markdown/mcc.md): Local reading burden caused by flow breaks, nesting, context switches, and dense artifact clusters. - [MRPC — Markdown Reading Path Complexity](https://mehen.ophi.dev/metrics/markdown/mrpc.md): Cyclomatic-complexity analogue for a Markdown document's navigation graph. - [Markdown metrics overview](https://mehen.ophi.dev/metrics/markdown/overview.md): What mehen reports for Markdown documentation: structural metrics, prose layer, and the AI-era 'filler/lazy structure' family. - [English readability ensemble](https://mehen.ophi.dev/metrics/markdown/prose/english-readability.md): Nine readability formulas reported with provenance: Flesch, FKGL, Fog, SMOG, ARI, Coleman-Liau, Dale-Chall, FORCAST, LIX/RIX. - [Inclusive Language Score](https://mehen.ophi.dev/metrics/markdown/prose/inclusive-language.md): alex / retext-equality flags for gendered defaults, ableist idioms, exclusionary tech terms, and condescending phrasing. - [Japanese script composition](https://mehen.ophi.dev/metrics/markdown/prose/japanese-script-composition.md): Tier 0 Japanese register signal: kanji, hiragana, katakana, latin, and digit ratios. - [JTF rule conformance](https://mehen.ophi.dev/metrics/markdown/prose/jtf-rules.md): Japan Translation Federation's 12 rules, mechanically checkable on Markdown blocks. - [Block-level language detection](https://mehen.ophi.dev/metrics/markdown/prose/language-detection.md): Per-Markdown-block language identification driving prose-metric dispatch. - [Lexical diversity](https://mehen.ophi.dev/metrics/markdown/prose/lexical-diversity.md): Formula-independent vocabulary richness: MATTR, hapax, lexical density, sentence/word moments. - [Prose layer overview](https://mehen.ophi.dev/metrics/markdown/prose/overview.md): Language-aware Markdown signals: readability formulas, lexical diversity, wording quality, Japanese script composition and JTF conformance. - [Tateishi RS + Jōyō grade](https://mehen.ophi.dev/metrics/markdown/prose/tateishi-and-jouyou.md): Japanese readability scores built from script composition without a morphological analyzer. - [textlint-ja subset](https://mehen.ophi.dev/metrics/markdown/prose/textlint-ja.md): Selected rules from textlint-rule-preset-ja-technical-writing applied to Japanese Markdown blocks. - [Wording quality](https://mehen.ophi.dev/metrics/markdown/prose/wording-quality.md): Style and register: passive voice, hedges, weasels, wordy phrases, adverbs, nominalizations, expletives, illusions, cliches, long sentences. - [Repository Grounding](https://mehen.ophi.dev/metrics/markdown/repository-grounding.md): How much a Markdown file connects to repository reality — files, commands, packages, APIs, configs, tests, and versioned facts. - [Review Criticality Index](https://mehen.ophi.dev/metrics/markdown/review-criticality-index.md): Should I review this document carefully? Combines per-word density with delta and changed-anchor terms. - [Section Balance](https://mehen.ophi.dev/metrics/markdown/section-balance.md): Whether a Markdown document is chunked in a maintainable way. - [Section tree](https://mehen.ophi.dev/metrics/markdown/section-tree.md): Heading-derived section structure with quality flags (skips, chunking smell, fragmentation smell). - [Table Burden + Scaffold](https://mehen.ophi.dev/metrics/markdown/table-burden.md): When tables help comprehension and when they become maintenance artifacts. - [Visual Scaffold + Net Effect](https://mehen.ophi.dev/metrics/markdown/visual-scaffold.md): How much diagrams and images help vs. hurt comprehension. - [SQL metrics — preview](https://mehen.ophi.dev/metrics/sql/overview.md): What the upcoming mehen-sql analyzer will measure: query-block structure, CTE graphs, join graphs, predicate complexity, object-touch risk, and an SQL Halstead. - [SQL metrics roadmap](https://mehen.ophi.dev/metrics/sql/roadmap.md): Implementation phases for the upcoming mehen-sql analyzer. - [Quickstart](https://mehen.ophi.dev/quickstart.md): Run your first mehen analysis, read the output, and wire mehen into a pull request workflow. - [Supported languages](https://mehen.ophi.dev/supported-languages.md): Source-code and documentation languages mehen analyzes today, plus the parser backing each one.