Skip to main content

Tool to compute and export code metrics

Project description

mehen

mehen is a Rust library to analyze and extract information from source code written in many different programming languages. It is based on a parser generator tool and an incremental parsing library called Tree Sitter.

A command line tool called mehen is provided to interact with the API of the library.

This tool can be used to:

  • Print nodes and metrics information
  • Export metrics in different formats
  • Analyze code complexity and maintainability

Usage

mehen computes a variety of software metrics for Go, Python, Rust, and TypeScript/TSX code.

Run mehen --help to see all available commands and options.

Building

To build the mehen library, you need to run the following command:

cargo build

If you want to build the cli:

cargo build -p mehen-cli

To build everything:

cargo build --workspace

Testing

To verify whether all tests pass, run the cargo test command.

cargo test --workspace --all-features --verbose

Updating insta tests

We use insta, to update the snapshot tests you should install cargo insta

cargo insta test --review

Will run the tests, generate the new snapshot references and let you review them.

Updating grammars

See mehen-book/src/developers/update-grammars.md to learn how to update language grammars.

Contributing

If you want to contribute to the development of this software, please open an issue or pull request on our GitHub repository. See mehen-book/src/developers/ for developer documentation.

License

mehen and mehen-cli (binary: mehen) are released under the Mozilla Public License v2.0.

Credits

Mehen is based on the excellent rust-code-analysis project by Mozilla. While mehen has taken a different direction by focusing on a streamlined set of languages (Go, Python, Rust, and TypeScript/TSX), the core architecture and metric implementations are built upon that foundation.

If you use this software in academic work, please cite the original rust-code-analysis paper:

@article{ARDITO2020100635,
    title = {rust-code-analysis: A Rust library to analyze and extract maintainability information from source codes},
    journal = {SoftwareX},
    volume = {12},
    pages = {100635},
    year = {2020},
    issn = {2352-7110},
    doi = {https://doi.org/10.1016/j.softx.2020.100635},
    url = {https://www.sciencedirect.com/science/article/pii/S2352711020303484},
    author = {Luca Ardito and Luca Barbato and Marco Castelluccio and Riccardo Coppola and Calixte Denizet and Sylvestre Ledru and Michele Valsesia},
    keywords = {Algorithm, Software metrics, Software maintainability, Software quality}
}

We thank the Mozilla team and all contributors to rust-code-analysis for their foundational work.

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

Uploaded Python 3Windows ARM64

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

Uploaded Python 3Windows x86-64

mehen-0.0.2-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.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.8 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

mehen-0.0.2-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl (2.0 MB view details)

Uploaded Python 3manylinux: glibc 2.5+ x86-64

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

Uploaded Python 3macOS 11.0+ ARM64

mehen-0.0.2-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.2.tar.gz.

File metadata

  • Download URL: mehen-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 4b9c2f0f2e6882e157566050c4c9ef5946953e2bd4826bf9a831f65a3eb93fa6
MD5 d9b14dfe8c1cdf06254593ffb85fece4
BLAKE2b-256 c188db4cf3f308680815016fb2b915191eb81d8721ff164ef1d5438bb2c8d81c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: mehen-0.0.2-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.2-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 9256bff91df2fc76edfe4b14e616e89ed635018ea0d8d87cab82d9d7516d9667
MD5 d8847ad78f8075724ac30fcf04085e70
BLAKE2b-256 86ac5c187ea24f510503856746a9b8b3dac0bc9c1bcca744b59f5625d1fcbad9

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: mehen-0.0.2-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.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 de2a5a8c37c0ac239107ffae89a51f5bbb6ba367f3b5869fe408f63163f8b44f
MD5 733979f5cc4f8e4ca258a2ff0e9b5ee3
BLAKE2b-256 717d242f98ecd6f9188a4c24e10da637a89361bfd253747e03df2f39ddee501b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mehen-0.0.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ecb3397ae770b1d9bbcd76d786ef8023dc9b767c58a7f7db1f0083d701120334
MD5 77c8b009b255e386a87c696a0b887b63
BLAKE2b-256 7f4d08cbdaddeb68dacfd8fcc0d89388bdcc70bede433bcf719bb9b605726f5e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mehen-0.0.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9c02b6ad01322a5505e3f35a3cd0eff2cab273a0d32e51c6330abcccfb16f4d8
MD5 9b32074aa9865608868435c85fafceb3
BLAKE2b-256 480c67cdf3316d4dc9fbb584a97f0fd44b92e794fe1c50ef1abf251d7e9829fb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mehen-0.0.2-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 8ee63d65df8673ec425d80f257080df1778818e435abab82e73bea51c07f0ff6
MD5 d802c0a837ff745f129c1076af7b4a25
BLAKE2b-256 974ea59536d8a8e74cb90577eaf4ec4ee9a94fa51f0228d289c0aa5d17b255bb

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: mehen-0.0.2-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.2-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 273c99e9d2b57dcf7ab3ee49de0dbb9cd22a4b4ef37dd533096ae13b94650408
MD5 1fd38e1299180b4189e635b37a77fff5
BLAKE2b-256 30ecdfe7fb1e67988b94d84d7a9e3a885aaf29f6224bfce4572d84dcf225d4f9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mehen-0.0.2-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8dd4bc05ef04c3dec8c48b369a5ac385599afcfc64dcec08325319c2b8fe7439
MD5 e865858d5550357a3071b45afcb02e43
BLAKE2b-256 24d2b771b0fdad44ff429e7c8794b0d31699ab5b70a63f843c045b19de313ff0

See more details on using hashes here.

Provenance

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