Skip to main content

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.

mehen supports nine source languages and Markdown. Per-file language detection is by extension, and the matching analyzer crate owns parsing and metric interpretation. Each language uses the parser that gives mehen the best semantic coverage for that ecosystem.

Source languages

LanguageExtensionsParser
Python.pyRuff (ruff_python_parser + ruff_python_ast)
TypeScript / JavaScript.ts, .mts, .cts, .js, .mjs, .cjsOxc (oxc_parser)
TSX / JSX.tsx, .jsxOxc (oxc_parser)
PHP.phpMago (mago-syntax)
Ruby.rbPrism (ruby-prism)
Rust.rsra_ap_syntax (rust-analyzer’s syntax library)
Go.gotree-sitter-go
Kotlin.kt, .ktstree-sitter-kotlin-sg
C.c, .htree-sitter-c
PowerShell.ps1, .psm1, .psd1tree-sitter-pwsh
TypeScript is a superset of JavaScript, so mehen analyzes .js / .mjs / .cjs through the Oxc TypeScript front-end and .jsx through Oxc’s TSX front-end.

Why these parsers

  • Ruff parses Python with full support for current syntax (3.13/3.14 features, f-strings, match/case, exception groups, async constructs) and exposes a typed AST plus a semantic model.
  • Oxc is a JavaScript/TypeScript toolchain in Rust and one of the fastest TS parsers in production. It handles decorators, class fields, parameter properties, JSX, satisfies, using, and dynamic import natively.
  • Mago is a PHP toolchain in Rust. It understands attributes, promoted properties, enums, traits, anonymous classes, readonly members, null-safe calls, and match expressions out of the box.
  • Prism is the official Ruby parser maintained by the Ruby core team. It covers blocks, lambdas, numbered parameters, modifier conditionals, rescue modifiers, endless methods, pattern matching, and safe navigation.
  • ra_ap_syntax is the syntax tree library used by rust-analyzer; it gives mehen exactly the syntactic granularity rust-analyzer uses for its own analyses.
  • Tree-sitter is mehen’s pick for Go, Kotlin, C, and PowerShell, where its grammar quality and ecosystem maturity make it the best fit.

Documentation

FormatExtensionsParser
Markdown.md, .markdown, .mdown, .mkd, .mkdn, .mdxpulldown-cmark
Markdown gets a dedicated documentation metric suite — code-style metrics like cyclomatic complexity and NOM/NPA/NPM/WMC do not apply because Markdown has no functions or classes. See Markdown metrics for the full set.

SQL (preview)

A dedicated SQL analyzer (mehen-sql) is on the roadmap with its own metric family — query-block structure, CTE graphs, join graphs, predicate complexity, object-touch risk, dialect portability, and an SQL-flavored Halstead. See SQL metrics overview for the design.

Polyglot monorepos

mehen runs per-file language detection over any directory tree. Pass multiple paths to limit which trees are walked and let mehen pick supported languages from each:
mehen top-offenders crates/api/src apps/web/src tools --metric cognitive
The GitHub Action accepts the same multi-path input.