energy-state-analyzer 0.22.0 → 0.23.1
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/CHANGELOG.md +18 -1
- package/README.md +12 -6
- package/dist/cli.js +1 -1
- package/docs/architecture.md +4 -0
- package/docs/cli.md +2 -1
- package/docs/configuration.md +4 -0
- package/docs/detectors/README.md +6 -0
- package/docs/detectors/cognitive-complexity.md +2 -2
- package/docs/detectors/cyclomatic-complexity.md +1 -2
- package/docs/detectors/file-coherence.md +3 -0
- package/docs/detectors/inversion-opportunities.md +1 -1
- package/docs/detectors/magic-numbers.md +1 -1
- package/docs/detectors/magic-strings.md +3 -0
- package/docs/detectors/match-opportunities.md +1 -1
- package/docs/detectors/parameter-explosion.md +4 -3
- package/docs/detectors/parse-dont-validate.md +48 -2
- package/docs/detectors/primitive-obsession.md +2 -2
- package/grammars/tree-sitter-rust.LICENSE +21 -0
- package/grammars/tree-sitter-rust.NOTICE.md +7 -0
- package/grammars/tree-sitter-rust.wasm +0 -0
- package/package.json +11 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
last_commit_released:
|
|
2
|
+
last_commit_released: 24b4d1c3e59ea86916e22e08eef0db5faf4c0b90
|
|
3
3
|
name: energy-state-analyzer
|
|
4
4
|
updaters:
|
|
5
5
|
- command: npm version {version} --no-git-tag-version --allow-same-version
|
|
@@ -14,6 +14,23 @@ All notable changes to the "energy-state-analyzer" extension are generated by
|
|
|
14
14
|
[EasyBuild.ShipIt](https://github.com/easybuild-org/EasyBuild.ShipIt) from
|
|
15
15
|
[Conventional Commits](https://www.conventionalcommits.org/).
|
|
16
16
|
|
|
17
|
+
## 0.23.1 - 2026-10-30
|
|
18
|
+
|
|
19
|
+
### 🐞 Bug Fixes
|
|
20
|
+
|
|
21
|
+
* Exempt Rust test files and inline modules from literal findings (#192) ([24b4d1c](https://github.com/cardamomcode/energy-state-analyzer/commit/24b4d1c3e59ea86916e22e08eef0db5faf4c0b90))
|
|
22
|
+
|
|
23
|
+
<strong><small>[View changes on Github](https://github.com/cardamomcode/energy-state-analyzer/compare/30a9f7a268fc6d9809015b7bff37614cb4e8cd8b..24b4d1c3e59ea86916e22e08eef0db5faf4c0b90)</small></strong>
|
|
24
|
+
|
|
25
|
+
## 0.23.0 - 2026-10-29
|
|
26
|
+
|
|
27
|
+
### 🚀 Features
|
|
28
|
+
|
|
29
|
+
* Detect discarded validation guarantees in Erlang (#189) ([b3f4984](https://github.com/cardamomcode/energy-state-analyzer/commit/b3f49842ab42a97c8858ddee2c8cdef9e23b1228))
|
|
30
|
+
* Add Rust analysis support (#191) ([30a9f7a](https://github.com/cardamomcode/energy-state-analyzer/commit/30a9f7a268fc6d9809015b7bff37614cb4e8cd8b))
|
|
31
|
+
|
|
32
|
+
<strong><small>[View changes on Github](https://github.com/cardamomcode/energy-state-analyzer/compare/8593287df3240c290e1718a2fbc68e3b6cb15c79..30a9f7a268fc6d9809015b7bff37614cb4e8cd8b)</small></strong>
|
|
33
|
+
|
|
17
34
|
## 0.22.0 - 2026-10-27
|
|
18
35
|
|
|
19
36
|
### 🚀 Features
|
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Energy State Analyzer
|
|
2
2
|
|
|
3
|
-
Visualizes "energy states" in Python, F#, TypeScript, Kotlin, C++, C#, and
|
|
3
|
+
Visualizes "energy states" in Python, F#, TypeScript, Kotlin, C++, C#, Erlang, and Rust code as you edit: parts of a file that are complex, deeply nested, or otherwise harder to understand and maintain get highlighted with colored gutter icons, inline decorations, and entries in the Problems panel.
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
9
|
-
Real-time analysis of the active Python, F#, TypeScript, Kotlin, C++, C#, or
|
|
9
|
+
Real-time analysis of the active Python, F#, TypeScript, Kotlin, C++, C#, Erlang, or Rust file, re-run on every edit and on editor focus change, via these detectors (see [docs/detectors](docs/detectors/README.md) for full detail on each):
|
|
10
10
|
|
|
11
11
|
- [Cyclomatic complexity](docs/detectors/cyclomatic-complexity.md), too many independent execution paths.
|
|
12
12
|
- [Cognitive complexity](docs/detectors/cognitive-complexity.md), too hard to read due to nesting.
|
|
@@ -53,7 +53,7 @@ interpreting code, and what the metrics reveal.
|
|
|
53
53
|
The same detectors also run headlessly, without VS Code, useful for CI or for an AI coding agent fixing findings in code it just generated and verifying the result:
|
|
54
54
|
|
|
55
55
|
```bash
|
|
56
|
-
npx energy-state-analyzer path/to/file.py # or .fs / .fsx / .ts / .kt / .cpp / .cs
|
|
56
|
+
npx energy-state-analyzer path/to/file.py # or .fs / .fsx / .ts / .kt / .cpp / .cs / .erl / .rs
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
See [docs/cli.md](docs/cli.md) for scanning a whole repo, aggregated markdown/JSON/human reports, and diffing a PR against a base branch. See [docs/agent-integration.md](docs/agent-integration.md) for wiring the CLI into an AI coding agent's edit-and-verify loop.
|
|
@@ -74,7 +74,7 @@ for the current project, or run the command without agent flags to choose target
|
|
|
74
74
|
|
|
75
75
|
## Requirements
|
|
76
76
|
|
|
77
|
-
The extension activates automatically when you open a Python, F#, TypeScript, Kotlin, C++, C#, or
|
|
77
|
+
The extension activates automatically when you open a Python, F#, TypeScript, Kotlin, C++, C#, Erlang, or Rust file; it bundles its own grammars for parsing (via `web-tree-sitter`), so no compiler or external parser is required. F# files only get a `fsharp` language ID (and so trigger analysis) if you have an F# language extension installed (e.g. [Ionide](https://ionide.io/)), VS Code otherwise treats `.fs` files as plain text. Erlang `.erl` and `.hrl` files and Rust `.rs` files are registered by this extension. The CLI recognizes the full VS Code C++ suffix set, including compound template suffixes such as `.hpp.in`; see [Command-Line Usage](docs/cli.md#supported-file-suffixes).
|
|
78
78
|
|
|
79
79
|
## Development
|
|
80
80
|
|
|
@@ -155,6 +155,12 @@ To exclude files/folders (e.g. test fixtures, generated code) from both the exte
|
|
|
155
155
|
templates, or perform type checking. Macro-generated callable syntax is therefore invisible.
|
|
156
156
|
- Erlang analysis is syntax-only. Each named function clause is analyzed independently; a
|
|
157
157
|
multi-clause function's complexity and parameter count are reported per clause. Type-based
|
|
158
|
-
parameter checks
|
|
159
|
-
|
|
158
|
+
parameter checks are not implemented for Erlang. Parse-don't-validate recognizes local
|
|
159
|
+
`case`/`if` validators with an explicit rejecting clause, but not validation spread across
|
|
160
|
+
function clauses. Error-boundary scoring currently skips `try ... of` because its success
|
|
161
|
+
clauses need a separate work count.
|
|
162
|
+
- Rust analysis is syntax-only. It recognizes functions, closures, typed parameters, `use`
|
|
163
|
+
imports, and branch expressions, including `match`. Macro-expanded code and type resolution
|
|
164
|
+
are outside the parser. Rust `Result`/`Option` validation and error propagation do not yet
|
|
165
|
+
participate in the parse-don't-validate or error-boundary rules.
|
|
160
166
|
- Several detectors have per-language gaps beyond the above, see the "Known limitations" section of the relevant [detector doc](docs/detectors/README.md).
|