mehen 0.0.3 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +109 -0
- package/package.json +9 -9
package/README.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# mehen
|
|
2
|
+
|
|
3
|
+
Rust-powered CLI for detecting heuristic source code metrics at scale: complexity, maintainability, lines of code, and more.
|
|
4
|
+
|
|
5
|
+
Designed for fast, deterministic analysis over large codebases, helping both human and AI engineers track how complexity evolves over time.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install mehen
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Or run without installing:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx -y mehen --help
|
|
17
|
+
bunx mehen --help
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Also available on [PyPI](https://pypi.org/project/mehen/):
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
uvx mehen --help
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Supported Languages
|
|
27
|
+
|
|
28
|
+
- Python (.py)
|
|
29
|
+
- TypeScript (.ts)
|
|
30
|
+
- TSX (.tsx)
|
|
31
|
+
- Rust (.rs)
|
|
32
|
+
- Go (.go)
|
|
33
|
+
|
|
34
|
+
## Usage
|
|
35
|
+
|
|
36
|
+
Analyze metrics for a directory:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npx -y mehen -m -p src
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Export metrics as JSON:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npx -y mehen -m -p src -O json -o ./metrics
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Other supported output formats: YAML, TOML, CBOR.
|
|
49
|
+
|
|
50
|
+
## What Mehen Computes
|
|
51
|
+
|
|
52
|
+
- **Cyclomatic complexity** -- control flow complexity
|
|
53
|
+
- **Cognitive complexity** -- human-perceived complexity with nesting
|
|
54
|
+
- **Maintainability Index** -- overall maintainability score
|
|
55
|
+
- **Halstead metrics** -- volume, difficulty, effort, bugs prediction
|
|
56
|
+
- **ABC metric** -- assignments, branches, conditionals
|
|
57
|
+
- **LOC family** -- SLOC, PLOC, LLOC, CLOC, blanks
|
|
58
|
+
- **NArgs / NOM / NExit** -- arguments, methods, exit points
|
|
59
|
+
- **NPA / NPM / WMC** -- public attributes, public methods, weighted methods per class
|
|
60
|
+
|
|
61
|
+
## CI Integration
|
|
62
|
+
|
|
63
|
+
`mehen` ships a GitHub Action that computes changed-file metric trends on pull requests, compares against the base branch, and posts a summary comment:
|
|
64
|
+
|
|
65
|
+
```yaml
|
|
66
|
+
permissions:
|
|
67
|
+
contents: read
|
|
68
|
+
pull-requests: write
|
|
69
|
+
issues: write
|
|
70
|
+
|
|
71
|
+
steps:
|
|
72
|
+
- uses: actions/checkout@v5
|
|
73
|
+
with:
|
|
74
|
+
fetch-depth: 0
|
|
75
|
+
|
|
76
|
+
- uses: ophidiarium/mehen@v1
|
|
77
|
+
with:
|
|
78
|
+
paths: src
|
|
79
|
+
thresholds: |
|
|
80
|
+
cyclomatic=5
|
|
81
|
+
cognitive=4
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The action is backed by `mehen diff`, so polyglot repositories can pass multiple roots and let `mehen` pick supported languages from changed files.
|
|
85
|
+
|
|
86
|
+
## Platforms
|
|
87
|
+
|
|
88
|
+
Native binaries are provided for:
|
|
89
|
+
|
|
90
|
+
| OS | x64 | arm64 |
|
|
91
|
+
|---|---|---|
|
|
92
|
+
| Linux (glibc) | `@mehen/linux-x64-gnu` | `@mehen/linux-arm64-gnu` |
|
|
93
|
+
| Linux (musl) | `@mehen/linux-x64-musl` | `@mehen/linux-arm64-musl` |
|
|
94
|
+
| macOS | `@mehen/darwin-x64` | `@mehen/darwin-arm64` |
|
|
95
|
+
| Windows | `@mehen/win32-x64` | `@mehen/win32-arm64` |
|
|
96
|
+
|
|
97
|
+
The correct binary is selected automatically at runtime.
|
|
98
|
+
|
|
99
|
+
Requires Node.js >= 18.
|
|
100
|
+
|
|
101
|
+
## Links
|
|
102
|
+
|
|
103
|
+
- [GitHub](https://github.com/ophidiarium/mehen)
|
|
104
|
+
- [Issues](https://github.com/ophidiarium/mehen/issues)
|
|
105
|
+
- [PyPI package](https://pypi.org/project/mehen/)
|
|
106
|
+
|
|
107
|
+
## License
|
|
108
|
+
|
|
109
|
+
[MPL-2.0](https://www.mozilla.org/MPL/2.0/)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mehen",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Tool to compute and export code metrics",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"metrics",
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
"node": ">=18.0.0"
|
|
38
38
|
},
|
|
39
39
|
"optionalDependencies": {
|
|
40
|
-
"@mehen/linux-x64-gnu": "0.0
|
|
41
|
-
"@mehen/linux-x64-musl": "0.0
|
|
42
|
-
"@mehen/linux-arm64-gnu": "0.0
|
|
43
|
-
"@mehen/linux-arm64-musl": "0.0
|
|
44
|
-
"@mehen/darwin-x64": "0.0
|
|
45
|
-
"@mehen/darwin-arm64": "0.0
|
|
46
|
-
"@mehen/win32-x64": "0.0
|
|
47
|
-
"@mehen/win32-arm64": "0.0
|
|
40
|
+
"@mehen/linux-x64-gnu": "0.1.0",
|
|
41
|
+
"@mehen/linux-x64-musl": "0.1.0",
|
|
42
|
+
"@mehen/linux-arm64-gnu": "0.1.0",
|
|
43
|
+
"@mehen/linux-arm64-musl": "0.1.0",
|
|
44
|
+
"@mehen/darwin-x64": "0.1.0",
|
|
45
|
+
"@mehen/darwin-arm64": "0.1.0",
|
|
46
|
+
"@mehen/win32-x64": "0.1.0",
|
|
47
|
+
"@mehen/win32-arm64": "0.1.0"
|
|
48
48
|
},
|
|
49
49
|
"publishConfig": {
|
|
50
50
|
"access": "public"
|