fork-meter
A command-line tool that measures cyclomatic complexity by counting decision points and branching paths in source code.
Requirements
- Python
>=3.14
Installation
pip install fork-meter
Supported Languages
| Language | Grammar |
|---|---|
| Python | tree-sitter-python |
| JavaScript | tree-sitter-javascript |
| TypeScript | tree-sitter-typescript |
| Java | tree-sitter-java |
| Go | tree-sitter-go |
| Gosu | tree-sitter-gosu |
Usage
fork-meter [OPTIONS] PATHS...
PATHS may be files or directories; directories are scanned recursively.
Options
| Option | Default | Description |
|---|---|---|
--max INT |
10 |
Report functions with complexity strictly above this value |
--output NAME |
fork-meter-output |
Base name for output files (no extension) |
--output-dir DIR |
<cwd>/reports |
Directory for output files |
--format [json|html|both] |
both |
Output format |
--exclude PATTERN |
— | Glob pattern to exclude from scanning (repeatable) |
-V, --version |
Show version and exit | |
-h, --help |
Show help and exit |
Example
# Scan a project, flag anything above complexity 5, write HTML only
fork-meter src/ --max 5 --format html --exclude "**/*_test.py"
Output:
fork-meter done in 0.08s
✓ reports/fork-meter-output.html
Complexity Scale
| Range | Colour | Risk |
|---|---|---|
| 1 – 5 | 🟢 Green | Low |
| 6 – 10 | 🟡 Yellow | Moderate |
| 11 – 15 | 🟠 Orange | High |
| 16 + | 🔴 Red | Critical |
Output Formats
- HTML — self-contained interactive report with a sortable complexity table.
- JSON — machine-readable report suitable for CI integration.
Configuration
fork-meter bootstraps its log/config directory automatically. Override the location with:
export FORK_METER_CONFIG_DIR=/path/to/dir
Development
Setup
poetry install
Format and Lint
poetry run black fork_meter; poetry run pylint fork_meter
Run Tests with Coverage
poetry run pytest --cov=fork_meter tests --cov-report html
License
This project is licensed under the MIT License — see the LICENSE file for details.
Release files for fork-meter 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fork_meter-1.0.0.tar.gz | 13.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fork_meter-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.5 kB
Release files / fork_meter-1.0.0.tar.gz
| Download URL | fork_meter-1.0.0.tar.gz |
|---|---|
| Size | 13.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
565e3340903c30f77e34a6fdc31138e7c7408bf04e2083cb8ea1a9d6ba6402d2
|
|
BLAKE2b-256 checksum How to use checksums |
7b6c7e1967768f71ca27d06e372b99f842c3c233ed1430b38f3cc1c69095dceb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.0 CPython/3.14.7 Linux/6.17.0-1022-azure
|
Release files / fork_meter-1.0.0-py3-none-any.whl
| Download URL | fork_meter-1.0.0-py3-none-any.whl |
|---|---|
| Size | 16.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5cbb517f2f6bb5957c78fa7d660b70c73b8164d6aaf74258ef2aaf79d40e436b
|
|
BLAKE2b-256 checksum How to use checksums |
863ebcae33a121e9f5ba86007ce67deaf3b02c11edf26e131552de79e8d95821
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.0 CPython/3.14.7 Linux/6.17.0-1022-azure
|