energy-state-analyzer 0.12.0 → 0.13.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/CHANGELOG.md CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- last_commit_released: f21dcbf98bde0c68ffe935b91e74432e39c26977
2
+ last_commit_released: 9d5839162703674ed718d973853e3398d3e13da4
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,19 @@ 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.13.0 - 2026-09-04
15
+
16
+ ### 🚀 Features
17
+
18
+ * Add error shadowing detector (#91) ([312a9b3](https://github.com/cardamomcode/energy-state-analyzer/commit/312a9b35f0ccc4d360401bfb960b91468f396e71))
19
+
20
+ ### 🐞 Bug Fixes
21
+
22
+ * Exclude nested functions from error shadowing (#93) ([9d58391](https://github.com/cardamomcode/energy-state-analyzer/commit/9d5839162703674ed718d973853e3398d3e13da4))
23
+ * *(detector)* Honor god-class static and count exemptions (#94) ([c7b8f7d](https://github.com/cardamomcode/energy-state-analyzer/commit/c7b8f7d68900312efca917103e46dd90e234f7a0))
24
+
25
+ <strong><small>[View changes on Github](https://github.com/cardamomcode/energy-state-analyzer/compare/f21dcbf98bde0c68ffe935b91e74432e39c26977..9d5839162703674ed718d973853e3398d3e13da4)</small></strong>
26
+
14
27
  ## 0.12.0 - 2026-09-04
15
28
 
16
29
  ### 🚀 Features
package/README.md CHANGED
@@ -13,6 +13,7 @@ Real-time analysis of the active Python, F#, TypeScript, Kotlin, or C++ file, re
13
13
  - [Magic numbers](docs/detectors/magic-numbers.md), unnamed numeric literals.
14
14
  - [Magic strings](docs/detectors/magic-strings.md), unnamed string literals at decision points.
15
15
  - [Parameter explosion](docs/detectors/parameter-explosion.md), functions with too many parameters.
16
+ - [Error shadowing](docs/detectors/error-shadowing.md), error handling that overwhelms a function's happy path.
16
17
  - [Inversion opportunities](docs/detectors/inversion-opportunities.md), nested conditionals that could be guard clauses.
17
18
  - [Primitive obsession](docs/detectors/primitive-obsession.md), strings/numbers standing in for a real type.
18
19
  - [Match opportunities](docs/detectors/match-opportunities.md), if/elif chains that could be a match/switch.
@@ -64,7 +65,7 @@ for the Extension Development Host.
64
65
 
65
66
  ## Extension Settings
66
67
 
67
- Settings split into two concerns: **which detectors run and how they look** live in VS Code (editor-only toggles and colors), while **how strict each detector is** lives in a project `.esaconfig.json` shared with the CLI/CI.
68
+ Settings split into two concerns: **which detectors run and how they look** live in VS Code (editor-only toggles and colors), while **how strict each detector is** belongs in a project `.esaconfig.json` shared with the CLI/CI. An explicitly configured VS Code value can override a detail setting for the current workspace.
68
69
 
69
70
  ### Enable/disable detectors and pick colors (VS Code settings)
70
71
 
@@ -80,6 +81,7 @@ Every detector has an `enabled` toggle, plus the magic-number/string switches an
80
81
  - `energyStateAnalyzer.opaqueBoolean.enabled` (`true`)
81
82
  - `energyStateAnalyzer.logicalControlFlow.enabled` (`true`)
82
83
  - `energyStateAnalyzer.inversion.enabled` (`true`)
84
+ - `energyStateAnalyzer.errorShadowing.enabled` (`true`)
83
85
  - `energyStateAnalyzer.magicNumber.enabled` (`true`)
84
86
  - `energyStateAnalyzer.magicString.enabled` (`true`)
85
87
  - `energyStateAnalyzer.colors.highEnergy` / `.mediumEnergy` / `.lowEnergy` (`#fb8500` / `#ffb703` / `#99dd99`)
@@ -87,13 +89,14 @@ Every detector has an `enabled` toggle, plus the magic-number/string switches an
87
89
 
88
90
  ### Thresholds and allowlists (`.esaconfig.json`)
89
91
 
90
- Set thresholds, ratios, and magic-number/string allowlists in an `.esaconfig.json` file to share them between the editor and CLI/CI — see [docs/configuration.md](docs/configuration.md) for the schema, per-key defaults, and how the file layers over VS Code settings (`defaults < .esaconfig.json < host override`). Thresholds are **not** configurable in VS Code on purpose: a project decides how strict its detectors are, and that decision travels with the repo. The keys (all optional; an absent key keeps its default) include:
92
+ Set thresholds, ratios, and magic-number/string allowlists in an `.esaconfig.json` file to share them between the editor and CLI/CI — see [docs/configuration.md](docs/configuration.md) for the schema, per-key defaults, and how the file layers over VS Code settings (`defaults < .esaconfig.json < host override`). The keys (all optional; an absent key keeps its default) include:
91
93
 
92
94
  - `nesting.mediumThreshold` / `highThreshold` (`3` / `5`)
93
95
  - `cognitiveComplexity.mediumThreshold` / `highThreshold` (`15` / `25`)
94
96
  - `coherence.largeFunctionLines` (`20`), `maxLargeFunctions` (`5`), `singleDomainNameShare` (`0.7`)
95
97
  - `matchOpportunity.minBranches` (`3`)
96
98
  - `parameterCount.mediumThreshold` / `highThreshold` (`5` / `8`)
99
+ - `errorShadowing.threshold` / `highThreshold` / `minNamedNodes` (`0.5` / `0.7` / `8`)
97
100
  - `magicNumber.allowlist` (`[0, 1, -1, 2]`)
98
101
  - `magicString.minDuplicates` (`2`), `allowlist` (`["", "utf-8", "__main__"]`)
99
102