energy-state-analyzer 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/LICENSE +21 -0
- package/README.md +116 -0
- package/dist/cli.js +1 -0
- package/dist/cli.js.map +1 -0
- package/grammars/tree-sitter-fsharp.wasm +0 -0
- package/grammars/tree-sitter-python.wasm +0 -0
- package/grammars/tree-sitter-typescript.wasm +0 -0
- package/package.json +169 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "energy-state-analyzer",
|
|
3
|
+
"displayName": "Energy State Analyzer",
|
|
4
|
+
"description": "Visualize code energy states in real-time (Python, F#, TypeScript)",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"publisher": "cardamom-code",
|
|
7
|
+
"icon": "images/icon.png",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/cardamomcode/energy-state-analyzer.git"
|
|
11
|
+
},
|
|
12
|
+
"engines": {
|
|
13
|
+
"vscode": "^1.74.0"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist/cli.js",
|
|
17
|
+
"dist/cli.js.map",
|
|
18
|
+
"grammars/"
|
|
19
|
+
],
|
|
20
|
+
"categories": [
|
|
21
|
+
"Other",
|
|
22
|
+
"Linters",
|
|
23
|
+
"Visualization"
|
|
24
|
+
],
|
|
25
|
+
"keywords": [
|
|
26
|
+
"python",
|
|
27
|
+
"fsharp",
|
|
28
|
+
"typescript",
|
|
29
|
+
"code quality",
|
|
30
|
+
"cyclomatic complexity",
|
|
31
|
+
"cognitive complexity",
|
|
32
|
+
"static analysis",
|
|
33
|
+
"code smells",
|
|
34
|
+
"refactoring"
|
|
35
|
+
],
|
|
36
|
+
"activationEvents": [
|
|
37
|
+
"onLanguage:python",
|
|
38
|
+
"onLanguage:fsharp",
|
|
39
|
+
"onLanguage:typescript"
|
|
40
|
+
],
|
|
41
|
+
"main": "./dist/extension.js",
|
|
42
|
+
"bin": {
|
|
43
|
+
"energy-state-analyzer": "./dist/cli.js",
|
|
44
|
+
"energy-state-cli": "./dist/cli.js"
|
|
45
|
+
},
|
|
46
|
+
"contributes": {
|
|
47
|
+
"commands": [
|
|
48
|
+
{
|
|
49
|
+
"command": "energy-state-analyzer.analyze",
|
|
50
|
+
"title": "Analyze Energy State"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"configuration": {
|
|
54
|
+
"title": "Energy State Analyzer",
|
|
55
|
+
"properties": {
|
|
56
|
+
"energyStateAnalyzer.nesting.mediumThreshold": {
|
|
57
|
+
"type": "number",
|
|
58
|
+
"default": 3,
|
|
59
|
+
"minimum": 0,
|
|
60
|
+
"description": "Nesting depth above which control-flow blocks (if/for/while/with) are flagged as medium energy."
|
|
61
|
+
},
|
|
62
|
+
"energyStateAnalyzer.nesting.highThreshold": {
|
|
63
|
+
"type": "number",
|
|
64
|
+
"default": 5,
|
|
65
|
+
"minimum": 0,
|
|
66
|
+
"description": "Nesting depth above which control-flow blocks are flagged as high energy instead of medium."
|
|
67
|
+
},
|
|
68
|
+
"energyStateAnalyzer.cyclomaticComplexity.mediumThreshold": {
|
|
69
|
+
"type": "number",
|
|
70
|
+
"default": 10,
|
|
71
|
+
"minimum": 1,
|
|
72
|
+
"description": "Cyclomatic complexity above which a function is flagged as medium energy."
|
|
73
|
+
},
|
|
74
|
+
"energyStateAnalyzer.cyclomaticComplexity.highThreshold": {
|
|
75
|
+
"type": "number",
|
|
76
|
+
"default": 15,
|
|
77
|
+
"minimum": 1,
|
|
78
|
+
"description": "Cyclomatic complexity above which a function is flagged as high energy instead of medium."
|
|
79
|
+
},
|
|
80
|
+
"energyStateAnalyzer.cognitiveComplexity.mediumThreshold": {
|
|
81
|
+
"type": "number",
|
|
82
|
+
"default": 15,
|
|
83
|
+
"minimum": 1,
|
|
84
|
+
"description": "Cognitive complexity above which a function is flagged as medium energy."
|
|
85
|
+
},
|
|
86
|
+
"energyStateAnalyzer.cognitiveComplexity.highThreshold": {
|
|
87
|
+
"type": "number",
|
|
88
|
+
"default": 25,
|
|
89
|
+
"minimum": 1,
|
|
90
|
+
"description": "Cognitive complexity above which a function is flagged as high energy instead of medium."
|
|
91
|
+
},
|
|
92
|
+
"energyStateAnalyzer.coherence.largeFunctionLines": {
|
|
93
|
+
"type": "number",
|
|
94
|
+
"default": 20,
|
|
95
|
+
"minimum": 1,
|
|
96
|
+
"description": "Line count above which a function counts as 'large' for file coherence purposes."
|
|
97
|
+
},
|
|
98
|
+
"energyStateAnalyzer.coherence.maxLargeFunctions": {
|
|
99
|
+
"type": "number",
|
|
100
|
+
"default": 5,
|
|
101
|
+
"minimum": 1,
|
|
102
|
+
"description": "Number of large functions (see largeFunctionLines) a file can contain before it's flagged for coherence."
|
|
103
|
+
},
|
|
104
|
+
"energyStateAnalyzer.magicValues.enabled": {
|
|
105
|
+
"type": "boolean",
|
|
106
|
+
"default": true,
|
|
107
|
+
"description": "Whether to flag magic numbers and message-shaped string literals."
|
|
108
|
+
},
|
|
109
|
+
"energyStateAnalyzer.matchOpportunity.minBranches": {
|
|
110
|
+
"type": "number",
|
|
111
|
+
"default": 3,
|
|
112
|
+
"minimum": 2,
|
|
113
|
+
"description": "Number of branches (if + elif/else-if) an if/elif chain must have, all keyed on the same variable, before it's flagged as a match/switch opportunity."
|
|
114
|
+
},
|
|
115
|
+
"energyStateAnalyzer.colors.highEnergy": {
|
|
116
|
+
"type": "string",
|
|
117
|
+
"default": "#fb8500",
|
|
118
|
+
"description": "Color for high-energy violations (background tint, gutter icon, and complexity heatmap). Defaults to a deep amber so it reads as 'hot' rather than duplicating the red used for compiler/lint errors."
|
|
119
|
+
},
|
|
120
|
+
"energyStateAnalyzer.colors.mediumEnergy": {
|
|
121
|
+
"type": "string",
|
|
122
|
+
"default": "#ffb703",
|
|
123
|
+
"description": "Color for medium-energy violations (background tint and gutter icon)."
|
|
124
|
+
},
|
|
125
|
+
"energyStateAnalyzer.colors.lowEnergy": {
|
|
126
|
+
"type": "string",
|
|
127
|
+
"default": "#99dd99",
|
|
128
|
+
"description": "Color for low-energy violations (background tint and gutter icon)."
|
|
129
|
+
},
|
|
130
|
+
"energyStateAnalyzer.colors.backgroundOpacity": {
|
|
131
|
+
"type": "number",
|
|
132
|
+
"default": 0.1,
|
|
133
|
+
"minimum": 0,
|
|
134
|
+
"maximum": 1,
|
|
135
|
+
"description": "Opacity of the background tint applied behind flagged lines."
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"scripts": {
|
|
141
|
+
"vscode:prepublish": "npm run package",
|
|
142
|
+
"prepublishOnly": "npm run package",
|
|
143
|
+
"compile": "webpack",
|
|
144
|
+
"watch": "webpack --watch",
|
|
145
|
+
"package": "webpack --mode production --devtool hidden-source-map",
|
|
146
|
+
"compile-tests": "tsc -p . --outDir out",
|
|
147
|
+
"watch-tests": "tsc -p . -w --outDir out",
|
|
148
|
+
"pretest": "npm run compile-tests && npm run compile && npm run lint",
|
|
149
|
+
"lint": "eslint src",
|
|
150
|
+
"test": "node ./out/test/runTest.js",
|
|
151
|
+
"analyze": "node dist/cli.js"
|
|
152
|
+
},
|
|
153
|
+
"devDependencies": {
|
|
154
|
+
"@types/mocha": "^10.0.10",
|
|
155
|
+
"@types/node": "16.x",
|
|
156
|
+
"@types/vscode": "^1.74.0",
|
|
157
|
+
"@vscode/vsce": "^3.2.1",
|
|
158
|
+
"copy-webpack-plugin": "^13.0.0",
|
|
159
|
+
"eslint": "^8.28.0",
|
|
160
|
+
"ts-loader": "^9.4.1",
|
|
161
|
+
"typescript": "^4.9.4",
|
|
162
|
+
"typescript-eslint": "^8.67.0",
|
|
163
|
+
"webpack": "^5.75.0",
|
|
164
|
+
"webpack-cli": "^5.0.0"
|
|
165
|
+
},
|
|
166
|
+
"dependencies": {
|
|
167
|
+
"web-tree-sitter": "^0.25.8"
|
|
168
|
+
}
|
|
169
|
+
}
|