Skip to main content

Tool to compute and export code metrics

Project description

mehen

mehen is a Rust-powered CLI for detecting heuristic source code metrics at scale: complexity, maintainability, lines of code, and more.

It is designed for fast, deterministic analysis over large codebases, helping both human and AI engineers track how complexity evolves over time.

What is Mehen?

In Ophidiarium projects, names matter.

Mehen is a mythical ancient Egyptian serpent associated with guarding Ra. In the same spirit, mehen helps guard your codebase from slowly collapsing under complexity.

Why Teams Use Mehen

Most common usage patterns we see:

  • CI jobs that compute metrics for changed files and publish trend reports
  • Pre-PR / pre-CR hooks that provide immediate quality feedback
  • Automation workflows that enrich pull request templates with metric deltas

Current Language Support

Today mehen supports:

  • Python
  • TypeScript
  • TSX
  • Rust
  • Go

Planned next: Ruby and PHP.

What Mehen Computes

mehen provides a broad metric set, including:

  • Cyclomatic complexity
  • Cognitive complexity
  • Maintainability Index
  • Halstead metrics
  • ABC metrics
  • NArgs / NOM / NExit
  • LOC family (SLOC, PLOC, LLOC, CLOC, blanks)
  • NPA / NPM / WMC

Distribution

mehen ships native binaries through both ecosystems:

  • npm (mehen + platform packages)
  • PyPI (mehen via maturin binary packaging)

Quick Start

Run without installation

From npm ecosystem:

bunx mehen --help

From Python/uv ecosystem:

uv tool run mehen --help
# or
uvx mehen --help

Run locally from source

cargo run -- --help

Typical examples

Analyze metrics for a directory:

mehen -m -p src

Export metrics as JSON/TOML/YAML/CBOR:

mehen -m -p src -O json -o ./metrics

Reporting and Integrations

Current machine-readable outputs:

  • JSON
  • YAML
  • TOML
  • CBOR

Roadmap direction:

  • Native git integration for changed-file detection
  • Rich markdown reports for AI/human review flows
  • More polished console reporting for local developer loops

Implementation Notes

Internally, mehen is built on:

mehen continues in its own CLI-focused direction while preserving and evolving that foundation.

Development

Build and check:

cargo check
cargo build
cargo fmt --all
cargo clippy --all-targets --all-features --locked

Tests:

cargo test --all-targets --locked

Snapshot tests (insta):

cargo insta test --all-features --check --unreferenced reject --test-runner nextest --no-test-runner-fallback --disable-nextest-doctest

See mehen-book/src/developers/ for developer docs, including language and grammar updates.

Contributing

Contributions are welcome via issues and pull requests:

License

