mehen 0.7.0 → 1.0.2

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.
Files changed (3) hide show
  1. package/README.md +37 -37
  2. package/bin/mehen.js +1 -1
  3. package/package.json +13 -13
package/README.md CHANGED
@@ -1,13 +1,14 @@
1
1
  # mehen
2
2
 
3
- Rust-powered CLI for detecting heuristic source code metrics at scale: complexity, maintainability, lines of code, and more.
3
+ Rust-powered CLI for heuristic source code and documentation metrics: complexity, maintainability,
4
+ lines of code, and Markdown documentation health.
4
5
 
5
- Designed for fast, deterministic analysis over large codebases, helping both human and AI engineers track how complexity evolves over time.
6
+ 📚 **Documentation: <https://mehen.ophi.dev>**
6
7
 
7
8
  ## Install
8
9
 
9
10
  ```bash
10
- npm install mehen
11
+ npm install -g mehen
11
12
  ```
12
13
 
13
14
  Or run without installing:
@@ -23,44 +24,43 @@ Also available on [PyPI](https://pypi.org/project/mehen/):
23
24
  uvx mehen --help
24
25
  ```
25
26
 
26
- ## Supported Languages
27
+ ## Commands
27
28
 
28
- - Python (.py)
29
- - TypeScript (.ts)
30
- - TSX (.tsx)
31
- - Rust (.rs)
32
- - Go (.go)
33
-
34
- ## Usage
29
+ ```bash
30
+ # Analyze exactly one file
31
+ mehen metrics <path>
35
32
 
36
- Analyze metrics for a directory:
33
+ # Compare metrics between two git revisions (powers the GitHub Action)
34
+ mehen diff --from <base> --to <head> --paths <path>...
37
35
 
38
- ```bash
39
- npx -y mehen -m -p src
36
+ # Rank the worst-offending files in one or more trees
37
+ mehen top-offenders <path>... --metric <metric>
40
38
  ```
41
39
 
42
- Export metrics as JSON:
40
+ Full quickstart: <https://mehen.ophi.dev/quickstart>.
43
41
 
44
- ```bash
45
- npx -y mehen -m -p src -O json -o ./metrics
46
- ```
42
+ ## What mehen computes
43
+
44
+ For source code: cyclomatic complexity, cognitive complexity, Halstead suite, Maintainability Index,
45
+ ABC, LOC family (SLOC, PLOC, LLOC, CLOC, blank), NARGS, NEXITS, NOM, NPA, NPM, WMC.
47
46
 
48
- Other supported output formats: YAML, TOML, CBOR.
47
+ For Markdown documentation: Documentation Maintainability Index (DMI), Markdown Reading Path Complexity
48
+ (MRPC), Markdown Cognitive Complexity (MCC), Markdown Halstead, Link Debt, Table Burden, Visual
49
+ Scaffold, Artifact Debt, Repository Grounding, Evidence Coverage, Filler / Lazy Structure Risk, Review
50
+ Criticality Index, plus an opt-in English / Japanese prose layer.
49
51
 
50
- ## What Mehen Computes
52
+ Full metric catalog with formulas and references: <https://mehen.ophi.dev/metrics/code/overview>.
51
53
 
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
54
+ ## Supported languages
60
55
 
61
- ## CI Integration
56
+ Python (Ruff), TypeScript / JavaScript / JSX / TSX (Oxc), PHP (Mago), Ruby (Prism), Rust
57
+ (`ra_ap_syntax`), Go (tree-sitter), C (tree-sitter), Kotlin (tree-sitter), PowerShell (tree-sitter),
58
+ and Markdown (pulldown-cmark).
62
59
 
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:
60
+ ## CI integration
61
+
62
+ `mehen` ships a GitHub Action that computes changed-file metric trends on pull requests, compares
63
+ against the base branch, and posts a summary comment:
64
64
 
65
65
  ```yaml
66
66
  permissions:
@@ -69,11 +69,10 @@ permissions:
69
69
  issues: write
70
70
 
71
71
  steps:
72
- - uses: actions/checkout@v5
72
+ - uses: actions/checkout@v6
73
73
  with:
74
74
  fetch-depth: 0
75
-
76
- - uses: ophidiarium/mehen@v1
75
+ - uses: ophi-dev/mehen@v0
77
76
  with:
78
77
  paths: src
79
78
  thresholds: |
@@ -81,7 +80,7 @@ steps:
81
80
  cognitive=4
82
81
  ```
83
82
 
84
- The action is backed by `mehen diff`, so polyglot repositories can pass multiple roots and let `mehen` pick supported languages from changed files.
83
+ Full reference: <https://mehen.ophi.dev/guides/github-action>.
85
84
 
86
85
  ## Platforms
87
86
 
@@ -100,10 +99,11 @@ Requires Node.js >= 18.
100
99
 
101
100
  ## Links
102
101
 
103
- - [GitHub](https://github.com/ophidiarium/mehen)
104
- - [Issues](https://github.com/ophidiarium/mehen/issues)
102
+ - [Documentation](https://mehen.ophi.dev)
103
+ - [GitHub](https://github.com/ophi-dev/mehen)
104
+ - [Issues](https://github.com/ophi-dev/mehen/issues)
105
105
  - [PyPI package](https://pypi.org/project/mehen/)
106
106
 
107
107
  ## License
108
108
 
109
- [MPL-2.0](https://www.mozilla.org/MPL/2.0/)
109
+ [AGPL-3.0-only](https://www.gnu.org/licenses/agpl-3.0.html)
package/bin/mehen.js CHANGED
@@ -131,7 +131,7 @@ function main() {
131
131
  } else {
132
132
  console.error(`Error: mehen binary at ${binPath} is not executable.`);
133
133
  console.error('This is likely a packaging bug — please report it at:');
134
- console.error(' https://github.com/ophidiarium/mehen/issues');
134
+ console.error(' https://github.com/ophi-dev/mehen/issues');
135
135
  console.error('');
136
136
  console.error(`Workaround: chmod +x "${binPath}"`);
137
137
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mehen",
3
- "version": "0.7.0",
3
+ "version": "1.0.2",
4
4
  "description": "Tool to compute and export code metrics",
5
5
  "keywords": [
6
6
  "metrics",
@@ -13,15 +13,15 @@
13
13
  "typescript",
14
14
  "cli"
15
15
  ],
16
- "homepage": "https://github.com/ophidiarium/mehen",
16
+ "homepage": "https://mehen.ophi.dev",
17
17
  "repository": {
18
18
  "type": "git",
19
- "url": "https://github.com/ophidiarium/mehen.git"
19
+ "url": "https://github.com/ophi-dev/mehen.git"
20
20
  },
21
21
  "bugs": {
22
- "url": "https://github.com/ophidiarium/mehen/issues"
22
+ "url": "https://github.com/ophi-dev/mehen/issues"
23
23
  },
24
- "license": "MPL-2.0",
24
+ "license": "AGPL-3.0-only",
25
25
  "author": {
26
26
  "name": "Konstantin Vyatkin",
27
27
  "email": "tino@vtkn.io"
@@ -37,14 +37,14 @@
37
37
  "node": ">=18.0.0"
38
38
  },
39
39
  "optionalDependencies": {
40
- "@mehen/linux-x64-gnu": "0.7.0",
41
- "@mehen/linux-x64-musl": "0.7.0",
42
- "@mehen/linux-arm64-gnu": "0.7.0",
43
- "@mehen/linux-arm64-musl": "0.7.0",
44
- "@mehen/darwin-x64": "0.7.0",
45
- "@mehen/darwin-arm64": "0.7.0",
46
- "@mehen/win32-x64": "0.7.0",
47
- "@mehen/win32-arm64": "0.7.0"
40
+ "@mehen/linux-x64-gnu": "1.0.2",
41
+ "@mehen/linux-x64-musl": "1.0.2",
42
+ "@mehen/linux-arm64-gnu": "1.0.2",
43
+ "@mehen/linux-arm64-musl": "1.0.2",
44
+ "@mehen/darwin-x64": "1.0.2",
45
+ "@mehen/darwin-arm64": "1.0.2",
46
+ "@mehen/win32-x64": "1.0.2",
47
+ "@mehen/win32-arm64": "1.0.2"
48
48
  },
49
49
  "publishConfig": {
50
50
  "access": "public"