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.4.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.4-py3-none-win_arm64.whl (3.0 MB view details)

Uploaded Python 3Windows ARM64

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

Uploaded Python 3Windows x86-64

mehen-0.0.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

mehen-0.0.4-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.4-py3-none-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

mehen-0.0.4-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.4.tar.gz.

File metadata

  • Download URL: mehen-0.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 083cba3c7d7d173f1548e22ef08ff533d37a22abfdee86b363d97973e320c077
MD5 b29927de04e73e54c531f240edfbb48a
BLAKE2b-256 8a49105eb4869847e0f744fc1d0cf73d1c18d9c96d57d77299f783cb0c1a067b

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: mehen-0.0.4-py3-none-win_arm64.whl
  • Upload date:
  • Size: 3.0 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.4-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 4cdb72a0751890e0a15a5f168adcf324c4aea229a3dfbaff653d3425a7b039df
MD5 1f1c66ea27fd696c06c1123288f8611b
BLAKE2b-256 0b129ba885a42e18ca3aa38c48da54f64d4ecddb6e66711437905ffb4e7696e0

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: mehen-0.0.4-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.4-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 122d2b4247eaea4a1ed762287d4532911d8b26401f7696b7adb534cb7fb3d6c6
MD5 2e4a1bbdfbc2d7dbceac74d0cdb152da
BLAKE2b-256 fab31766968666df4bc5783b4814bcd21c5a9c6e77197b9f037ec93888f2f70c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mehen-0.0.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a8b8aedb3c152b3a5b9f1486a55941c5901b1dac02b8b9c88ac45c2937cf7518
MD5 2375a6e3f3aaba0d4d44ebaa4083567c
BLAKE2b-256 00c44b1f25a1e8fe41ad36f43027cdcc2d07793190c60f17ea7b7fd81644827d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mehen-0.0.4-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3fe7db14d8e87e490b859a872d9ad8d2658ae5e77b6dc3515ef5aa168b326414
MD5 6ac5c2194f613b6bddec5ef266a31c87
BLAKE2b-256 475334562384192130547ee54e2a0a2ec3ed9096913f5501e672072aa23f9d6a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: mehen-0.0.4-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.4-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8496da11dda4db99e436ce2757f7ab7b10bbb3adc6f6b1cf609cae454c20e1dc
MD5 9832bb649651864658e602285f42fb7f
BLAKE2b-256 4c88c576337baf962f77336029686a12d5bc5eddfefffac029ca30d0206ef233

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mehen-0.0.4-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 febe87240e0a0ea0d222e99b418cc78ef8e0dabefbfc27b134d8422e9f4ca055
MD5 5d0fda1bfac3e575ac5002fb04343764
BLAKE2b-256 88b6a24b1c8503dd565ca899e5f941e37b7e8a7e636687c45320d8980e11510f

See more details on using hashes here.

Provenance

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