mehen is released under the Mozilla Public License v2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mehen-0.0.3.tar.gz (2.0 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

mehen-0.0.3-py3-none-win_arm64.whl (1.7 MB view details)

Uploaded Python 3Windows ARM64

mehen-0.0.3-py3-none-win_amd64.whl (1.8 MB view details)

Uploaded Python 3Windows x86-64

mehen-0.0.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

mehen-0.0.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

mehen-0.0.3-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl (2.1 MB view details)

Uploaded Python 3manylinux: glibc 2.5+ x86-64

mehen-0.0.3-py3-none-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

mehen-0.0.3-py3-none-macosx_10_12_x86_64.whl (1.9 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file mehen-0.0.3.tar.gz.

File metadata

  • Download URL: mehen-0.0.3.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mehen-0.0.3.tar.gz
Algorithm Hash digest
SHA256 4a7c08bf203bb6055136c2e262e683234a712346159eaf76bc6941070d5adb0e
MD5 2f28898c511cf86a91624cd1b27520f9
BLAKE2b-256 e60ef6f20a027d9d57778d939abe6453f071d6ff79ac66db980659d7ea79cf0f

See more details on using hashes here.

Provenance

The following attestation bundles were made for mehen-0.0.3.tar.gz:

Publisher: release.yml on ophidiarium/mehen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mehen-0.0.3-py3-none-win_arm64.whl.

File metadata

  • Download URL: mehen-0.0.3-py3-none-win_arm64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mehen-0.0.3-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 01310430820066114379d13fe8ad6004cfdccdb7e4054287293b62baa13affc4
MD5 36e6bba5b54757d260d6092d25e4424e
BLAKE2b-256 4d574361367ba88c9ee77bc284c5d8156caf2aef10cb44f8da93ab10898f4902

See more details on using hashes here.

Provenance

The following attestation bundles were made for mehen-0.0.3-py3-none-win_arm64.whl:

Publisher: release.yml on ophidiarium/mehen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mehen-0.0.3-py3-none-win_amd64.whl.

File metadata

  • Download URL: mehen-0.0.3-py3-none-win_amd64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mehen-0.0.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 45332df0da7c03be9883033c868a3194fd409cee4e5ed5ca4adefb6b40b99313
MD5 65b25723806de6cb0efde798591b48ab
BLAKE2b-256 7da8fae23e77c9812d07c6a7651e77e93faed22ce88f953ce280ffb445bde4a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for mehen-0.0.3-py3-none-win_amd64.whl:

Publisher: release.yml on ophidiarium/mehen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mehen-0.0.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mehen-0.0.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 96d32662dab2bdb0264d7fa5631772cfe03ec8277cbb3d22afd0a3d696abeb0a
MD5 bc960f1ef089f8ddc0878ecfb8a48b21
BLAKE2b-256 d630f0d27dbd72c2376d6eb91dd0c97f191f2d4b1770e4827cacb99475187c9c

See more details on using hashes here.

Provenance

The following attestation bundles were made for mehen-0.0.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on ophidiarium/mehen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mehen-0.0.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mehen-0.0.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0cd2fdbf5d0069cae1e047ec109bbc4a0529f0e8023336225cb8def142d20ea2
MD5 ae2e67db60b211d564cf586286ac9e63
BLAKE2b-256 c139ad30d27fb40504e55174e2f71aaac9e2931cec4eefbf5ee941d9ec1c509e

See more details on using hashes here.

Provenance

The following attestation bundles were made for mehen-0.0.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on ophidiarium/mehen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mehen-0.0.3-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for mehen-0.0.3-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 27c7264cad8e0e43317fae13fc852fdcfeadf3f29cbaa851e4e14503d54cba54
MD5 02bf91b784cd956b8fe21050b343bb94
BLAKE2b-256 4cf0e4408647d04596a447848677e59b09d374e443646f77dcc68aaa46f06a56

See more details on using hashes here.

Provenance

The following attestation bundles were made for mehen-0.0.3-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl:

Publisher: release.yml on ophidiarium/mehen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mehen-0.0.3-py3-none-macosx_11_0_arm64.whl.

File metadata

  • Download URL: mehen-0.0.3-py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: Python 3, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mehen-0.0.3-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e775a4e8470e388debe70ca049a17f9066d996698c53969b0171b740d36599c3
MD5 456a64272d2378da8929e1328ec0c52f
BLAKE2b-256 069df8ed2d4cb914db22ad77391cca24b9964b6463c63cce0c3f226025566aae

See more details on using hashes here.

Provenance

The following attestation bundles were made for mehen-0.0.3-py3-none-macosx_11_0_arm64.whl:

Publisher: release.yml on ophidiarium/mehen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mehen-0.0.3-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for mehen-0.0.3-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 57fc6679a000bd2337f9b9bdeb603a5f77665e200c5a85ab9d677a5a81310100
MD5 b8caf1e9dd03da8c8ce5fde24b6bdbb2
BLAKE2b-256 d3c886b25c3b8a0145e6d9c4b1023ec2264a2947ed754266f4c3a78e9396cdf3

See more details on using hashes here.

Provenance

The following attestation bundles were made for mehen-0.0.3-py3-none-macosx_10_12_x86_64.whl:

Publisher: release.yml on ophidiarium/mehen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page