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.5.tar.gz (3.2 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.5-py3-none-win_arm64.whl (2.9 MB view details)

Uploaded Python 3Windows ARM64

mehen-0.0.5-py3-none-win_amd64.whl (3.1 MB view details)

Uploaded Python 3Windows x86-64

mehen-0.0.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.2 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

mehen-0.0.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.0 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

mehen-0.0.5-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl (3.3 MB view details)

Uploaded Python 3manylinux: glibc 2.5+ x86-64

mehen-0.0.5-py3-none-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

mehen-0.0.5-py3-none-macosx_10_12_x86_64.whl (3.1 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: mehen-0.0.5.tar.gz
  • Upload date:
  • Size: 3.2 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.5.tar.gz
Algorithm Hash digest
SHA256 5b191b669d3c30b10b0235dfba2554a82d38ad90c45732abfc45847fcd9ccb86
MD5 2beb02ee806691f9185c94043d8aaa21
BLAKE2b-256 cddb8fa3bbbafd2461b62f03164726c66a0745cbccb5a7cea429e9259217d053

See more details on using hashes here.

Provenance

The following attestation bundles were made for mehen-0.0.5.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.5-py3-none-win_arm64.whl.

File metadata

  • Download URL: mehen-0.0.5-py3-none-win_arm64.whl
  • Upload date:
  • Size: 2.9 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.5-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 c2233f3c04bbefc55458fa47ebf62991ed36430df4d80acd7699f518549969cf
MD5 d211453bcc34791288a107ff97f6a50a
BLAKE2b-256 69b61abb4a881277e0a56f91101d26a4698dcc249f19b94cf69dcae47443f029

See more details on using hashes here.

Provenance

The following attestation bundles were made for mehen-0.0.5-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.5-py3-none-win_amd64.whl.

File metadata

  • Download URL: mehen-0.0.5-py3-none-win_amd64.whl
  • Upload date:
  • Size: 3.1 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.5-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 6a8baf13b80ea7ed36820dc7dadccf3637dab8a4465be56e59a05f3fa036bf32
MD5 1e244453a1d17e06239c65315aa37061
BLAKE2b-256 6c1ee9056a5201ac80ddce23320f0da72293c9462e1e6a1d4b0ba259d84ea400

See more details on using hashes here.

Provenance

The following attestation bundles were made for mehen-0.0.5-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.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mehen-0.0.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e767bf03836ac2a20b3a453e553a40f704b3bc544f5f2c341dc4dda2e4bd66fe
MD5 4202963378c1a26d4778ea69e6013962
BLAKE2b-256 8db58aabe8f0cb63d46544dc6d9f61a7815431133eea761744d5b9368cf6d1d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for mehen-0.0.5-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.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mehen-0.0.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 df0140994e24566043afaff1a34aed5aa3b84c4f2531503b027ff224cd091b56
MD5 81be7da0557fa5bebaea0180694ff442
BLAKE2b-256 21d5201376a78ff6f68ac4f401ce58cc8fd447e6b63a8996d2e2704a742164e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for mehen-0.0.5-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.5-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for mehen-0.0.5-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f8d0f1c38848a41fd8911ee77dfa2b7182874adf88bae527ea14e623744a5033
MD5 8859f50645db6779d6f84e55bb096ce5
BLAKE2b-256 62d8df7a6d7736dbd62da9cd8b5510cd47d85f47644caf901715af969ee1624b

See more details on using hashes here.

Provenance

The following attestation bundles were made for mehen-0.0.5-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.5-py3-none-macosx_11_0_arm64.whl.

File metadata

  • Download URL: mehen-0.0.5-py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 3.0 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.5-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e30854b49a1af60954f7eaf9dc393ecd994ab6c6c1348841fd52b6fd3bb80889
MD5 ceec7cda76a0c409e5b6828b1f936bd6
BLAKE2b-256 a205273098a662531b584cad3e8a7d56109e38cdb2db54b0db360db008dc51a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for mehen-0.0.5-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.5-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for mehen-0.0.5-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 23b996b2825f9d696606d983475565a69d1a2d3d942fc0b2cd7ac7ad86221fb1
MD5 570cab91276e3d6ff76faefb141120fe
BLAKE2b-256 e69dbaf88dd01ebe3fc4e3969b30fa457335e49a9e55a8f19defd4cce4015255

See more details on using hashes here.

Provenance

The following attestation bundles were made for mehen-0.0.5-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