@sfdxy/mule-lint 1.15.1 → 1.16.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/README.md +126 -4
- package/dist/bin/mule-lint.js +39 -3
- package/dist/bin/mule-lint.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/core/MetricsAggregator.d.ts +59 -0
- package/dist/src/core/MetricsAggregator.d.ts.map +1 -0
- package/dist/src/core/MetricsAggregator.js +159 -0
- package/dist/src/core/MetricsAggregator.js.map +1 -0
- package/dist/src/core/QualityGateEvaluator.d.ts +15 -0
- package/dist/src/core/QualityGateEvaluator.d.ts.map +1 -0
- package/dist/src/core/QualityGateEvaluator.js +134 -0
- package/dist/src/core/QualityGateEvaluator.js.map +1 -0
- package/dist/src/core/index.d.ts +2 -0
- package/dist/src/core/index.d.ts.map +1 -1
- package/dist/src/core/index.js +2 -0
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/engine/LintEngine.d.ts.map +1 -1
- package/dist/src/engine/LintEngine.js +9 -1
- package/dist/src/engine/LintEngine.js.map +1 -1
- package/dist/src/formatters/HtmlFormatter.d.ts +7 -1
- package/dist/src/formatters/HtmlFormatter.d.ts.map +1 -1
- package/dist/src/formatters/HtmlFormatter.js +62 -1179
- package/dist/src/formatters/HtmlFormatter.js.map +1 -1
- package/dist/src/formatters/html/components/Icons.d.ts +18 -0
- package/dist/src/formatters/html/components/Icons.d.ts.map +1 -0
- package/dist/src/formatters/html/components/Icons.js +23 -0
- package/dist/src/formatters/html/components/Icons.js.map +1 -0
- package/dist/src/formatters/html/components/MetricCard.d.ts +15 -0
- package/dist/src/formatters/html/components/MetricCard.d.ts.map +1 -0
- package/dist/src/formatters/html/components/MetricCard.js +21 -0
- package/dist/src/formatters/html/components/MetricCard.js.map +1 -0
- package/dist/src/formatters/html/components/Modal.d.ts +12 -0
- package/dist/src/formatters/html/components/Modal.d.ts.map +1 -0
- package/dist/src/formatters/html/components/Modal.js +175 -0
- package/dist/src/formatters/html/components/Modal.js.map +1 -0
- package/dist/src/formatters/html/components/RatingBadge.d.ts +48 -0
- package/dist/src/formatters/html/components/RatingBadge.d.ts.map +1 -0
- package/dist/src/formatters/html/components/RatingBadge.js +72 -0
- package/dist/src/formatters/html/components/RatingBadge.js.map +1 -0
- package/dist/src/formatters/html/components/SidePanel.d.ts +7 -0
- package/dist/src/formatters/html/components/SidePanel.d.ts.map +1 -0
- package/dist/src/formatters/html/components/SidePanel.js +37 -0
- package/dist/src/formatters/html/components/SidePanel.js.map +1 -0
- package/dist/src/formatters/html/components/index.d.ts +9 -0
- package/dist/src/formatters/html/components/index.d.ts.map +1 -0
- package/dist/src/formatters/html/components/index.js +20 -0
- package/dist/src/formatters/html/components/index.js.map +1 -0
- package/dist/src/formatters/html/index.d.ts +23 -0
- package/dist/src/formatters/html/index.d.ts.map +1 -0
- package/dist/src/formatters/html/index.js +59 -0
- package/dist/src/formatters/html/index.js.map +1 -0
- package/dist/src/formatters/html/scripts/charts.d.ts +85 -0
- package/dist/src/formatters/html/scripts/charts.d.ts.map +1 -0
- package/dist/src/formatters/html/scripts/charts.js +107 -0
- package/dist/src/formatters/html/scripts/charts.js.map +1 -0
- package/dist/src/formatters/html/scripts/index.d.ts +8 -0
- package/dist/src/formatters/html/scripts/index.d.ts.map +1 -0
- package/dist/src/formatters/html/scripts/index.js +28 -0
- package/dist/src/formatters/html/scripts/index.js.map +1 -0
- package/dist/src/formatters/html/scripts/init.d.ts +6 -0
- package/dist/src/formatters/html/scripts/init.d.ts.map +1 -0
- package/dist/src/formatters/html/scripts/init.js +16 -0
- package/dist/src/formatters/html/scripts/init.js.map +1 -0
- package/dist/src/formatters/html/scripts/renderer.d.ts +40 -0
- package/dist/src/formatters/html/scripts/renderer.d.ts.map +1 -0
- package/dist/src/formatters/html/scripts/renderer.js +606 -0
- package/dist/src/formatters/html/scripts/renderer.js.map +1 -0
- package/dist/src/formatters/html/scripts/router.d.ts +10 -0
- package/dist/src/formatters/html/scripts/router.d.ts.map +1 -0
- package/dist/src/formatters/html/scripts/router.js +137 -0
- package/dist/src/formatters/html/scripts/router.js.map +1 -0
- package/dist/src/formatters/html/sections/Header.d.ts +11 -0
- package/dist/src/formatters/html/sections/Header.d.ts.map +1 -0
- package/dist/src/formatters/html/sections/Header.js +71 -0
- package/dist/src/formatters/html/sections/Header.js.map +1 -0
- package/dist/src/formatters/html/sections/LintSummary.d.ts +12 -0
- package/dist/src/formatters/html/sections/LintSummary.d.ts.map +1 -0
- package/dist/src/formatters/html/sections/LintSummary.js +63 -0
- package/dist/src/formatters/html/sections/LintSummary.js.map +1 -0
- package/dist/src/formatters/html/sections/QualityRatings.d.ts +7 -0
- package/dist/src/formatters/html/sections/QualityRatings.d.ts.map +1 -0
- package/dist/src/formatters/html/sections/QualityRatings.js +81 -0
- package/dist/src/formatters/html/sections/QualityRatings.js.map +1 -0
- package/dist/src/formatters/html/sections/Sidebar.d.ts +9 -0
- package/dist/src/formatters/html/sections/Sidebar.d.ts.map +1 -0
- package/dist/src/formatters/html/sections/Sidebar.js +53 -0
- package/dist/src/formatters/html/sections/Sidebar.js.map +1 -0
- package/dist/src/formatters/html/sections/index.d.ts +8 -0
- package/dist/src/formatters/html/sections/index.d.ts.map +1 -0
- package/dist/src/formatters/html/sections/index.js +15 -0
- package/dist/src/formatters/html/sections/index.js.map +1 -0
- package/dist/src/formatters/html/styles/badges.d.ts +49 -0
- package/dist/src/formatters/html/styles/badges.d.ts.map +1 -0
- package/dist/src/formatters/html/styles/badges.js +98 -0
- package/dist/src/formatters/html/styles/badges.js.map +1 -0
- package/dist/src/formatters/html/styles/base.css.d.ts +6 -0
- package/dist/src/formatters/html/styles/base.css.d.ts.map +1 -0
- package/dist/src/formatters/html/styles/base.css.js +39 -0
- package/dist/src/formatters/html/styles/base.css.js.map +1 -0
- package/dist/src/formatters/html/styles/components.css.d.ts +6 -0
- package/dist/src/formatters/html/styles/components.css.d.ts.map +1 -0
- package/dist/src/formatters/html/styles/components.css.js +246 -0
- package/dist/src/formatters/html/styles/components.css.js.map +1 -0
- package/dist/src/formatters/html/styles/index.d.ts +9 -0
- package/dist/src/formatters/html/styles/index.d.ts.map +1 -0
- package/dist/src/formatters/html/styles/index.js +21 -0
- package/dist/src/formatters/html/styles/index.js.map +1 -0
- package/dist/src/formatters/html/styles/tabulator.css.d.ts +6 -0
- package/dist/src/formatters/html/styles/tabulator.css.d.ts.map +1 -0
- package/dist/src/formatters/html/styles/tabulator.css.js +88 -0
- package/dist/src/formatters/html/styles/tabulator.css.js.map +1 -0
- package/dist/src/formatters/html/theme.d.ts +7 -0
- package/dist/src/formatters/html/theme.d.ts.map +1 -0
- package/dist/src/formatters/html/theme.js +93 -0
- package/dist/src/formatters/html/theme.js.map +1 -0
- package/dist/src/formatters/html/views/Dashboard.d.ts +9 -0
- package/dist/src/formatters/html/views/Dashboard.d.ts.map +1 -0
- package/dist/src/formatters/html/views/Dashboard.js +179 -0
- package/dist/src/formatters/html/views/Dashboard.js.map +1 -0
- package/dist/src/formatters/html/views/IssuesView.d.ts +9 -0
- package/dist/src/formatters/html/views/IssuesView.d.ts.map +1 -0
- package/dist/src/formatters/html/views/IssuesView.js +32 -0
- package/dist/src/formatters/html/views/IssuesView.js.map +1 -0
- package/dist/src/formatters/html/views/index.d.ts +7 -0
- package/dist/src/formatters/html/views/index.d.ts.map +1 -0
- package/dist/src/formatters/html/views/index.js +12 -0
- package/dist/src/formatters/html/views/index.js.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/mcp/index.d.ts.map +1 -1
- package/dist/src/mcp/index.js +24 -10
- package/dist/src/mcp/index.js.map +1 -1
- package/dist/src/quality/calculator.d.ts +45 -0
- package/dist/src/quality/calculator.d.ts.map +1 -0
- package/dist/src/quality/calculator.js +134 -0
- package/dist/src/quality/calculator.js.map +1 -0
- package/dist/src/quality/index.d.ts +13 -0
- package/dist/src/quality/index.d.ts.map +1 -0
- package/dist/src/quality/index.js +29 -0
- package/dist/src/quality/index.js.map +1 -0
- package/dist/src/quality/thresholds.d.ts +19 -0
- package/dist/src/quality/thresholds.d.ts.map +1 -0
- package/dist/src/quality/thresholds.js +176 -0
- package/dist/src/quality/thresholds.js.map +1 -0
- package/dist/src/quality/types.d.ts +65 -0
- package/dist/src/quality/types.d.ts.map +1 -0
- package/dist/src/quality/types.js +7 -0
- package/dist/src/quality/types.js.map +1 -0
- package/dist/src/rules/base/BaseRule.d.ts +3 -1
- package/dist/src/rules/base/BaseRule.d.ts.map +1 -1
- package/dist/src/rules/base/BaseRule.js +2 -0
- package/dist/src/rules/base/BaseRule.js.map +1 -1
- package/dist/src/rules/error-handling/CorrelationIdRule.d.ts +2 -1
- package/dist/src/rules/error-handling/CorrelationIdRule.d.ts.map +1 -1
- package/dist/src/rules/error-handling/CorrelationIdRule.js +1 -0
- package/dist/src/rules/error-handling/CorrelationIdRule.js.map +1 -1
- package/dist/src/rules/error-handling/GenericErrorRule.d.ts +2 -1
- package/dist/src/rules/error-handling/GenericErrorRule.d.ts.map +1 -1
- package/dist/src/rules/error-handling/GenericErrorRule.js +1 -0
- package/dist/src/rules/error-handling/GenericErrorRule.js.map +1 -1
- package/dist/src/rules/error-handling/GlobalErrorHandlerRule.d.ts +2 -1
- package/dist/src/rules/error-handling/GlobalErrorHandlerRule.d.ts.map +1 -1
- package/dist/src/rules/error-handling/GlobalErrorHandlerRule.js +1 -0
- package/dist/src/rules/error-handling/GlobalErrorHandlerRule.js.map +1 -1
- package/dist/src/rules/error-handling/HttpStatusRule.d.ts +2 -1
- package/dist/src/rules/error-handling/HttpStatusRule.d.ts.map +1 -1
- package/dist/src/rules/error-handling/HttpStatusRule.js +1 -0
- package/dist/src/rules/error-handling/HttpStatusRule.js.map +1 -1
- package/dist/src/rules/error-handling/MissingErrorHandlerRule.d.ts +2 -1
- package/dist/src/rules/error-handling/MissingErrorHandlerRule.d.ts.map +1 -1
- package/dist/src/rules/error-handling/MissingErrorHandlerRule.js +1 -0
- package/dist/src/rules/error-handling/MissingErrorHandlerRule.js.map +1 -1
- package/dist/src/rules/error-handling/TryScopeRule.d.ts +2 -1
- package/dist/src/rules/error-handling/TryScopeRule.d.ts.map +1 -1
- package/dist/src/rules/error-handling/TryScopeRule.js +1 -0
- package/dist/src/rules/error-handling/TryScopeRule.js.map +1 -1
- package/dist/src/rules/security/HardcodedCredentialsRule.d.ts +2 -1
- package/dist/src/rules/security/HardcodedCredentialsRule.d.ts.map +1 -1
- package/dist/src/rules/security/HardcodedCredentialsRule.js +1 -0
- package/dist/src/rules/security/HardcodedCredentialsRule.js.map +1 -1
- package/dist/src/rules/security/HardcodedHttpRule.d.ts +2 -1
- package/dist/src/rules/security/HardcodedHttpRule.d.ts.map +1 -1
- package/dist/src/rules/security/HardcodedHttpRule.js +1 -0
- package/dist/src/rules/security/HardcodedHttpRule.js.map +1 -1
- package/dist/src/rules/security/InputValidationRule.d.ts +2 -1
- package/dist/src/rules/security/InputValidationRule.d.ts.map +1 -1
- package/dist/src/rules/security/InputValidationRule.js +1 -0
- package/dist/src/rules/security/InputValidationRule.js.map +1 -1
- package/dist/src/rules/security/InsecureTlsRule.d.ts +2 -1
- package/dist/src/rules/security/InsecureTlsRule.d.ts.map +1 -1
- package/dist/src/rules/security/InsecureTlsRule.js +1 -0
- package/dist/src/rules/security/InsecureTlsRule.js.map +1 -1
- package/dist/src/rules/security/RateLimitingRule.d.ts +2 -1
- package/dist/src/rules/security/RateLimitingRule.d.ts.map +1 -1
- package/dist/src/rules/security/RateLimitingRule.js +1 -0
- package/dist/src/rules/security/RateLimitingRule.js.map +1 -1
- package/dist/src/rules/security/TlsVersionRule.d.ts +2 -1
- package/dist/src/rules/security/TlsVersionRule.d.ts.map +1 -1
- package/dist/src/rules/security/TlsVersionRule.js +1 -0
- package/dist/src/rules/security/TlsVersionRule.js.map +1 -1
- package/dist/src/rules/yaml/YamlRules.d.ts +2 -1
- package/dist/src/rules/yaml/YamlRules.d.ts.map +1 -1
- package/dist/src/rules/yaml/YamlRules.js +1 -0
- package/dist/src/rules/yaml/YamlRules.js.map +1 -1
- package/dist/src/types/Config.d.ts +3 -0
- package/dist/src/types/Config.d.ts.map +1 -1
- package/dist/src/types/Config.js.map +1 -1
- package/dist/src/types/QualityGate.d.ts +73 -0
- package/dist/src/types/QualityGate.d.ts.map +1 -0
- package/dist/src/types/QualityGate.js +32 -0
- package/dist/src/types/QualityGate.js.map +1 -0
- package/dist/src/types/Report.d.ts +57 -0
- package/dist/src/types/Report.d.ts.map +1 -1
- package/dist/src/types/Rule.d.ts +9 -0
- package/dist/src/types/Rule.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +1 -0
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/index.js +1 -0
- package/dist/src/types/index.js.map +1 -1
- package/docs/linter/architecture.md +26 -7
- package/docs/linter/rule-engine.md +9 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -125,9 +125,132 @@ npx @sfdxy/mule-lint ./src/main/mule --fail-on-warning
|
|
|
125
125
|
| `-c, --config <file>` | Path to configuration file |
|
|
126
126
|
| `-q, --quiet` | Show only errors (suppress warnings and info) |
|
|
127
127
|
| `-e, --experimental` | **Enable experimental rules (opt-in)** |
|
|
128
|
+
| `-g, --quality-gate <name>` | Apply quality gate: `default`, `strict`, or `config` |
|
|
128
129
|
| `--fail-on-warning` | Exit with error code if warnings found |
|
|
129
130
|
| `-v, --verbose` | Show verbose output |
|
|
130
131
|
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Quality Gates
|
|
135
|
+
|
|
136
|
+
Quality gates provide pass/fail thresholds for your CI/CD pipelines. When a gate fails, the tool exits with code 1.
|
|
137
|
+
|
|
138
|
+
### Built-in Gates
|
|
139
|
+
|
|
140
|
+
| Gate | Description |
|
|
141
|
+
|------|-------------|
|
|
142
|
+
| `default` | Fails if errors > 0, warnings > 10, complexity > 20, or security hotspots > 0 |
|
|
143
|
+
| `strict` | Fails if any errors, warnings > 0, or complexity > 10 |
|
|
144
|
+
|
|
145
|
+
### Usage
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
# Apply default quality gate
|
|
149
|
+
npx @sfdxy/mule-lint ./src/main/mule -g default
|
|
150
|
+
|
|
151
|
+
# Apply strict quality gate
|
|
152
|
+
npx @sfdxy/mule-lint ./src/main/mule -g strict
|
|
153
|
+
|
|
154
|
+
# Use custom gate from config
|
|
155
|
+
npx @sfdxy/mule-lint ./src/main/mule -g config -c .mulelintrc.json
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Custom Gate Configuration
|
|
159
|
+
|
|
160
|
+
Add to your `.mulelintrc.json`:
|
|
161
|
+
|
|
162
|
+
```json
|
|
163
|
+
{
|
|
164
|
+
"qualityGate": {
|
|
165
|
+
"name": "Custom Gate",
|
|
166
|
+
"conditions": [
|
|
167
|
+
{ "metric": "errors", "operator": ">", "threshold": 0, "status": "fail" },
|
|
168
|
+
{ "metric": "warnings", "operator": ">", "threshold": 5, "status": "warn" },
|
|
169
|
+
{ "metric": "complexity_max", "operator": ">", "threshold": 15, "status": "fail" }
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Quality Ratings (A-E)
|
|
176
|
+
|
|
177
|
+
The HTML report displays quality ratings for four key dimensions. These follow industry-standard methodologies adapted for MuleSoft:
|
|
178
|
+
|
|
179
|
+
#### Complexity Rating
|
|
180
|
+
|
|
181
|
+
**What it measures:** Average cyclomatic complexity across all flows.
|
|
182
|
+
|
|
183
|
+
**Calculation:**
|
|
184
|
+
- Count decision points per flow: `choice/when`, `foreach`, `try`, `scatter-gather`, `async`, `until-successful`, `error-handlers`
|
|
185
|
+
- Base complexity = 1 + (total decision points)
|
|
186
|
+
- **Rating = Average of all flow complexities**
|
|
187
|
+
|
|
188
|
+
| Rating | Threshold | Interpretation |
|
|
189
|
+
|--------|-----------|----------------|
|
|
190
|
+
| **A** | Avg ≤ 5 | Simple, easy to test |
|
|
191
|
+
| **B** | Avg ≤ 10 | Moderate complexity |
|
|
192
|
+
| **C** | Avg ≤ 15 | Complex, consider splitting |
|
|
193
|
+
| **D** | Avg ≤ 20 | High complexity, refactor recommended |
|
|
194
|
+
| **E** | Avg > 20 | Very complex, critical refactoring needed |
|
|
195
|
+
|
|
196
|
+
#### Maintainability Rating
|
|
197
|
+
|
|
198
|
+
**What it measures:** Technical debt as a percentage of estimated development time.
|
|
199
|
+
|
|
200
|
+
**Calculation:**
|
|
201
|
+
- Debt minutes = (code smells × 5min) + (bugs × 15min) + (vulnerabilities × 30min)
|
|
202
|
+
- Development estimate = (flows × 10min) + (subflows × 5min), minimum 60min
|
|
203
|
+
- **Debt Ratio = (Debt minutes / Development estimate) × 100%**
|
|
204
|
+
|
|
205
|
+
| Rating | Debt Ratio | Interpretation |
|
|
206
|
+
|--------|-----------|----------------|
|
|
207
|
+
| **A** | ≤ 5% | Excellent maintainability |
|
|
208
|
+
| **B** | ≤ 10% | Good maintainability |
|
|
209
|
+
| **C** | ≤ 20% | Moderate technical debt |
|
|
210
|
+
| **D** | ≤ 50% | High debt, plan remediation |
|
|
211
|
+
| **E** | > 50% | Critical debt, immediate action needed |
|
|
212
|
+
|
|
213
|
+
#### Reliability Rating
|
|
214
|
+
|
|
215
|
+
**What it measures:** Number of bug-type issues detected.
|
|
216
|
+
|
|
217
|
+
**Bug-type rules:** All `error-handling` category rules are classified as bugs, including:
|
|
218
|
+
- Missing error handlers (MULE-003)
|
|
219
|
+
- Missing correlation ID (MULE-007)
|
|
220
|
+
- Generic error handling (MULE-009)
|
|
221
|
+
- HTTP status in error handlers (MULE-005)
|
|
222
|
+
- Global error handler (MULE-001)
|
|
223
|
+
- Try scope usage (ERR-001)
|
|
224
|
+
|
|
225
|
+
| Rating | Bug Count | Interpretation |
|
|
226
|
+
|--------|-----------|----------------|
|
|
227
|
+
| **A** | 0 bugs | No reliability issues |
|
|
228
|
+
| **B** | 1-2 bugs | Minor reliability concerns |
|
|
229
|
+
| **C** | 3-5 bugs | Moderate reliability risk |
|
|
230
|
+
| **D** | 6-10 bugs | High reliability risk |
|
|
231
|
+
| **E** | > 10 bugs | Critical reliability issues |
|
|
232
|
+
|
|
233
|
+
#### Security Rating
|
|
234
|
+
|
|
235
|
+
**What it measures:** Vulnerability and security hotspot count.
|
|
236
|
+
|
|
237
|
+
**Vulnerability rules:** All `security` category rules are classified as vulnerabilities, including:
|
|
238
|
+
- Hardcoded credentials (MULE-201)
|
|
239
|
+
- Insecure TLS (MULE-202)
|
|
240
|
+
- Plaintext secrets (YAML-004)
|
|
241
|
+
- Hardcoded URLs (MULE-004)
|
|
242
|
+
- TLS version check (SEC-002)
|
|
243
|
+
- Rate limiting (SEC-003)
|
|
244
|
+
- Input validation (SEC-004)
|
|
245
|
+
|
|
246
|
+
| Rating | Vulnerabilities | Interpretation |
|
|
247
|
+
|--------|-----------------|----------------|
|
|
248
|
+
| **A** | 0 vulns | Secure configuration |
|
|
249
|
+
| **B** | 1 vuln | Minor security finding |
|
|
250
|
+
| **C** | 2-3 vulns | Security review needed |
|
|
251
|
+
| **D** | 4-5 vulns | Security remediation required |
|
|
252
|
+
| **E** | > 5 vulns | Critical security issues |
|
|
253
|
+
|
|
131
254
|
### Examples
|
|
132
255
|
|
|
133
256
|
```bash
|
|
@@ -418,10 +541,9 @@ Create a `.vscode/mcp.json` file in your project root:
|
|
|
418
541
|
|
|
419
542
|
```json
|
|
420
543
|
{
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
}
|
|
544
|
+
"mule-lint": {
|
|
545
|
+
"command": "npx",
|
|
546
|
+
"args": ["-y", "@sfdxy/mule-lint", "mule-lint-mcp"]
|
|
425
547
|
}
|
|
426
548
|
}
|
|
427
549
|
```
|
package/dist/bin/mule-lint.js
CHANGED
|
@@ -40,18 +40,21 @@ const path = __importStar(require("path"));
|
|
|
40
40
|
const LintEngine_1 = require("../src/engine/LintEngine");
|
|
41
41
|
const rules_1 = require("../src/rules");
|
|
42
42
|
const formatters_1 = require("../src/formatters");
|
|
43
|
+
const QualityGateEvaluator_1 = require("../src/core/QualityGateEvaluator");
|
|
44
|
+
const QualityGate_1 = require("../src/types/QualityGate");
|
|
43
45
|
const program = new commander_1.Command();
|
|
44
46
|
program
|
|
45
47
|
.name('mule-lint')
|
|
46
48
|
.description('Static analysis tool for MuleSoft applications')
|
|
47
49
|
.version('1.0.0')
|
|
48
50
|
.argument('<path>', 'Path to scan (directory or file)')
|
|
49
|
-
.option('-f, --format <type>', 'Output format: table, json, sarif', 'table')
|
|
51
|
+
.option('-f, --format <type>', 'Output format: table, json, sarif, html, csv', 'table')
|
|
50
52
|
.option('-o, --output <file>', 'Write output to file instead of stdout')
|
|
51
53
|
.option('-c, --config <file>', 'Path to configuration file')
|
|
52
54
|
.option('-q, --quiet', 'Show only errors (suppress warnings and info)')
|
|
53
55
|
.option('--fail-on-warning', 'Exit with error code if warnings found')
|
|
54
56
|
.option('-e, --experimental', 'Enable experimental rules (opt-in)')
|
|
57
|
+
.option('-g, --quality-gate <name>', 'Apply quality gate: default, strict, or from config')
|
|
55
58
|
.option('-v, --verbose', 'Show verbose output')
|
|
56
59
|
.action(async (targetPath, options) => {
|
|
57
60
|
try {
|
|
@@ -119,10 +122,43 @@ async function runLint(targetPath, options) {
|
|
|
119
122
|
else {
|
|
120
123
|
console.log(output);
|
|
121
124
|
}
|
|
122
|
-
//
|
|
123
|
-
|
|
125
|
+
// Determine exit code
|
|
126
|
+
let exitCode;
|
|
127
|
+
// Quality Gate evaluation
|
|
128
|
+
if (options.qualityGate) {
|
|
129
|
+
const gate = resolveQualityGate(options.qualityGate, config);
|
|
130
|
+
const gateResult = (0, QualityGateEvaluator_1.evaluateQualityGate)(report, gate);
|
|
131
|
+
// Print quality gate result
|
|
132
|
+
console.log((0, QualityGateEvaluator_1.formatQualityGateResult)(gateResult));
|
|
133
|
+
// Exit code based on quality gate
|
|
134
|
+
exitCode = (0, QualityGateEvaluator_1.getQualityGateExitCode)(gateResult.status, options.failOnWarning);
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
// Legacy exit code based on issue count
|
|
138
|
+
exitCode = (0, formatters_1.getExitCode)(report, options.failOnWarning);
|
|
139
|
+
}
|
|
124
140
|
process.exit(exitCode);
|
|
125
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* Resolves the quality gate to use based on CLI option and config
|
|
144
|
+
*/
|
|
145
|
+
function resolveQualityGate(gateName, config) {
|
|
146
|
+
// Check for built-in gates
|
|
147
|
+
switch (gateName.toLowerCase()) {
|
|
148
|
+
case 'default':
|
|
149
|
+
return QualityGate_1.DEFAULT_QUALITY_GATE;
|
|
150
|
+
case 'strict':
|
|
151
|
+
return QualityGate_1.STRICT_QUALITY_GATE;
|
|
152
|
+
case 'config':
|
|
153
|
+
// Use gate from config file
|
|
154
|
+
if (config.qualityGate) {
|
|
155
|
+
return config.qualityGate;
|
|
156
|
+
}
|
|
157
|
+
throw new Error('Quality gate "config" specified but no qualityGate found in config file');
|
|
158
|
+
default:
|
|
159
|
+
throw new Error(`Unknown quality gate: ${gateName}. Use 'default', 'strict', or 'config'`);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
126
162
|
// Run the CLI
|
|
127
163
|
program.parse();
|
|
128
164
|
//# sourceMappingURL=mule-lint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mule-lint.js","sourceRoot":"","sources":["../../bin/mule-lint.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,yCAAoC;AACpC,uCAAyB;AACzB,2CAA6B;AAC7B,yDAAsD;AACtD,wCAAyC;AACzC,kDAAwD;
|
|
1
|
+
{"version":3,"file":"mule-lint.js","sourceRoot":"","sources":["../../bin/mule-lint.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,y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|
|
2
|
+
import { RatingGrade } from '../quality';
|
|
3
|
+
/**
|
|
4
|
+
* Rating type for metrics (SonarQube-style A-E)
|
|
5
|
+
* @deprecated Use RatingGrade from quality module instead
|
|
6
|
+
*/
|
|
7
|
+
export type MetricRating = RatingGrade;
|
|
8
|
+
/**
|
|
9
|
+
* Aggregates and calculates quality metrics for lint reports
|
|
10
|
+
*
|
|
11
|
+
* Uses centralized quality scoring from src/quality/ for consistent
|
|
12
|
+
* rating calculations across the codebase.
|
|
13
|
+
*/
|
|
14
|
+
export declare class MetricsAggregator {
|
|
15
|
+
/**
|
|
16
|
+
* Calculate complexity rating based on average flow complexity
|
|
17
|
+
* Delegates to centralized calculator
|
|
18
|
+
*/
|
|
19
|
+
static getComplexityRating(avgComplexity: number): MetricRating;
|
|
20
|
+
/**
|
|
21
|
+
* Calculate file complexity rating based on flow count
|
|
22
|
+
* This matches mule-sonarqube-plugin's logic:
|
|
23
|
+
* - Simple (A): ≤ 7 flows
|
|
24
|
+
* - Medium (B): 8-14 flows
|
|
25
|
+
* - Complex (C+): ≥ 15 flows
|
|
26
|
+
*/
|
|
27
|
+
static getFileComplexityRating(flowCount: number): MetricRating;
|
|
28
|
+
/**
|
|
29
|
+
* Calculate maintainability rating based on technical debt ratio
|
|
30
|
+
* Delegates to centralized calculator
|
|
31
|
+
*/
|
|
32
|
+
static getMaintainabilityRating(debtRatioPercent: number): MetricRating;
|
|
33
|
+
/**
|
|
34
|
+
* Calculate reliability rating based on bug count
|
|
35
|
+
* Delegates to centralized calculator
|
|
36
|
+
*/
|
|
37
|
+
static getReliabilityRating(bugCount: number): MetricRating;
|
|
38
|
+
/**
|
|
39
|
+
* Calculate security rating based on vulnerability count
|
|
40
|
+
* Delegates to centralized calculator
|
|
41
|
+
*/
|
|
42
|
+
static getSecurityRating(vulnerabilityCount: number): MetricRating;
|
|
43
|
+
/**
|
|
44
|
+
* Format time duration from minutes
|
|
45
|
+
* Delegates to centralized formatter
|
|
46
|
+
*/
|
|
47
|
+
static formatDuration(minutes: number): string;
|
|
48
|
+
/**
|
|
49
|
+
* Aggregate metrics from a lint report
|
|
50
|
+
* Computes complexity, maintainability, reliability, and security ratings
|
|
51
|
+
*/
|
|
52
|
+
static aggregateMetrics(report: LintReport): ProjectMetrics | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Classify issues into bugs, vulnerabilities, code smells, and hotspots
|
|
55
|
+
* Uses the issueType metadata from rule definitions for accurate classification
|
|
56
|
+
*/
|
|
57
|
+
private static classifyIssues;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=MetricsAggregator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MetricsAggregator.d.ts","sourceRoot":"","sources":["../../../src/core/MetricsAggregator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAMH,WAAW,EACd,MAAM,YAAY,CAAC;AAIpB;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC;AAmBvC;;;;;GAKG;AACH,qBAAa,iBAAiB;IAC1B;;;OAGG;IACH,MAAM,CAAC,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,YAAY;IAI/D;;;;;;OAMG;IACH,MAAM,CAAC,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY;IAQ/D;;;OAGG;IACH,MAAM,CAAC,wBAAwB,CAAC,gBAAgB,EAAE,MAAM,GAAG,YAAY;IAIvE;;;OAGG;IACH,MAAM,CAAC,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY;IAI3D;;;OAGG;IACH,MAAM,CAAC,iBAAiB,CAAC,kBAAkB,EAAE,MAAM,GAAG,YAAY;IAIlE;;;OAGG;IACH,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAI9C;;;OAGG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,cAAc,GAAG,SAAS;IAwDvE;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;CAgChC"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MetricsAggregator = void 0;
|
|
4
|
+
const quality_1 = require("../quality");
|
|
5
|
+
const rules_1 = require("../rules");
|
|
6
|
+
/**
|
|
7
|
+
* Build a lookup map of rule ID -> issueType
|
|
8
|
+
* This is built once and cached for performance
|
|
9
|
+
*/
|
|
10
|
+
const ruleIssueTypeMap = new Map();
|
|
11
|
+
for (const rule of rules_1.ALL_RULES) {
|
|
12
|
+
ruleIssueTypeMap.set(rule.id, rule.issueType || 'code-smell');
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Get issue type for a rule ID
|
|
16
|
+
* Falls back to 'code-smell' if rule not found
|
|
17
|
+
*/
|
|
18
|
+
function getIssueTypeForRule(ruleId) {
|
|
19
|
+
return ruleIssueTypeMap.get(ruleId) || 'code-smell';
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Aggregates and calculates quality metrics for lint reports
|
|
23
|
+
*
|
|
24
|
+
* Uses centralized quality scoring from src/quality/ for consistent
|
|
25
|
+
* rating calculations across the codebase.
|
|
26
|
+
*/
|
|
27
|
+
class MetricsAggregator {
|
|
28
|
+
/**
|
|
29
|
+
* Calculate complexity rating based on average flow complexity
|
|
30
|
+
* Delegates to centralized calculator
|
|
31
|
+
*/
|
|
32
|
+
static getComplexityRating(avgComplexity) {
|
|
33
|
+
return (0, quality_1.calculateGrade)('complexity', avgComplexity);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Calculate file complexity rating based on flow count
|
|
37
|
+
* This matches mule-sonarqube-plugin's logic:
|
|
38
|
+
* - Simple (A): ≤ 7 flows
|
|
39
|
+
* - Medium (B): 8-14 flows
|
|
40
|
+
* - Complex (C+): ≥ 15 flows
|
|
41
|
+
*/
|
|
42
|
+
static getFileComplexityRating(flowCount) {
|
|
43
|
+
if (flowCount <= 7)
|
|
44
|
+
return 'A';
|
|
45
|
+
if (flowCount <= 14)
|
|
46
|
+
return 'B';
|
|
47
|
+
if (flowCount <= 21)
|
|
48
|
+
return 'C';
|
|
49
|
+
if (flowCount <= 30)
|
|
50
|
+
return 'D';
|
|
51
|
+
return 'E';
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Calculate maintainability rating based on technical debt ratio
|
|
55
|
+
* Delegates to centralized calculator
|
|
56
|
+
*/
|
|
57
|
+
static getMaintainabilityRating(debtRatioPercent) {
|
|
58
|
+
return (0, quality_1.calculateGrade)('maintainability', debtRatioPercent);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Calculate reliability rating based on bug count
|
|
62
|
+
* Delegates to centralized calculator
|
|
63
|
+
*/
|
|
64
|
+
static getReliabilityRating(bugCount) {
|
|
65
|
+
return (0, quality_1.calculateGrade)('reliability', bugCount);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Calculate security rating based on vulnerability count
|
|
69
|
+
* Delegates to centralized calculator
|
|
70
|
+
*/
|
|
71
|
+
static getSecurityRating(vulnerabilityCount) {
|
|
72
|
+
return (0, quality_1.calculateGrade)('security', vulnerabilityCount);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Format time duration from minutes
|
|
76
|
+
* Delegates to centralized formatter
|
|
77
|
+
*/
|
|
78
|
+
static formatDuration(minutes) {
|
|
79
|
+
return (0, quality_1.formatTechDebt)(minutes);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Aggregate metrics from a lint report
|
|
83
|
+
* Computes complexity, maintainability, reliability, and security ratings
|
|
84
|
+
*/
|
|
85
|
+
static aggregateMetrics(report) {
|
|
86
|
+
if (!report.metrics)
|
|
87
|
+
return undefined;
|
|
88
|
+
const metrics = report.metrics;
|
|
89
|
+
// Calculate complexity aggregates from flow data
|
|
90
|
+
const flowData = metrics.flowComplexityData || [];
|
|
91
|
+
const totalComplexity = flowData.reduce((sum, f) => sum + f.complexity, 0);
|
|
92
|
+
const avgComplexity = flowData.length > 0 ? totalComplexity / flowData.length : 0;
|
|
93
|
+
const highestFlow = flowData.reduce((max, f) => (f.complexity > (max?.complexity || 0) ? f : max), flowData[0]);
|
|
94
|
+
// Classify issues by type using rule metadata
|
|
95
|
+
const { bugs, vulnerabilities, codeSmells, hotspots } = this.classifyIssues(report);
|
|
96
|
+
// Calculate technical debt using centralized calculator
|
|
97
|
+
const debtMinutes = (0, quality_1.calculateDebtMinutes)(codeSmells, bugs, vulnerabilities);
|
|
98
|
+
// Estimate development time using centralized calculator
|
|
99
|
+
const estimatedDevMinutes = (0, quality_1.estimateDevelopmentMinutes)(metrics.flowCount, metrics.subFlowCount);
|
|
100
|
+
const debtRatio = (0, quality_1.calculateDebtRatio)(debtMinutes, estimatedDevMinutes);
|
|
101
|
+
// Build enhanced metrics with centralized ratings
|
|
102
|
+
return {
|
|
103
|
+
...metrics,
|
|
104
|
+
complexity: {
|
|
105
|
+
total: totalComplexity,
|
|
106
|
+
average: Math.round(avgComplexity * 10) / 10,
|
|
107
|
+
highest: highestFlow
|
|
108
|
+
? { flow: highestFlow.flowName, value: highestFlow.complexity }
|
|
109
|
+
: undefined,
|
|
110
|
+
rating: this.getComplexityRating(avgComplexity),
|
|
111
|
+
},
|
|
112
|
+
maintainability: {
|
|
113
|
+
technicalDebtMinutes: debtMinutes,
|
|
114
|
+
technicalDebt: this.formatDuration(debtMinutes),
|
|
115
|
+
debtRatio: Math.round(debtRatio * 10) / 10,
|
|
116
|
+
rating: this.getMaintainabilityRating(debtRatio),
|
|
117
|
+
},
|
|
118
|
+
reliability: {
|
|
119
|
+
bugs,
|
|
120
|
+
rating: this.getReliabilityRating(bugs),
|
|
121
|
+
},
|
|
122
|
+
security: {
|
|
123
|
+
vulnerabilities,
|
|
124
|
+
hotspots,
|
|
125
|
+
rating: this.getSecurityRating(vulnerabilities),
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Classify issues into bugs, vulnerabilities, code smells, and hotspots
|
|
131
|
+
* Uses the issueType metadata from rule definitions for accurate classification
|
|
132
|
+
*/
|
|
133
|
+
static classifyIssues(report) {
|
|
134
|
+
let bugs = 0;
|
|
135
|
+
let vulnerabilities = 0;
|
|
136
|
+
let codeSmells = 0;
|
|
137
|
+
let hotspots = 0;
|
|
138
|
+
for (const file of report.files) {
|
|
139
|
+
for (const issue of file.issues) {
|
|
140
|
+
const issueType = getIssueTypeForRule(issue.ruleId);
|
|
141
|
+
switch (issueType) {
|
|
142
|
+
case 'bug':
|
|
143
|
+
bugs++;
|
|
144
|
+
break;
|
|
145
|
+
case 'vulnerability':
|
|
146
|
+
vulnerabilities++;
|
|
147
|
+
break;
|
|
148
|
+
case 'code-smell':
|
|
149
|
+
default:
|
|
150
|
+
codeSmells++;
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return { bugs, vulnerabilities, codeSmells, hotspots };
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
exports.MetricsAggregator = MetricsAggregator;
|
|
159
|
+
//# sourceMappingURL=MetricsAggregator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MetricsAggregator.js","sourceRoot":"","sources":["../../../src/core/MetricsAggregator.ts"],"names":[],"mappings":";;;AACA,wCAOoB;AACpB,oCAAqC;AASrC;;;GAGG;AACH,MAAM,gBAAgB,GAA2B,IAAI,GAAG,EAAE,CAAC;AAC3D,KAAK,MAAM,IAAI,IAAI,iBAAS,EAAE,CAAC;IAC3B,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,SAAS,IAAI,YAAY,CAAC,CAAC;AAClE,CAAC;AAED;;;GAGG;AACH,SAAS,mBAAmB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AU,EAAE,CAAC;wBACb,MAAM;gBACd,CAAC;YACL,CAAC;QACL,CAAC;QAED,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;IAC3D,CAAC;CACJ;AAxJD,8CAwJC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { QualityGate, QualityGateResult, QualityGateStatus } from '../types/QualityGate';
|
|
2
|
+
import { LintReport } from '../types/Report';
|
|
3
|
+
/**
|
|
4
|
+
* Evaluates a quality gate against a lint report
|
|
5
|
+
*/
|
|
6
|
+
export declare function evaluateQualityGate(report: LintReport, gate?: QualityGate): QualityGateResult;
|
|
7
|
+
/**
|
|
8
|
+
* Returns the appropriate exit code based on quality gate status
|
|
9
|
+
*/
|
|
10
|
+
export declare function getQualityGateExitCode(status: QualityGateStatus, failOnWarning?: boolean): number;
|
|
11
|
+
/**
|
|
12
|
+
* Formats quality gate result for console output
|
|
13
|
+
*/
|
|
14
|
+
export declare function formatQualityGateResult(result: QualityGateResult): string;
|
|
15
|
+
//# sourceMappingURL=QualityGateEvaluator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QualityGateEvaluator.d.ts","sourceRoot":"","sources":["../../../src/core/QualityGateEvaluator.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EAKpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAe,MAAM,iBAAiB,CAAC;AAwD1D;;GAEG;AACH,wBAAgB,mBAAmB,CAC/B,MAAM,EAAE,UAAU,EAClB,IAAI,GAAE,WAAkC,GACzC,iBAAiB,CA8CnB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,iBAAiB,EAAE,aAAa,GAAE,OAAe,GAAG,MAAM,CAWxG;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAoBzE"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.evaluateQualityGate = evaluateQualityGate;
|
|
4
|
+
exports.getQualityGateExitCode = getQualityGateExitCode;
|
|
5
|
+
exports.formatQualityGateResult = formatQualityGateResult;
|
|
6
|
+
const QualityGate_1 = require("../types/QualityGate");
|
|
7
|
+
/**
|
|
8
|
+
* Extracts metric values from a lint report
|
|
9
|
+
*/
|
|
10
|
+
function getMetricValue(metric, report) {
|
|
11
|
+
const summary = report.summary;
|
|
12
|
+
switch (metric) {
|
|
13
|
+
case 'errors':
|
|
14
|
+
return summary.bySeverity.error;
|
|
15
|
+
case 'warnings':
|
|
16
|
+
return summary.bySeverity.warning;
|
|
17
|
+
case 'infos':
|
|
18
|
+
return summary.bySeverity.info;
|
|
19
|
+
case 'complexity_max':
|
|
20
|
+
return report.metrics?.complexity?.highest?.value ?? 0;
|
|
21
|
+
case 'complexity_avg':
|
|
22
|
+
return report.metrics?.complexity?.average ?? 0;
|
|
23
|
+
case 'coverage':
|
|
24
|
+
return report.metrics?.coverage?.percentage ?? 0;
|
|
25
|
+
case 'duplications':
|
|
26
|
+
return report.metrics?.duplications?.percentage ?? 0;
|
|
27
|
+
case 'security_hotspots':
|
|
28
|
+
return report.metrics?.security?.hotspots ?? 0;
|
|
29
|
+
case 'technical_debt_ratio':
|
|
30
|
+
return report.metrics?.maintainability?.debtRatio ?? 0;
|
|
31
|
+
default:
|
|
32
|
+
return 0;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Evaluates a comparison between actual value and threshold
|
|
37
|
+
*/
|
|
38
|
+
function evaluateCondition(actualValue, operator, threshold) {
|
|
39
|
+
switch (operator) {
|
|
40
|
+
case '<':
|
|
41
|
+
return actualValue < threshold;
|
|
42
|
+
case '>':
|
|
43
|
+
return actualValue > threshold;
|
|
44
|
+
case '<=':
|
|
45
|
+
return actualValue <= threshold;
|
|
46
|
+
case '>=':
|
|
47
|
+
return actualValue >= threshold;
|
|
48
|
+
case '=':
|
|
49
|
+
return actualValue === threshold;
|
|
50
|
+
default:
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Evaluates a quality gate against a lint report
|
|
56
|
+
*/
|
|
57
|
+
function evaluateQualityGate(report, gate = QualityGate_1.DEFAULT_QUALITY_GATE) {
|
|
58
|
+
const conditionResults = [];
|
|
59
|
+
let overallStatus = 'passed';
|
|
60
|
+
const failedConditions = [];
|
|
61
|
+
const warnConditions = [];
|
|
62
|
+
for (const condition of gate.conditions) {
|
|
63
|
+
const actualValue = getMetricValue(condition.metric, report);
|
|
64
|
+
const violated = evaluateCondition(actualValue, condition.operator, condition.threshold);
|
|
65
|
+
const result = {
|
|
66
|
+
condition,
|
|
67
|
+
actualValue,
|
|
68
|
+
passed: !violated,
|
|
69
|
+
};
|
|
70
|
+
conditionResults.push(result);
|
|
71
|
+
if (violated) {
|
|
72
|
+
const conditionStr = `${condition.metric} ${condition.operator} ${condition.threshold} (actual: ${actualValue})`;
|
|
73
|
+
if (condition.status === 'fail') {
|
|
74
|
+
overallStatus = 'failed';
|
|
75
|
+
failedConditions.push(conditionStr);
|
|
76
|
+
}
|
|
77
|
+
else if (condition.status === 'warn' && overallStatus !== 'failed') {
|
|
78
|
+
overallStatus = 'warning';
|
|
79
|
+
warnConditions.push(conditionStr);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
// Build message
|
|
84
|
+
let message;
|
|
85
|
+
if (overallStatus === 'passed') {
|
|
86
|
+
message = `Quality Gate "${gate.name}" passed - all ${gate.conditions.length} conditions met`;
|
|
87
|
+
}
|
|
88
|
+
else if (overallStatus === 'failed') {
|
|
89
|
+
message = `Quality Gate "${gate.name}" FAILED - ${failedConditions.length} condition(s) violated: ${failedConditions.join(', ')}`;
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
message = `Quality Gate "${gate.name}" passed with warnings - ${warnConditions.length} warning(s): ${warnConditions.join(', ')}`;
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
gate,
|
|
96
|
+
status: overallStatus,
|
|
97
|
+
conditions: conditionResults,
|
|
98
|
+
message,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Returns the appropriate exit code based on quality gate status
|
|
103
|
+
*/
|
|
104
|
+
function getQualityGateExitCode(status, failOnWarning = false) {
|
|
105
|
+
switch (status) {
|
|
106
|
+
case 'passed':
|
|
107
|
+
return 0;
|
|
108
|
+
case 'warning':
|
|
109
|
+
return failOnWarning ? 1 : 0;
|
|
110
|
+
case 'failed':
|
|
111
|
+
return 1;
|
|
112
|
+
default:
|
|
113
|
+
return 0;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Formats quality gate result for console output
|
|
118
|
+
*/
|
|
119
|
+
function formatQualityGateResult(result) {
|
|
120
|
+
const lines = [];
|
|
121
|
+
const icon = result.status === 'passed' ? '✓' : result.status === 'warning' ? '⚠' : '✗';
|
|
122
|
+
const statusColor = result.status === 'passed' ? 'green' : result.status === 'warning' ? 'yellow' : 'red';
|
|
123
|
+
lines.push(`\nQuality Gate: ${result.gate.name}`);
|
|
124
|
+
lines.push(`Status: ${icon} ${result.status.toUpperCase()}`);
|
|
125
|
+
lines.push('');
|
|
126
|
+
lines.push('Conditions:');
|
|
127
|
+
for (const cr of result.conditions) {
|
|
128
|
+
const { condition, actualValue, passed } = cr;
|
|
129
|
+
const condIcon = passed ? '✓' : '✗';
|
|
130
|
+
lines.push(` ${condIcon} ${condition.metric}: ${actualValue} (threshold: ${condition.operator} ${condition.threshold})`);
|
|
131
|
+
}
|
|
132
|
+
return lines.join('\n');
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=QualityGateEvaluator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1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AC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AACA,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC"}
|
package/dist/src/core/index.js
CHANGED
|
@@ -18,4 +18,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
__exportStar(require("./XPathHelper"), exports);
|
|
19
19
|
__exportStar(require("./XmlParser"), exports);
|
|
20
20
|
__exportStar(require("./FileScanner"), exports);
|
|
21
|
+
__exportStar(require("./QualityGateEvaluator"), exports);
|
|
22
|
+
__exportStar(require("./MetricsAggregator"), exports);
|
|
21
23
|
//# sourceMappingURL=index.js.map
|