energy-state-analyzer 0.15.3 → 0.17.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/.gitattributes +2 -0
- package/.vscodeignore +1 -0
- package/CHANGELOG.md +17 -1
- package/README.md +6 -4
- package/dist/cli.js +1 -1
- package/docs/cli.md +2 -1
- package/docs/detectors/README.md +1 -0
- package/docs/detectors/parse-dont-validate.md +119 -0
- package/docs/detectors/suppression.md +1 -1
- package/grammars/tree-sitter-c-sharp.LICENSE +21 -0
- package/grammars/tree-sitter-c-sharp.NOTICE.md +7 -0
- package/grammars/tree-sitter-c-sharp.wasm +0 -0
- package/package.json +10 -3
package/.gitattributes
ADDED
package/.vscodeignore
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
last_commit_released:
|
|
2
|
+
last_commit_released: d3b62b03378b0ef2e9b31391515866e9c0a602d9
|
|
3
3
|
name: energy-state-analyzer
|
|
4
4
|
updaters:
|
|
5
5
|
- command: npm version {version} --no-git-tag-version --allow-same-version
|
|
@@ -11,6 +11,22 @@ All notable changes to the "energy-state-analyzer" extension are generated by
|
|
|
11
11
|
[EasyBuild.ShipIt](https://github.com/easybuild-org/EasyBuild.ShipIt) from
|
|
12
12
|
[Conventional Commits](https://www.conventionalcommits.org/).
|
|
13
13
|
|
|
14
|
+
## 0.17.0 - 2026-09-13
|
|
15
|
+
|
|
16
|
+
### 🚀 Features
|
|
17
|
+
|
|
18
|
+
* Detect discarded validation guarantees (#128) ([d3b62b0](https://github.com/cardamomcode/energy-state-analyzer/commit/d3b62b03378b0ef2e9b31391515866e9c0a602d9))
|
|
19
|
+
|
|
20
|
+
<strong><small>[View changes on Github](https://github.com/cardamomcode/energy-state-analyzer/compare/0da9a473c2dafc34fc94df424a3bca7015855b33..d3b62b03378b0ef2e9b31391515866e9c0a602d9)</small></strong>
|
|
21
|
+
|
|
22
|
+
## 0.16.0 - 2026-09-11
|
|
23
|
+
|
|
24
|
+
### 🚀 Features
|
|
25
|
+
|
|
26
|
+
* Add C# analysis support (#125) ([0da9a47](https://github.com/cardamomcode/energy-state-analyzer/commit/0da9a473c2dafc34fc94df424a3bca7015855b33))
|
|
27
|
+
|
|
28
|
+
<strong><small>[View changes on Github](https://github.com/cardamomcode/energy-state-analyzer/compare/98c73c11364c3abe5c7e52ffb5c2288ed7f4815d..0da9a473c2dafc34fc94df424a3bca7015855b33)</small></strong>
|
|
29
|
+
|
|
14
30
|
## 0.15.3 - 2026-09-11
|
|
15
31
|
|
|
16
32
|
### 🐞 Bug Fixes
|
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Energy State Analyzer
|
|
2
2
|
|
|
3
|
-
Visualizes "energy states" in Python, F#, TypeScript, Kotlin, and C
|
|
3
|
+
Visualizes "energy states" in Python, F#, TypeScript, Kotlin, C++, and C# 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, or C
|
|
9
|
+
Real-time analysis of the active Python, F#, TypeScript, Kotlin, C++, or C# 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.
|
|
@@ -20,6 +20,7 @@ Real-time analysis of the active Python, F#, TypeScript, Kotlin, or C++ file, re
|
|
|
20
20
|
- [Primitive obsession](docs/detectors/primitive-obsession.md), strings/numbers standing in for a real type.
|
|
21
21
|
- [Match opportunities](docs/detectors/match-opportunities.md), if/elif chains that could be a match/switch.
|
|
22
22
|
- [Logical operator as control flow](docs/detectors/logical-operator-control-flow.md), an `if` hidden behind `&&`/`||`.
|
|
23
|
+
- [Parse, don't validate](docs/detectors/parse-dont-validate.md), checks whose successful result does not preserve the domain constraint.
|
|
23
24
|
- [Opaque boolean literal](docs/detectors/opaque-boolean-literal.md), an unlabeled `true`/`false` at a call site.
|
|
24
25
|
|
|
25
26
|
Violations are shown three ways:
|
|
@@ -39,14 +40,14 @@ The name is a deliberate analogy to thermodynamics: a function's "energy" is its
|
|
|
39
40
|
The same detectors also run headlessly, without VS Code, useful for CI or for an AI coding agent that wants to check the complexity of code it just generated and keep refactoring until it's clean:
|
|
40
41
|
|
|
41
42
|
```bash
|
|
42
|
-
npx energy-state-analyzer path/to/file.py # or .fs / .fsx / .ts / .kt / .cpp / .
|
|
43
|
+
npx energy-state-analyzer path/to/file.py # or .fs / .fsx / .ts / .kt / .cpp / .cs
|
|
43
44
|
```
|
|
44
45
|
|
|
45
46
|
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.
|
|
46
47
|
|
|
47
48
|
## Requirements
|
|
48
49
|
|
|
49
|
-
The extension activates automatically when you open a Python, F#, TypeScript, Kotlin, or C
|
|
50
|
+
The extension activates automatically when you open a Python, F#, TypeScript, Kotlin, C++, or C# 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. 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).
|
|
50
51
|
|
|
51
52
|
## Development
|
|
52
53
|
|
|
@@ -80,6 +81,7 @@ Every detector has an `enabled` toggle, plus the magic-number/string switches an
|
|
|
80
81
|
- `energyStateAnalyzer.matchOpportunity.enabled` (`true`)
|
|
81
82
|
- `energyStateAnalyzer.parameterCount.enabled` (`true`)
|
|
82
83
|
- `energyStateAnalyzer.primitiveObsession.enabled` (`true`)
|
|
84
|
+
- `energyStateAnalyzer.parseDontValidate.enabled` (`true`)
|
|
83
85
|
- `energyStateAnalyzer.opaqueBoolean.enabled` (`true`)
|
|
84
86
|
- `energyStateAnalyzer.logicalControlFlow.enabled` (`true`)
|
|
85
87
|
- `energyStateAnalyzer.inversion.enabled` (`true`)
|