@sfdxy/mule-lint 1.18.1 → 1.20.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 +164 -151
- package/dist/bin/mule-lint-mcp.js.map +1 -1
- package/dist/bin/mule-lint.js +2 -2
- package/dist/bin/mule-lint.js.map +1 -1
- package/dist/package.json +26 -15
- package/dist/src/core/ComplexityCalculator.d.ts.map +1 -1
- package/dist/src/core/ComplexityCalculator.js.map +1 -1
- package/dist/src/core/FileScanner.d.ts.map +1 -1
- package/dist/src/core/FileScanner.js.map +1 -1
- package/dist/src/core/MetricsAggregator.d.ts.map +1 -1
- package/dist/src/core/MetricsAggregator.js +1 -1
- package/dist/src/core/MetricsAggregator.js.map +1 -1
- package/dist/src/core/MetricsCollector.d.ts.map +1 -1
- package/dist/src/core/MetricsCollector.js +1 -2
- package/dist/src/core/MetricsCollector.js.map +1 -1
- package/dist/src/core/QualityGateEvaluator.d.ts.map +1 -1
- package/dist/src/core/QualityGateEvaluator.js.map +1 -1
- package/dist/src/core/XPathHelper.d.ts.map +1 -1
- package/dist/src/core/XPathHelper.js +0 -1
- package/dist/src/core/XPathHelper.js.map +1 -1
- package/dist/src/core/XmlParser.d.ts.map +1 -1
- package/dist/src/core/XmlParser.js.map +1 -1
- package/dist/src/core/YamlParser.d.ts.map +1 -1
- package/dist/src/core/YamlParser.js.map +1 -1
- package/dist/src/core/errors.js.map +1 -1
- package/dist/src/engine/LintEngine.d.ts +10 -0
- package/dist/src/engine/LintEngine.d.ts.map +1 -1
- package/dist/src/engine/LintEngine.js +68 -4
- package/dist/src/engine/LintEngine.js.map +1 -1
- package/dist/src/formatter/MuleXmlFormatter.d.ts.map +1 -1
- package/dist/src/formatter/MuleXmlFormatter.js +7 -1
- package/dist/src/formatter/MuleXmlFormatter.js.map +1 -1
- package/dist/src/formatter/index.d.ts +2 -2
- package/dist/src/formatter/index.d.ts.map +1 -1
- package/dist/src/formatter/index.js.map +1 -1
- package/dist/src/formatters/CsvFormatter.js.map +1 -1
- package/dist/src/formatters/HtmlFormatter.js +0 -1
- package/dist/src/formatters/HtmlFormatter.js.map +1 -1
- package/dist/src/formatters/JsonFormatter.d.ts.map +1 -1
- package/dist/src/formatters/JsonFormatter.js.map +1 -1
- package/dist/src/formatters/SarifFormatter.js.map +1 -1
- package/dist/src/formatters/TableFormatter.js.map +1 -1
- package/dist/src/formatters/html/components/Icons.js +1 -1
- package/dist/src/formatters/html/components/Icons.js.map +1 -1
- package/dist/src/formatters/html/components/MetricCard.d.ts.map +1 -1
- package/dist/src/formatters/html/components/MetricCard.js.map +1 -1
- package/dist/src/formatters/html/components/Modal.d.ts.map +1 -1
- package/dist/src/formatters/html/components/Modal.js.map +1 -1
- package/dist/src/formatters/html/components/RatingBadge.d.ts.map +1 -1
- package/dist/src/formatters/html/components/RatingBadge.js +6 -6
- package/dist/src/formatters/html/components/RatingBadge.js.map +1 -1
- package/dist/src/formatters/html/index.d.ts +2 -2
- package/dist/src/formatters/html/index.d.ts.map +1 -1
- package/dist/src/formatters/html/index.js.map +1 -1
- package/dist/src/formatters/html/scripts/charts.d.ts.map +1 -1
- package/dist/src/formatters/html/scripts/charts.js +45 -12
- package/dist/src/formatters/html/scripts/charts.js.map +1 -1
- package/dist/src/formatters/html/scripts/index.d.ts.map +1 -1
- package/dist/src/formatters/html/scripts/index.js.map +1 -1
- package/dist/src/formatters/html/scripts/renderer.d.ts.map +1 -1
- package/dist/src/formatters/html/scripts/renderer.js +175 -35
- package/dist/src/formatters/html/scripts/renderer.js.map +1 -1
- package/dist/src/formatters/html/sections/Header.d.ts.map +1 -1
- package/dist/src/formatters/html/sections/Header.js.map +1 -1
- package/dist/src/formatters/html/sections/LintSummary.d.ts.map +1 -1
- package/dist/src/formatters/html/sections/LintSummary.js.map +1 -1
- package/dist/src/formatters/html/sections/QualityRatings.js.map +1 -1
- package/dist/src/formatters/html/sections/Sidebar.d.ts.map +1 -1
- package/dist/src/formatters/html/sections/Sidebar.js.map +1 -1
- package/dist/src/formatters/html/styles/badges.d.ts.map +1 -1
- package/dist/src/formatters/html/styles/badges.js.map +1 -1
- package/dist/src/formatters/html/styles/index.d.ts.map +1 -1
- package/dist/src/formatters/html/styles/index.js.map +1 -1
- package/dist/src/formatters/html/theme.js.map +1 -1
- package/dist/src/formatters/html/views/Dashboard.js +5 -5
- package/dist/src/formatters/html/views/Dashboard.js.map +1 -1
- package/dist/src/formatters/html/views/IssuesView.d.ts.map +1 -1
- package/dist/src/formatters/html/views/IssuesView.js.map +1 -1
- package/dist/src/formatters/index.js.map +1 -1
- package/dist/src/mcp/index.d.ts.map +1 -1
- package/dist/src/mcp/index.js +0 -1
- package/dist/src/mcp/index.js.map +1 -1
- package/dist/src/mcp/prompts/index.js.map +1 -1
- package/dist/src/mcp/resources/index.js +30 -7
- package/dist/src/mcp/resources/index.js.map +1 -1
- package/dist/src/mcp/tools/formatMuleXml.d.ts.map +1 -1
- package/dist/src/mcp/tools/formatMuleXml.js +4 -13
- package/dist/src/mcp/tools/formatMuleXml.js.map +1 -1
- package/dist/src/mcp/tools/getRuleDetails.d.ts.map +1 -1
- package/dist/src/mcp/tools/getRuleDetails.js +1 -3
- package/dist/src/mcp/tools/getRuleDetails.js.map +1 -1
- package/dist/src/mcp/tools/runLintAnalysis.js +9 -9
- package/dist/src/mcp/tools/runLintAnalysis.js.map +1 -1
- package/dist/src/mcp/tools/validateSnippet.d.ts.map +1 -1
- package/dist/src/mcp/tools/validateSnippet.js.map +1 -1
- package/dist/src/quality/calculator.d.ts.map +1 -1
- package/dist/src/quality/calculator.js +1 -1
- package/dist/src/quality/calculator.js.map +1 -1
- package/dist/src/quality/index.d.ts.map +1 -1
- package/dist/src/quality/index.js.map +1 -1
- package/dist/src/quality/thresholds.js.map +1 -1
- package/dist/src/quality/types.d.ts.map +1 -1
- package/dist/src/rules/api-led/ApiLedRules.d.ts.map +1 -1
- package/dist/src/rules/api-led/ApiLedRules.js +6 -2
- package/dist/src/rules/api-led/ApiLedRules.js.map +1 -1
- package/dist/src/rules/api-led/SingleSystemSapiRule.d.ts.map +1 -1
- package/dist/src/rules/api-led/SingleSystemSapiRule.js.map +1 -1
- package/dist/src/rules/base/BaseRule.d.ts.map +1 -1
- package/dist/src/rules/base/BaseRule.js.map +1 -1
- package/dist/src/rules/base/ProjectRule.d.ts.map +1 -1
- package/dist/src/rules/base/ProjectRule.js.map +1 -1
- package/dist/src/rules/complexity/FlowComplexityRule.d.ts.map +1 -1
- package/dist/src/rules/complexity/FlowComplexityRule.js.map +1 -1
- package/dist/src/rules/dataweave/DataWeaveRules.d.ts +6 -0
- package/dist/src/rules/dataweave/DataWeaveRules.d.ts.map +1 -1
- package/dist/src/rules/dataweave/DataWeaveRules.js +17 -3
- package/dist/src/rules/dataweave/DataWeaveRules.js.map +1 -1
- package/dist/src/rules/dataweave/Java17DWErrorHandlingRule.d.ts.map +1 -1
- package/dist/src/rules/dataweave/Java17DWErrorHandlingRule.js.map +1 -1
- package/dist/src/rules/documentation/DisplayNameRule.d.ts.map +1 -1
- package/dist/src/rules/documentation/DisplayNameRule.js.map +1 -1
- package/dist/src/rules/documentation/FlowDescriptionRule.d.ts.map +1 -1
- package/dist/src/rules/documentation/FlowDescriptionRule.js.map +1 -1
- package/dist/src/rules/documentation/MissingDocNameRule.d.ts.map +1 -1
- package/dist/src/rules/documentation/MissingDocNameRule.js.map +1 -1
- package/dist/src/rules/error-handling/CorrelationIdRule.d.ts +22 -1
- package/dist/src/rules/error-handling/CorrelationIdRule.d.ts.map +1 -1
- package/dist/src/rules/error-handling/CorrelationIdRule.js +107 -6
- package/dist/src/rules/error-handling/CorrelationIdRule.js.map +1 -1
- package/dist/src/rules/error-handling/GenericErrorRule.d.ts.map +1 -1
- package/dist/src/rules/error-handling/GenericErrorRule.js.map +1 -1
- package/dist/src/rules/error-handling/GlobalErrorHandlerRule.d.ts +14 -2
- package/dist/src/rules/error-handling/GlobalErrorHandlerRule.d.ts.map +1 -1
- package/dist/src/rules/error-handling/GlobalErrorHandlerRule.js +40 -18
- package/dist/src/rules/error-handling/GlobalErrorHandlerRule.js.map +1 -1
- package/dist/src/rules/error-handling/HttpStatusRule.d.ts +5 -0
- package/dist/src/rules/error-handling/HttpStatusRule.d.ts.map +1 -1
- package/dist/src/rules/error-handling/HttpStatusRule.js +15 -0
- package/dist/src/rules/error-handling/HttpStatusRule.js.map +1 -1
- package/dist/src/rules/error-handling/MissingErrorHandlerRule.d.ts.map +1 -1
- package/dist/src/rules/error-handling/MissingErrorHandlerRule.js.map +1 -1
- package/dist/src/rules/error-handling/TryScopeRule.d.ts.map +1 -1
- package/dist/src/rules/error-handling/TryScopeRule.js.map +1 -1
- package/dist/src/rules/experimental/ExperimentalRules.d.ts.map +1 -1
- package/dist/src/rules/experimental/ExperimentalRules.js +6 -2
- package/dist/src/rules/experimental/ExperimentalRules.js.map +1 -1
- package/dist/src/rules/governance/GovernanceRules.d.ts.map +1 -1
- package/dist/src/rules/governance/GovernanceRules.js.map +1 -1
- package/dist/src/rules/http/HttpContentTypeRule.d.ts +28 -1
- package/dist/src/rules/http/HttpContentTypeRule.d.ts.map +1 -1
- package/dist/src/rules/http/HttpContentTypeRule.js +68 -7
- package/dist/src/rules/http/HttpContentTypeRule.js.map +1 -1
- package/dist/src/rules/http/HttpTimeoutRule.d.ts.map +1 -1
- package/dist/src/rules/http/HttpTimeoutRule.js.map +1 -1
- package/dist/src/rules/http/HttpUserAgentRule.d.ts.map +1 -1
- package/dist/src/rules/http/HttpUserAgentRule.js.map +1 -1
- package/dist/src/rules/index.js.map +1 -1
- package/dist/src/rules/logging/ExcessiveLoggersRule.d.ts.map +1 -1
- package/dist/src/rules/logging/ExcessiveLoggersRule.js.map +1 -1
- package/dist/src/rules/logging/LoggerCategoryRule.d.ts.map +1 -1
- package/dist/src/rules/logging/LoggerCategoryRule.js.map +1 -1
- package/dist/src/rules/logging/LoggerInUntilSuccessfulRule.d.ts.map +1 -1
- package/dist/src/rules/logging/LoggerInUntilSuccessfulRule.js.map +1 -1
- package/dist/src/rules/logging/LoggerPayloadRule.d.ts.map +1 -1
- package/dist/src/rules/logging/LoggerPayloadRule.js.map +1 -1
- package/dist/src/rules/logging/NewLoggingRules.d.ts.map +1 -1
- package/dist/src/rules/logging/NewLoggingRules.js.map +1 -1
- package/dist/src/rules/naming/FlowCasingRule.d.ts.map +1 -1
- package/dist/src/rules/naming/FlowCasingRule.js.map +1 -1
- package/dist/src/rules/naming/FlowNamingRule.d.ts.map +1 -1
- package/dist/src/rules/naming/FlowNamingRule.js +3 -1
- package/dist/src/rules/naming/FlowNamingRule.js.map +1 -1
- package/dist/src/rules/naming/VariableNamingRule.d.ts.map +1 -1
- package/dist/src/rules/naming/VariableNamingRule.js.map +1 -1
- package/dist/src/rules/operations/CommentedCodeRule.d.ts.map +1 -1
- package/dist/src/rules/operations/CommentedCodeRule.js.map +1 -1
- package/dist/src/rules/operations/UnusedFlowRule.d.ts +6 -1
- package/dist/src/rules/operations/UnusedFlowRule.d.ts.map +1 -1
- package/dist/src/rules/operations/UnusedFlowRule.js +23 -9
- package/dist/src/rules/operations/UnusedFlowRule.js.map +1 -1
- package/dist/src/rules/performance/AsyncErrorHandlerRule.d.ts.map +1 -1
- package/dist/src/rules/performance/AsyncErrorHandlerRule.js.map +1 -1
- package/dist/src/rules/performance/ConnectionPoolingRule.d.ts +5 -0
- package/dist/src/rules/performance/ConnectionPoolingRule.d.ts.map +1 -1
- package/dist/src/rules/performance/ConnectionPoolingRule.js +18 -5
- package/dist/src/rules/performance/ConnectionPoolingRule.js.map +1 -1
- package/dist/src/rules/performance/LargeChoiceBlockRule.d.ts.map +1 -1
- package/dist/src/rules/performance/LargeChoiceBlockRule.js.map +1 -1
- package/dist/src/rules/performance/ReconnectionStrategyRule.d.ts +7 -0
- package/dist/src/rules/performance/ReconnectionStrategyRule.d.ts.map +1 -1
- package/dist/src/rules/performance/ReconnectionStrategyRule.js +15 -2
- package/dist/src/rules/performance/ReconnectionStrategyRule.js.map +1 -1
- package/dist/src/rules/performance/ScatterGatherRoutesRule.d.ts.map +1 -1
- package/dist/src/rules/performance/ScatterGatherRoutesRule.js.map +1 -1
- package/dist/src/rules/security/EncryptionKeyInLogsRule.d.ts.map +1 -1
- package/dist/src/rules/security/EncryptionKeyInLogsRule.js.map +1 -1
- package/dist/src/rules/security/HardcodedCredentialsRule.d.ts.map +1 -1
- package/dist/src/rules/security/HardcodedCredentialsRule.js.map +1 -1
- package/dist/src/rules/security/HardcodedHttpRule.d.ts.map +1 -1
- package/dist/src/rules/security/HardcodedHttpRule.js +1 -9
- package/dist/src/rules/security/HardcodedHttpRule.js.map +1 -1
- package/dist/src/rules/security/InputValidationRule.d.ts.map +1 -1
- package/dist/src/rules/security/InputValidationRule.js +1 -3
- package/dist/src/rules/security/InputValidationRule.js.map +1 -1
- package/dist/src/rules/security/InsecureTlsRule.d.ts.map +1 -1
- package/dist/src/rules/security/InsecureTlsRule.js.map +1 -1
- package/dist/src/rules/security/RateLimitingRule.d.ts.map +1 -1
- package/dist/src/rules/security/RateLimitingRule.js.map +1 -1
- package/dist/src/rules/security/TlsVersionRule.d.ts.map +1 -1
- package/dist/src/rules/security/TlsVersionRule.js.map +1 -1
- package/dist/src/rules/standards/ApiKitValidationRule.d.ts.map +1 -1
- package/dist/src/rules/standards/ApiKitValidationRule.js.map +1 -1
- package/dist/src/rules/standards/AutoDiscoveryRule.d.ts.map +1 -1
- package/dist/src/rules/standards/AutoDiscoveryRule.js.map +1 -1
- package/dist/src/rules/standards/ChoiceAntiPatternRule.d.ts.map +1 -1
- package/dist/src/rules/standards/ChoiceAntiPatternRule.js.map +1 -1
- package/dist/src/rules/standards/CronExternalizedRule.d.ts.map +1 -1
- package/dist/src/rules/standards/CronExternalizedRule.js.map +1 -1
- package/dist/src/rules/standards/DeprecatedComponentRule.d.ts.map +1 -1
- package/dist/src/rules/standards/DeprecatedComponentRule.js.map +1 -1
- package/dist/src/rules/standards/DwlStandardsRule.d.ts.map +1 -1
- package/dist/src/rules/standards/DwlStandardsRule.js.map +1 -1
- package/dist/src/rules/standards/HttpPortPlaceholderRule.d.ts.map +1 -1
- package/dist/src/rules/standards/HttpPortPlaceholderRule.js.map +1 -1
- package/dist/src/rules/structure/StructureRules.d.ts +8 -1
- package/dist/src/rules/structure/StructureRules.d.ts.map +1 -1
- package/dist/src/rules/structure/StructureRules.js +11 -7
- package/dist/src/rules/structure/StructureRules.js.map +1 -1
- package/dist/src/rules/yaml/YamlRules.d.ts.map +1 -1
- package/dist/src/rules/yaml/YamlRules.js +2 -7
- package/dist/src/rules/yaml/YamlRules.js.map +1 -1
- 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.map +1 -1
- package/dist/src/types/QualityGate.js.map +1 -1
- package/dist/src/types/Report.d.ts.map +1 -1
- package/dist/src/types/Rule.d.ts +22 -0
- package/dist/src/types/Rule.d.ts.map +1 -1
- package/docs/README.md +27 -27
- package/docs/best-practices/documentation-standards.md +20 -11
- package/docs/best-practices/folder-structure.md +16 -10
- package/docs/best-practices/mulesoft-best-practices.md +96 -94
- package/docs/best-practices/rules-catalog.md +422 -299
- package/docs/linter/architecture.md +70 -64
- package/docs/linter/extending.md +137 -128
- package/docs/linter/folder-structure.md +39 -38
- package/docs/linter/naming-conventions.md +80 -78
- package/docs/linter/rule-engine.md +306 -306
- package/docs/mcp-design.md +35 -21
- package/package.json +84 -73
|
@@ -30,38 +30,38 @@
|
|
|
30
30
|
|
|
31
31
|
## Rule Categories
|
|
32
32
|
|
|
33
|
-
| Family
|
|
34
|
-
|
|
35
|
-
| Error Handling | MULE-001/003/005/007/009, ERR-001
|
|
36
|
-
| Naming
|
|
37
|
-
| Security
|
|
38
|
-
| Logging
|
|
39
|
-
| HTTP
|
|
40
|
-
| Performance
|
|
41
|
-
| Documentation
|
|
42
|
-
| Standards
|
|
43
|
-
| Complexity
|
|
44
|
-
| Structure
|
|
45
|
-
| YAML
|
|
46
|
-
| DataWeave
|
|
47
|
-
| API-Led
|
|
48
|
-
| Governance
|
|
49
|
-
| Code Hygiene
|
|
50
|
-
| Experimental
|
|
33
|
+
| Family | Prefix | Count | Description |
|
|
34
|
+
| -------------- | ------------------------------------------ | ----- | ---------------------------------------------- |
|
|
35
|
+
| Error Handling | MULE-001/003/005/007/009, ERR-001 | 6 | Error handler configuration and best practices |
|
|
36
|
+
| Naming | MULE-002/101/102 | 3 | Naming conventions for flows and variables |
|
|
37
|
+
| Security | MULE-004/201/202, SEC-002/003/004/006 | 7 | Security vulnerabilities, TLS, rate limiting |
|
|
38
|
+
| Logging | MULE-006/301/303, LOG-001/004, HYG-001 | 6 | Logging standards, structured logging, hygiene |
|
|
39
|
+
| HTTP | MULE-401/402/403 | 3 | HTTP configuration and headers |
|
|
40
|
+
| Performance | MULE-501/502/503, PERF-002, RES-001 | 5 | Performance anti-patterns and resilience |
|
|
41
|
+
| Documentation | MULE-601/604, DOC-001 | 3 | Documentation requirements |
|
|
42
|
+
| Standards | MULE-008/010/701, OPS-001/002/003, API-005 | 7 | Coding standards and operations |
|
|
43
|
+
| Complexity | MULE-801 | 1 | Code complexity |
|
|
44
|
+
| Structure | MULE-802/803/804 | 3 | Project structure |
|
|
45
|
+
| YAML | YAML-001/003/004 | 3 | YAML configuration validation |
|
|
46
|
+
| DataWeave | DW-001/002/003/004 | 4 | DataWeave file validation |
|
|
47
|
+
| API-Led | API-001/002/003/004 | 4 | API-Led connectivity patterns |
|
|
48
|
+
| Governance | PROJ-001/002 | 2 | POM and Git hygiene |
|
|
49
|
+
| Code Hygiene | HYG-002/003 | 2 | Commented code and unused flows |
|
|
50
|
+
| Experimental | EXP-001/002/003 | 3 | Beta rules for evaluation |
|
|
51
51
|
|
|
52
52
|
### MULE Category ID Ranges
|
|
53
53
|
|
|
54
|
-
| Range
|
|
55
|
-
|
|
56
|
-
| 001-099 | Error Handling
|
|
57
|
-
| 100-199 | Naming
|
|
58
|
-
| 200-299 | Security
|
|
59
|
-
| 300-399 | Logging
|
|
60
|
-
| 400-499 | HTTP
|
|
61
|
-
| 500-599 | Performance
|
|
62
|
-
| 600-699 | Documentation
|
|
63
|
-
| 700-799 | Standards
|
|
64
|
-
| 800-899 | Complexity/Structure | Code complexity and project structure
|
|
54
|
+
| Range | Category | Description |
|
|
55
|
+
| ------- | -------------------- | ---------------------------------------------- |
|
|
56
|
+
| 001-099 | Error Handling | Error handler configuration and best practices |
|
|
57
|
+
| 100-199 | Naming | Naming conventions for flows, variables, files |
|
|
58
|
+
| 200-299 | Security | Security vulnerabilities and hardcoded values |
|
|
59
|
+
| 300-399 | Logging | Logging standards and structured logging |
|
|
60
|
+
| 400-499 | HTTP | HTTP configuration and headers |
|
|
61
|
+
| 500-599 | Performance | Performance anti-patterns |
|
|
62
|
+
| 600-699 | Documentation | Documentation requirements |
|
|
63
|
+
| 700-799 | Standards | General coding standards |
|
|
64
|
+
| 800-899 | Complexity/Structure | Code complexity and project structure |
|
|
65
65
|
|
|
66
66
|
---
|
|
67
67
|
|
|
@@ -73,17 +73,26 @@
|
|
|
73
73
|
|
|
74
74
|
### MULE-001: Global Error Handler Exists
|
|
75
75
|
|
|
76
|
-
| Property
|
|
77
|
-
|
|
78
|
-
| **Severity** |
|
|
76
|
+
| Property | Value |
|
|
77
|
+
| ------------ | -------------- |
|
|
78
|
+
| **Severity** | Warning |
|
|
79
79
|
| **Category** | Error Handling |
|
|
80
|
-
| **Fixable**
|
|
80
|
+
| **Fixable** | No |
|
|
81
81
|
|
|
82
|
-
**Description:** Every Mule project should have a global error handler file
|
|
82
|
+
**Description:** Every Mule project should have a global error handler — either a dedicated file (`src/main/mule/global-error-handler.xml` by default) **or** any XML flow file that contains a named `<error-handler>` element.
|
|
83
83
|
|
|
84
84
|
**Check Logic:**
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
|
|
86
|
+
1. If the expected file exists (`src/main/mule/global-error-handler.xml`), the rule passes.
|
|
87
|
+
2. Otherwise, checks each flow file for a named `<error-handler name="...">` or `<error-handler ref="...">` element.
|
|
88
|
+
3. If neither is found in a flow file (a file containing `<flow>` or `<sub-flow>` elements), a warning is reported.
|
|
89
|
+
4. Pure configuration files (no flows) are skipped to reduce noise.
|
|
90
|
+
|
|
91
|
+
**Options:**
|
|
92
|
+
|
|
93
|
+
| Option | Default | Description |
|
|
94
|
+
| ---------- | ---------------------------------------- | ------------------------------ |
|
|
95
|
+
| `filePath` | `src/main/mule/global-error-handler.xml` | Relative path to expected file |
|
|
87
96
|
|
|
88
97
|
**Why This Matters:** A global error handler ensures consistent error responses across all flows and reduces code duplication.
|
|
89
98
|
|
|
@@ -91,15 +100,16 @@
|
|
|
91
100
|
|
|
92
101
|
### MULE-003: Missing Error Handler
|
|
93
102
|
|
|
94
|
-
| Property
|
|
95
|
-
|
|
96
|
-
| **Severity** | Error
|
|
103
|
+
| Property | Value |
|
|
104
|
+
| ------------ | -------------- |
|
|
105
|
+
| **Severity** | Error |
|
|
97
106
|
| **Category** | Error Handling |
|
|
98
|
-
| **Fixable**
|
|
107
|
+
| **Fixable** | No |
|
|
99
108
|
|
|
100
109
|
**Description:** Every flow should have an error handler or reference the global one.
|
|
101
110
|
|
|
102
111
|
**XPath:**
|
|
112
|
+
|
|
103
113
|
```xpath
|
|
104
114
|
//mule:flow[not(mule:error-handler) and not(contains(@name, 'api-main'))]
|
|
105
115
|
```
|
|
@@ -108,37 +118,63 @@
|
|
|
108
118
|
|
|
109
119
|
### MULE-005: HTTP Status in Error Handler
|
|
110
120
|
|
|
111
|
-
| Property
|
|
112
|
-
|
|
113
|
-
| **Severity** | Warning
|
|
121
|
+
| Property | Value |
|
|
122
|
+
| ------------ | -------------- |
|
|
123
|
+
| **Severity** | Warning |
|
|
114
124
|
| **Category** | Error Handling |
|
|
115
|
-
| **Fixable**
|
|
125
|
+
| **Fixable** | No |
|
|
116
126
|
|
|
117
127
|
**Description:** Error handlers should set an `httpStatus` variable for proper API responses.
|
|
118
128
|
|
|
129
|
+
**Project Detection:** This rule is automatically skipped for non-HTTP projects. When `mule-lint` scans a project, it detects whether any `http:listener` or `apikit:router` element is present. If neither is found, the rule is suppressed to avoid false positives in event-driven or batch Mule applications.
|
|
130
|
+
|
|
131
|
+
**Options:**
|
|
132
|
+
|
|
133
|
+
| Option | Default | Description |
|
|
134
|
+
| -------------- | ------------ | --------------------------- |
|
|
135
|
+
| `variableName` | `httpStatus` | Name of the variable to set |
|
|
136
|
+
|
|
119
137
|
**Best Practice:** Always set httpStatus in error handlers to return appropriate HTTP codes (400, 404, 500, etc.).
|
|
120
138
|
|
|
121
139
|
---
|
|
122
140
|
|
|
123
141
|
### MULE-007: Correlation ID in Error Handler
|
|
124
142
|
|
|
125
|
-
| Property
|
|
126
|
-
|
|
127
|
-
| **Severity** | Warning
|
|
143
|
+
| Property | Value |
|
|
144
|
+
| ------------ | -------------- |
|
|
145
|
+
| **Severity** | Warning |
|
|
128
146
|
| **Category** | Error Handling |
|
|
129
|
-
| **Fixable**
|
|
147
|
+
| **Fixable** | No |
|
|
130
148
|
|
|
131
149
|
**Description:** Error handlers should reference `correlationId` for traceability across distributed systems.
|
|
132
150
|
|
|
151
|
+
**Check Logic:**
|
|
152
|
+
|
|
153
|
+
1. Checks inline XML text and attributes for correlation ID patterns (`correlationId`, `correlation_id`, `x-correlation-id`, `x-request-id`, etc.)
|
|
154
|
+
2. For `ee:set-payload` elements with a `resource="..."` attribute, reads the referenced `.dwl` file from `src/main/resources/<resourcePath>` and checks its content.
|
|
155
|
+
3. If a resource file is referenced but cannot be read (e.g. not yet generated), downgrades to `info` severity to avoid false positives.
|
|
156
|
+
|
|
157
|
+
**Example (inline):**
|
|
158
|
+
|
|
159
|
+
```xml
|
|
160
|
+
<on-error-continue>
|
|
161
|
+
<ee:transform>
|
|
162
|
+
<ee:set-payload resource="classpath:dwl/error-response.dwl"/>
|
|
163
|
+
</ee:transform>
|
|
164
|
+
</on-error-continue>
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
The DWL file at `src/main/resources/dwl/error-response.dwl` will be checked for `correlationId` usage.
|
|
168
|
+
|
|
133
169
|
---
|
|
134
170
|
|
|
135
171
|
### MULE-009: Generic Error Type
|
|
136
172
|
|
|
137
|
-
| Property
|
|
138
|
-
|
|
139
|
-
| **Severity** | Warning
|
|
173
|
+
| Property | Value |
|
|
174
|
+
| ------------ | -------------- |
|
|
175
|
+
| **Severity** | Warning |
|
|
140
176
|
| **Category** | Error Handling |
|
|
141
|
-
| **Fixable**
|
|
177
|
+
| **Fixable** | No |
|
|
142
178
|
|
|
143
179
|
**Description:** Avoid catching `type="ANY"` in error handlers. Be specific about error types.
|
|
144
180
|
|
|
@@ -148,18 +184,19 @@
|
|
|
148
184
|
|
|
149
185
|
### ERR-001: Try Scope Best Practice
|
|
150
186
|
|
|
151
|
-
| Property
|
|
152
|
-
|
|
153
|
-
| **Severity**
|
|
154
|
-
| **Category**
|
|
155
|
-
| **Issue Type** | Bug
|
|
156
|
-
| **Fixable**
|
|
187
|
+
| Property | Value |
|
|
188
|
+
| -------------- | -------------- |
|
|
189
|
+
| **Severity** | Info |
|
|
190
|
+
| **Category** | Error Handling |
|
|
191
|
+
| **Issue Type** | Bug |
|
|
192
|
+
| **Fixable** | No |
|
|
157
193
|
|
|
158
194
|
**Description:** Complex operations (DB calls, HTTP requests) should use Try scope for granular error isolation and handling.
|
|
159
195
|
|
|
160
196
|
**Check Logic:** Flags flows that have 2+ external calls (HTTP requests, DB operations) without any Try scope wrapping them.
|
|
161
197
|
|
|
162
198
|
**Example:**
|
|
199
|
+
|
|
163
200
|
```xml
|
|
164
201
|
<!-- ❌ Bad - multiple calls without Try -->
|
|
165
202
|
<flow name="process-order-flow">
|
|
@@ -188,15 +225,16 @@
|
|
|
188
225
|
|
|
189
226
|
### MULE-002: Flow Naming Convention
|
|
190
227
|
|
|
191
|
-
| Property
|
|
192
|
-
|
|
228
|
+
| Property | Value |
|
|
229
|
+
| ------------ | ------- |
|
|
193
230
|
| **Severity** | Warning |
|
|
194
|
-
| **Category** | Naming
|
|
195
|
-
| **Fixable**
|
|
231
|
+
| **Category** | Naming |
|
|
232
|
+
| **Fixable** | Yes |
|
|
196
233
|
|
|
197
|
-
**Description:** Flows must end with `-flow` suffix, sub-flows with `-subflow`.
|
|
234
|
+
**Description:** Flows must end with `-flow` suffix, sub-flows with `-subflow`. Both flow and sub-flow naming are enforced by this rule.
|
|
198
235
|
|
|
199
236
|
**Examples:**
|
|
237
|
+
|
|
200
238
|
```xml
|
|
201
239
|
<!-- ✅ Good -->
|
|
202
240
|
<flow name="process-order-flow">
|
|
@@ -207,19 +245,28 @@
|
|
|
207
245
|
<sub-flow name="validateInput">
|
|
208
246
|
```
|
|
209
247
|
|
|
248
|
+
**Options:**
|
|
249
|
+
|
|
250
|
+
| Option | Default | Description |
|
|
251
|
+
| ----------------- | -------------------------------------------------- | ----------------------------------------- |
|
|
252
|
+
| `flowSuffix` | `-flow` | Required suffix for `<flow>` elements |
|
|
253
|
+
| `subflowSuffix` | `-subflow` | Required suffix for `<sub-flow>` elements |
|
|
254
|
+
| `excludePatterns` | `['*-api-main', '*-main', 'get:*', 'post:*', ...]` | Glob patterns to skip |
|
|
255
|
+
|
|
210
256
|
---
|
|
211
257
|
|
|
212
258
|
### MULE-101: Flow Name Casing
|
|
213
259
|
|
|
214
|
-
| Property
|
|
215
|
-
|
|
260
|
+
| Property | Value |
|
|
261
|
+
| ------------ | ------- |
|
|
216
262
|
| **Severity** | Warning |
|
|
217
|
-
| **Category** | Naming
|
|
218
|
-
| **Fixable**
|
|
263
|
+
| **Category** | Naming |
|
|
264
|
+
| **Fixable** | No |
|
|
219
265
|
|
|
220
266
|
**Description:** Flow names should follow consistent casing (kebab-case recommended).
|
|
221
267
|
|
|
222
268
|
**Options:**
|
|
269
|
+
|
|
223
270
|
- `kebab-case`: `my-flow-name` (recommended)
|
|
224
271
|
- `camelCase`: `myFlowName`
|
|
225
272
|
- `snake_case`: `my_flow_name`
|
|
@@ -228,11 +275,11 @@
|
|
|
228
275
|
|
|
229
276
|
### MULE-102: Variable Naming Convention
|
|
230
277
|
|
|
231
|
-
| Property
|
|
232
|
-
|
|
278
|
+
| Property | Value |
|
|
279
|
+
| ------------ | ------- |
|
|
233
280
|
| **Severity** | Warning |
|
|
234
|
-
| **Category** | Naming
|
|
235
|
-
| **Fixable**
|
|
281
|
+
| **Category** | Naming |
|
|
282
|
+
| **Fixable** | No |
|
|
236
283
|
|
|
237
284
|
**Description:** Variables set via `set-variable` should follow camelCase naming.
|
|
238
285
|
|
|
@@ -244,15 +291,16 @@
|
|
|
244
291
|
|
|
245
292
|
### MULE-004: Hardcoded HTTP URLs
|
|
246
293
|
|
|
247
|
-
| Property
|
|
248
|
-
|
|
249
|
-
| **Severity** | Error
|
|
294
|
+
| Property | Value |
|
|
295
|
+
| ------------ | -------- |
|
|
296
|
+
| **Severity** | Error |
|
|
250
297
|
| **Category** | Security |
|
|
251
|
-
| **Fixable**
|
|
298
|
+
| **Fixable** | No |
|
|
252
299
|
|
|
253
300
|
**Description:** HTTP/HTTPS URLs should use property placeholders, not hardcoded values.
|
|
254
301
|
|
|
255
302
|
**Examples:**
|
|
303
|
+
|
|
256
304
|
```xml
|
|
257
305
|
<!-- ❌ Bad -->
|
|
258
306
|
<http:request url="https://api.example.com/orders" />
|
|
@@ -265,11 +313,11 @@
|
|
|
265
313
|
|
|
266
314
|
### MULE-201: Hardcoded Credentials
|
|
267
315
|
|
|
268
|
-
| Property
|
|
269
|
-
|
|
270
|
-
| **Severity** | Error
|
|
316
|
+
| Property | Value |
|
|
317
|
+
| ------------ | -------- |
|
|
318
|
+
| **Severity** | Error |
|
|
271
319
|
| **Category** | Security |
|
|
272
|
-
| **Fixable**
|
|
320
|
+
| **Fixable** | No |
|
|
273
321
|
|
|
274
322
|
**Description:** Passwords and secrets should never be hardcoded. Use secure properties.
|
|
275
323
|
|
|
@@ -279,11 +327,11 @@
|
|
|
279
327
|
|
|
280
328
|
### MULE-202: Insecure TLS Configuration
|
|
281
329
|
|
|
282
|
-
| Property
|
|
283
|
-
|
|
284
|
-
| **Severity** | Error
|
|
330
|
+
| Property | Value |
|
|
331
|
+
| ------------ | -------- |
|
|
332
|
+
| **Severity** | Error |
|
|
285
333
|
| **Category** | Security |
|
|
286
|
-
| **Fixable**
|
|
334
|
+
| **Fixable** | No |
|
|
287
335
|
|
|
288
336
|
**Description:** TLS configurations should not use insecure protocols or disable certificate verification.
|
|
289
337
|
|
|
@@ -291,18 +339,19 @@
|
|
|
291
339
|
|
|
292
340
|
### SEC-002: TLS Version Check
|
|
293
341
|
|
|
294
|
-
| Property
|
|
295
|
-
|
|
296
|
-
| **Severity**
|
|
297
|
-
| **Category**
|
|
342
|
+
| Property | Value |
|
|
343
|
+
| -------------- | ------------- |
|
|
344
|
+
| **Severity** | Error |
|
|
345
|
+
| **Category** | Security |
|
|
298
346
|
| **Issue Type** | Vulnerability |
|
|
299
|
-
| **Fixable**
|
|
347
|
+
| **Fixable** | No |
|
|
300
348
|
|
|
301
349
|
**Description:** Detect use of deprecated TLS versions (< 1.2). TLS 1.0 and 1.1 are deprecated and should not be used per current security standards.
|
|
302
350
|
|
|
303
351
|
**Deprecated Protocols:** `TLSv1`, `TLSv1.0`, `TLSv1.1`, `SSLv3`, `SSLv2`
|
|
304
352
|
|
|
305
353
|
**Example:**
|
|
354
|
+
|
|
306
355
|
```xml
|
|
307
356
|
<!-- ❌ Bad - deprecated protocol -->
|
|
308
357
|
<tls:context enabledProtocols="TLSv1.1,TLSv1.2">
|
|
@@ -315,12 +364,12 @@
|
|
|
315
364
|
|
|
316
365
|
### SEC-003: Rate Limiting Policy
|
|
317
366
|
|
|
318
|
-
| Property
|
|
319
|
-
|
|
320
|
-
| **Severity**
|
|
321
|
-
| **Category**
|
|
367
|
+
| Property | Value |
|
|
368
|
+
| -------------- | ------------- |
|
|
369
|
+
| **Severity** | Warning |
|
|
370
|
+
| **Category** | Security |
|
|
322
371
|
| **Issue Type** | Vulnerability |
|
|
323
|
-
| **Fixable**
|
|
372
|
+
| **Fixable** | No |
|
|
324
373
|
|
|
325
374
|
**Description:** APIs should have rate limiting or throttling configured to prevent DoS attacks and manage API consumption.
|
|
326
375
|
|
|
@@ -332,18 +381,19 @@
|
|
|
332
381
|
|
|
333
382
|
### SEC-004: Input Validation
|
|
334
383
|
|
|
335
|
-
| Property
|
|
336
|
-
|
|
337
|
-
| **Severity**
|
|
338
|
-
| **Category**
|
|
384
|
+
| Property | Value |
|
|
385
|
+
| -------------- | ------------- |
|
|
386
|
+
| **Severity** | Warning |
|
|
387
|
+
| **Category** | Security |
|
|
339
388
|
| **Issue Type** | Vulnerability |
|
|
340
|
-
| **Fixable**
|
|
389
|
+
| **Fixable** | No |
|
|
341
390
|
|
|
342
391
|
**Description:** Incoming payloads should be validated using JSON or XML schema validation to prevent injection attacks and malformed data processing.
|
|
343
392
|
|
|
344
393
|
**Check Logic:** Flags flows accepting POST/PUT/PATCH requests that have no schema validation or DataWeave validation patterns.
|
|
345
394
|
|
|
346
395
|
**Example:**
|
|
396
|
+
|
|
347
397
|
```xml
|
|
348
398
|
<!-- ✅ Good - schema validation -->
|
|
349
399
|
<flow name="post:\orders:api-config">
|
|
@@ -356,17 +406,18 @@
|
|
|
356
406
|
|
|
357
407
|
### SEC-006: Encryption Key in Logs
|
|
358
408
|
|
|
359
|
-
| Property
|
|
360
|
-
|
|
361
|
-
| **Severity** | Error
|
|
409
|
+
| Property | Value |
|
|
410
|
+
| ------------ | -------- |
|
|
411
|
+
| **Severity** | Error |
|
|
362
412
|
| **Category** | Security |
|
|
363
|
-
| **Fixable**
|
|
413
|
+
| **Fixable** | No |
|
|
364
414
|
|
|
365
415
|
**Description:** Encryption keys, passwords, and sensitive credentials should not appear in log statements.
|
|
366
416
|
|
|
367
417
|
**Detected Patterns:** `encrypt.*key`, `password`, `credentials`, `api_key`, `secret.*key`, `mule.key`, `secure::.*key`
|
|
368
418
|
|
|
369
419
|
**Example:**
|
|
420
|
+
|
|
370
421
|
```xml
|
|
371
422
|
<!-- ❌ Bad -->
|
|
372
423
|
<logger message="Key: #[vars.encryptionKey]"/>
|
|
@@ -383,15 +434,16 @@
|
|
|
383
434
|
|
|
384
435
|
### MULE-006: Logger Category Required
|
|
385
436
|
|
|
386
|
-
| Property
|
|
387
|
-
|
|
437
|
+
| Property | Value |
|
|
438
|
+
| ------------ | ------- |
|
|
388
439
|
| **Severity** | Warning |
|
|
389
440
|
| **Category** | Logging |
|
|
390
|
-
| **Fixable**
|
|
441
|
+
| **Fixable** | Yes |
|
|
391
442
|
|
|
392
443
|
**Description:** All loggers must have a `category` attribute for proper log filtering.
|
|
393
444
|
|
|
394
445
|
**Example:**
|
|
446
|
+
|
|
395
447
|
```xml
|
|
396
448
|
<!-- ✅ Good -->
|
|
397
449
|
<logger category="com.myorg.orders" message="Processing order" level="INFO"/>
|
|
@@ -401,15 +453,16 @@
|
|
|
401
453
|
|
|
402
454
|
### MULE-301: Logger Payload Reference
|
|
403
455
|
|
|
404
|
-
| Property
|
|
405
|
-
|
|
456
|
+
| Property | Value |
|
|
457
|
+
| ------------ | ------- |
|
|
406
458
|
| **Severity** | Warning |
|
|
407
459
|
| **Category** | Logging |
|
|
408
|
-
| **Fixable**
|
|
460
|
+
| **Fixable** | No |
|
|
409
461
|
|
|
410
462
|
**Description:** Loggers should not directly reference `#[payload]` as it may log sensitive data and cause performance issues.
|
|
411
463
|
|
|
412
464
|
**Examples:**
|
|
465
|
+
|
|
413
466
|
```xml
|
|
414
467
|
<!-- ❌ Bad - logs entire payload -->
|
|
415
468
|
<logger message="#[payload]" />
|
|
@@ -422,11 +475,11 @@
|
|
|
422
475
|
|
|
423
476
|
### MULE-303: Logger in Until-Successful
|
|
424
477
|
|
|
425
|
-
| Property
|
|
426
|
-
|
|
478
|
+
| Property | Value |
|
|
479
|
+
| ------------ | ------- |
|
|
427
480
|
| **Severity** | Warning |
|
|
428
481
|
| **Category** | Logging |
|
|
429
|
-
| **Fixable**
|
|
482
|
+
| **Fixable** | No |
|
|
430
483
|
|
|
431
484
|
**Description:** Having a logger inside `until-successful` may flood logs on retries.
|
|
432
485
|
|
|
@@ -434,11 +487,11 @@
|
|
|
434
487
|
|
|
435
488
|
### LOG-001: Structured Logging
|
|
436
489
|
|
|
437
|
-
| Property
|
|
438
|
-
|
|
439
|
-
| **Severity** | Info
|
|
490
|
+
| Property | Value |
|
|
491
|
+
| ------------ | ------- |
|
|
492
|
+
| **Severity** | Info |
|
|
440
493
|
| **Category** | Logging |
|
|
441
|
-
| **Fixable**
|
|
494
|
+
| **Fixable** | No |
|
|
442
495
|
|
|
443
496
|
**Description:** Recommend JSON logger format over plain text for production applications to enable better log parsing and analysis.
|
|
444
497
|
|
|
@@ -450,17 +503,18 @@
|
|
|
450
503
|
|
|
451
504
|
### LOG-004: Sensitive Data in Logs
|
|
452
505
|
|
|
453
|
-
| Property
|
|
454
|
-
|
|
455
|
-
| **Severity** | Error
|
|
506
|
+
| Property | Value |
|
|
507
|
+
| ------------ | ------- |
|
|
508
|
+
| **Severity** | Error |
|
|
456
509
|
| **Category** | Logging |
|
|
457
|
-
| **Fixable**
|
|
510
|
+
| **Fixable** | No |
|
|
458
511
|
|
|
459
512
|
**Description:** Log statements should not contain sensitive data values (passwords, tokens, SSNs, PII).
|
|
460
513
|
|
|
461
514
|
**Detected Patterns:** Variable references like `vars.password`, `payload.token`, `${secure::*}`, concatenated sensitive values.
|
|
462
515
|
|
|
463
516
|
**Example:**
|
|
517
|
+
|
|
464
518
|
```xml
|
|
465
519
|
<!-- ❌ Bad - logs sensitive variable value -->
|
|
466
520
|
<logger message="#['Token: ' ++ vars.accessToken]"/>
|
|
@@ -473,15 +527,16 @@
|
|
|
473
527
|
|
|
474
528
|
### HYG-001: Excessive Loggers
|
|
475
529
|
|
|
476
|
-
| Property
|
|
477
|
-
|
|
530
|
+
| Property | Value |
|
|
531
|
+
| ------------ | ------- |
|
|
478
532
|
| **Severity** | Warning |
|
|
479
533
|
| **Category** | Logging |
|
|
480
|
-
| **Fixable**
|
|
534
|
+
| **Fixable** | No |
|
|
481
535
|
|
|
482
536
|
**Description:** Flows should not have too many loggers, which can impact performance.
|
|
483
537
|
|
|
484
538
|
**Configuration:**
|
|
539
|
+
|
|
485
540
|
```json
|
|
486
541
|
{
|
|
487
542
|
"HYG-001": {
|
|
@@ -502,11 +557,11 @@
|
|
|
502
557
|
|
|
503
558
|
### MULE-401: HTTP Request Missing User-Agent
|
|
504
559
|
|
|
505
|
-
| Property
|
|
506
|
-
|
|
560
|
+
| Property | Value |
|
|
561
|
+
| ------------ | ------- |
|
|
507
562
|
| **Severity** | Warning |
|
|
508
|
-
| **Category** | HTTP
|
|
509
|
-
| **Fixable**
|
|
563
|
+
| **Category** | HTTP |
|
|
564
|
+
| **Fixable** | No |
|
|
510
565
|
|
|
511
566
|
**Description:** All HTTP requests should include a `User-Agent` header for API identification.
|
|
512
567
|
|
|
@@ -514,23 +569,33 @@
|
|
|
514
569
|
|
|
515
570
|
### MULE-402: HTTP Request Missing Content-Type
|
|
516
571
|
|
|
517
|
-
| Property
|
|
518
|
-
|
|
572
|
+
| Property | Value |
|
|
573
|
+
| ------------ | ------- |
|
|
519
574
|
| **Severity** | Warning |
|
|
520
|
-
| **Category** | HTTP
|
|
521
|
-
| **Fixable**
|
|
575
|
+
| **Category** | HTTP |
|
|
576
|
+
| **Fixable** | No |
|
|
522
577
|
|
|
523
578
|
**Description:** POST/PUT HTTP requests should include a `Content-Type` header.
|
|
524
579
|
|
|
580
|
+
**Detection Patterns:**
|
|
581
|
+
|
|
582
|
+
| Pattern | Description |
|
|
583
|
+
| ------------------------- | ------------------------------------------------------------------------------------------------- |
|
|
584
|
+
| A — Static header | `<http:header headerName="Content-Type" value="..."/>` inside `<http:headers>` |
|
|
585
|
+
| B — CDATA DataWeave block | `<http:headers><![CDATA[#[output application/java --- {"Content-Type": "..."}]]]></http:headers>` |
|
|
586
|
+
| C — Inline DW expression | `<http:headers value='#[{"Content-Type": "..."}]'/>` |
|
|
587
|
+
|
|
588
|
+
When headers are set via a DataWeave expression (patterns B/C) but `Content-Type` is not visible in the expression text, the issue is downgraded to **info** severity to acknowledge the static analysis limitation of evaluating dynamic expressions.
|
|
589
|
+
|
|
525
590
|
---
|
|
526
591
|
|
|
527
592
|
### MULE-403: HTTP Request Timeout
|
|
528
593
|
|
|
529
|
-
| Property
|
|
530
|
-
|
|
594
|
+
| Property | Value |
|
|
595
|
+
| ------------ | ------- |
|
|
531
596
|
| **Severity** | Warning |
|
|
532
|
-
| **Category** | HTTP
|
|
533
|
-
| **Fixable**
|
|
597
|
+
| **Category** | HTTP |
|
|
598
|
+
| **Fixable** | No |
|
|
534
599
|
|
|
535
600
|
**Description:** HTTP requests should have explicit timeout configuration.
|
|
536
601
|
|
|
@@ -544,11 +609,11 @@
|
|
|
544
609
|
|
|
545
610
|
### MULE-501: Scatter-Gather Routes
|
|
546
611
|
|
|
547
|
-
| Property
|
|
548
|
-
|
|
549
|
-
| **Severity** | Info
|
|
612
|
+
| Property | Value |
|
|
613
|
+
| ------------ | ----------- |
|
|
614
|
+
| **Severity** | Info |
|
|
550
615
|
| **Category** | Performance |
|
|
551
|
-
| **Fixable**
|
|
616
|
+
| **Fixable** | No |
|
|
552
617
|
|
|
553
618
|
**Description:** Scatter-gather with many routes may cause memory issues. Consider limiting routes.
|
|
554
619
|
|
|
@@ -556,11 +621,11 @@
|
|
|
556
621
|
|
|
557
622
|
### MULE-502: Async Without Error Handler
|
|
558
623
|
|
|
559
|
-
| Property
|
|
560
|
-
|
|
561
|
-
| **Severity** | Warning
|
|
624
|
+
| Property | Value |
|
|
625
|
+
| ------------ | ----------- |
|
|
626
|
+
| **Severity** | Warning |
|
|
562
627
|
| **Category** | Performance |
|
|
563
|
-
| **Fixable**
|
|
628
|
+
| **Fixable** | No |
|
|
564
629
|
|
|
565
630
|
**Description:** Async scopes should have their own error handling since they don't propagate errors to the parent flow.
|
|
566
631
|
|
|
@@ -570,11 +635,11 @@
|
|
|
570
635
|
|
|
571
636
|
### MULE-503: Large Choice Blocks
|
|
572
637
|
|
|
573
|
-
| Property
|
|
574
|
-
|
|
575
|
-
| **Severity** | Warning
|
|
638
|
+
| Property | Value |
|
|
639
|
+
| ------------ | ----------- |
|
|
640
|
+
| **Severity** | Warning |
|
|
576
641
|
| **Category** | Performance |
|
|
577
|
-
| **Fixable**
|
|
642
|
+
| **Fixable** | No |
|
|
578
643
|
|
|
579
644
|
**Description:** Choice blocks with many when clauses should be refactored to DataWeave lookups or routing slip pattern.
|
|
580
645
|
|
|
@@ -582,20 +647,28 @@
|
|
|
582
647
|
|
|
583
648
|
### PERF-002: Connection Pooling
|
|
584
649
|
|
|
585
|
-
| Property
|
|
586
|
-
|
|
587
|
-
| **Severity** | Warning
|
|
650
|
+
| Property | Value |
|
|
651
|
+
| ------------ | ----------- |
|
|
652
|
+
| **Severity** | Warning |
|
|
588
653
|
| **Category** | Performance |
|
|
589
|
-
| **Fixable**
|
|
654
|
+
| **Fixable** | No |
|
|
590
655
|
|
|
591
656
|
**Description:** DB and HTTP connectors should configure connection pools for optimal performance and resource management.
|
|
592
657
|
|
|
593
|
-
**Check Logic:** Flags HTTP request
|
|
658
|
+
**Check Logic:** Flags HTTP `request-config` elements missing `maxConnections`/`connectionIdleTimeout` — checks both the `<http:request-config>` element and its nested `<http:request-connection>` child (XSD-correct placement). Also flags DB configs missing `pooling-profile`.
|
|
594
659
|
|
|
595
660
|
**Example:**
|
|
661
|
+
|
|
596
662
|
```xml
|
|
597
|
-
<!-- ✅ Good - HTTP with pooling -->
|
|
598
|
-
<http:request-config name="API_Config"
|
|
663
|
+
<!-- ✅ Good - HTTP with pooling on request-connection (XSD-correct) -->
|
|
664
|
+
<http:request-config name="API_Config">
|
|
665
|
+
<http:request-connection>
|
|
666
|
+
<http:client-socket-properties>
|
|
667
|
+
<http:tcp-client-socket-properties connectionTimeout="30000"/>
|
|
668
|
+
</http:client-socket-properties>
|
|
669
|
+
</http:request-connection>
|
|
670
|
+
</http:request-config>
|
|
671
|
+
<!-- maxConnections on http:request-connection avoids SAXParseException -->
|
|
599
672
|
|
|
600
673
|
<!-- ✅ Good - DB with pooling -->
|
|
601
674
|
<db:config name="Database_Config">
|
|
@@ -607,17 +680,18 @@
|
|
|
607
680
|
|
|
608
681
|
### RES-001: Reconnection Strategy
|
|
609
682
|
|
|
610
|
-
| Property
|
|
611
|
-
|
|
612
|
-
| **Severity** | Warning
|
|
683
|
+
| Property | Value |
|
|
684
|
+
| ------------ | ----------- |
|
|
685
|
+
| **Severity** | Warning |
|
|
613
686
|
| **Category** | Performance |
|
|
614
|
-
| **Fixable**
|
|
687
|
+
| **Fixable** | No |
|
|
615
688
|
|
|
616
689
|
**Description:** Connectors should have reconnection strategies configured for resilience.
|
|
617
690
|
|
|
618
691
|
**Checked Connectors:** HTTP Request, HTTP Listener, JMS, AMQP, SFTP, FTP, VM, Database
|
|
619
692
|
|
|
620
693
|
**Example:**
|
|
694
|
+
|
|
621
695
|
```xml
|
|
622
696
|
<!-- ✅ Good -->
|
|
623
697
|
<http:request-config name="API_Config">
|
|
@@ -637,11 +711,11 @@
|
|
|
637
711
|
|
|
638
712
|
### MULE-601: Flow Missing Description
|
|
639
713
|
|
|
640
|
-
| Property
|
|
641
|
-
|
|
642
|
-
| **Severity** | Info
|
|
714
|
+
| Property | Value |
|
|
715
|
+
| ------------ | ------------- |
|
|
716
|
+
| **Severity** | Info |
|
|
643
717
|
| **Category** | Documentation |
|
|
644
|
-
| **Fixable**
|
|
718
|
+
| **Fixable** | No |
|
|
645
719
|
|
|
646
720
|
**Description:** Flows should have a `doc:description` attribute for documentation.
|
|
647
721
|
|
|
@@ -649,11 +723,11 @@
|
|
|
649
723
|
|
|
650
724
|
### MULE-604: Missing doc:name
|
|
651
725
|
|
|
652
|
-
| Property
|
|
653
|
-
|
|
654
|
-
| **Severity** | Warning
|
|
726
|
+
| Property | Value |
|
|
727
|
+
| ------------ | ------------- |
|
|
728
|
+
| **Severity** | Warning |
|
|
655
729
|
| **Category** | Documentation |
|
|
656
|
-
| **Fixable**
|
|
730
|
+
| **Fixable** | No |
|
|
657
731
|
|
|
658
732
|
**Description:** Key components (logger, set-variable, transform, etc.) should have `doc:name` for Anypoint Studio visibility.
|
|
659
733
|
|
|
@@ -661,17 +735,18 @@
|
|
|
661
735
|
|
|
662
736
|
### DOC-001: Display Name Enforcement
|
|
663
737
|
|
|
664
|
-
| Property
|
|
665
|
-
|
|
666
|
-
| **Severity** | Info
|
|
738
|
+
| Property | Value |
|
|
739
|
+
| ------------ | ------------- |
|
|
740
|
+
| **Severity** | Info |
|
|
667
741
|
| **Category** | Documentation |
|
|
668
|
-
| **Fixable**
|
|
742
|
+
| **Fixable** | No |
|
|
669
743
|
|
|
670
744
|
**Description:** Key components should have meaningful `doc:name` attributes, not default/generic names.
|
|
671
745
|
|
|
672
746
|
**Flagged Defaults:** `Set Payload`, `Set Variable`, `Transform Message`, `Flow Reference`, `Logger`, `Choice`
|
|
673
747
|
|
|
674
748
|
**Example:**
|
|
749
|
+
|
|
675
750
|
```xml
|
|
676
751
|
<!-- ❌ Bad - generic default name -->
|
|
677
752
|
<set-payload doc:name="Set Payload" value="#[output application/json --- {}]"/>
|
|
@@ -686,11 +761,11 @@
|
|
|
686
761
|
|
|
687
762
|
### MULE-008: Choice Anti-Pattern
|
|
688
763
|
|
|
689
|
-
| Property
|
|
690
|
-
|
|
691
|
-
| **Severity** | Warning
|
|
764
|
+
| Property | Value |
|
|
765
|
+
| ------------ | --------- |
|
|
766
|
+
| **Severity** | Warning |
|
|
692
767
|
| **Category** | Standards |
|
|
693
|
-
| **Fixable**
|
|
768
|
+
| **Fixable** | No |
|
|
694
769
|
|
|
695
770
|
**Description:** Avoid using `raise-error` directly inside `choice/otherwise`. Use a more descriptive error type.
|
|
696
771
|
|
|
@@ -698,11 +773,11 @@
|
|
|
698
773
|
|
|
699
774
|
### MULE-010: DWL Standards File
|
|
700
775
|
|
|
701
|
-
| Property
|
|
702
|
-
|
|
703
|
-
| **Severity** | Info
|
|
776
|
+
| Property | Value |
|
|
777
|
+
| ------------ | --------- |
|
|
778
|
+
| **Severity** | Info |
|
|
704
779
|
| **Category** | Standards |
|
|
705
|
-
| **Fixable**
|
|
780
|
+
| **Fixable** | No |
|
|
706
781
|
|
|
707
782
|
**Description:** Project should have a standard error DataWeave file at `src/main/resources/dwl/standard-error.dwl`.
|
|
708
783
|
|
|
@@ -710,11 +785,11 @@
|
|
|
710
785
|
|
|
711
786
|
### MULE-701: Deprecated Component Usage
|
|
712
787
|
|
|
713
|
-
| Property
|
|
714
|
-
|
|
715
|
-
| **Severity** | Warning
|
|
788
|
+
| Property | Value |
|
|
789
|
+
| ------------ | --------- |
|
|
790
|
+
| **Severity** | Warning |
|
|
716
791
|
| **Category** | Standards |
|
|
717
|
-
| **Fixable**
|
|
792
|
+
| **Fixable** | No |
|
|
718
793
|
|
|
719
794
|
**Description:** Detect usage of deprecated Mule components.
|
|
720
795
|
|
|
@@ -722,17 +797,18 @@
|
|
|
722
797
|
|
|
723
798
|
### OPS-001: Auto-Discovery Configuration
|
|
724
799
|
|
|
725
|
-
| Property
|
|
726
|
-
|
|
727
|
-
| **Severity** | Info
|
|
800
|
+
| Property | Value |
|
|
801
|
+
| ------------ | --------- |
|
|
802
|
+
| **Severity** | Info |
|
|
728
803
|
| **Category** | Standards |
|
|
729
|
-
| **Fixable**
|
|
804
|
+
| **Fixable** | No |
|
|
730
805
|
|
|
731
806
|
**Description:** APIs should have auto-discovery configured for API Manager integration.
|
|
732
807
|
|
|
733
808
|
**Check Logic:** Flags API projects (those with APIKit router) that are missing `<api-gateway:autodiscovery>`. Also verifies that `apiId` uses a property placeholder.
|
|
734
809
|
|
|
735
810
|
**Example:**
|
|
811
|
+
|
|
736
812
|
```xml
|
|
737
813
|
<!-- ✅ Good -->
|
|
738
814
|
<api-gateway:autodiscovery apiId="${api.id}" flowRef="api-main"/>
|
|
@@ -742,15 +818,16 @@
|
|
|
742
818
|
|
|
743
819
|
### OPS-002: HTTP Port Placeholder
|
|
744
820
|
|
|
745
|
-
| Property
|
|
746
|
-
|
|
747
|
-
| **Severity** | Warning
|
|
821
|
+
| Property | Value |
|
|
822
|
+
| ------------ | --------- |
|
|
823
|
+
| **Severity** | Warning |
|
|
748
824
|
| **Category** | Standards |
|
|
749
|
-
| **Fixable**
|
|
825
|
+
| **Fixable** | No |
|
|
750
826
|
|
|
751
827
|
**Description:** HTTP listener ports should use property placeholders, not hardcoded values.
|
|
752
828
|
|
|
753
829
|
**Example:**
|
|
830
|
+
|
|
754
831
|
```xml
|
|
755
832
|
<!-- ❌ Bad -->
|
|
756
833
|
<http:listener-config port="8081"/>
|
|
@@ -763,15 +840,16 @@
|
|
|
763
840
|
|
|
764
841
|
### OPS-003: Externalized Cron Expression
|
|
765
842
|
|
|
766
|
-
| Property
|
|
767
|
-
|
|
768
|
-
| **Severity** | Warning
|
|
843
|
+
| Property | Value |
|
|
844
|
+
| ------------ | --------- |
|
|
845
|
+
| **Severity** | Warning |
|
|
769
846
|
| **Category** | Standards |
|
|
770
|
-
| **Fixable**
|
|
847
|
+
| **Fixable** | No |
|
|
771
848
|
|
|
772
849
|
**Description:** Cron expressions in schedulers should use property placeholders to allow environment-specific scheduling.
|
|
773
850
|
|
|
774
851
|
**Example:**
|
|
852
|
+
|
|
775
853
|
```xml
|
|
776
854
|
<!-- ❌ Bad -->
|
|
777
855
|
<scheduling-strategy>
|
|
@@ -788,11 +866,11 @@
|
|
|
788
866
|
|
|
789
867
|
### API-005: APIKit Validation
|
|
790
868
|
|
|
791
|
-
| Property
|
|
792
|
-
|
|
793
|
-
| **Severity** | Info
|
|
869
|
+
| Property | Value |
|
|
870
|
+
| ------------ | --------- |
|
|
871
|
+
| **Severity** | Info |
|
|
794
872
|
| **Category** | Standards |
|
|
795
|
-
| **Fixable**
|
|
873
|
+
| **Fixable** | No |
|
|
796
874
|
|
|
797
875
|
**Description:** APIs should use APIKit for auto-generated implementation interfaces.
|
|
798
876
|
|
|
@@ -808,11 +886,11 @@
|
|
|
808
886
|
|
|
809
887
|
### MULE-801: Flow Complexity
|
|
810
888
|
|
|
811
|
-
| Property
|
|
812
|
-
|
|
813
|
-
| **Severity** | Warning
|
|
889
|
+
| Property | Value |
|
|
890
|
+
| ------------ | ---------- |
|
|
891
|
+
| **Severity** | Warning |
|
|
814
892
|
| **Category** | Complexity |
|
|
815
|
-
| **Fixable**
|
|
893
|
+
| **Fixable** | No |
|
|
816
894
|
|
|
817
895
|
**Description:** Flow cyclomatic complexity should not exceed threshold.
|
|
818
896
|
|
|
@@ -831,6 +909,7 @@
|
|
|
831
909
|
| `<on-error-*>` | Error handlers |
|
|
832
910
|
|
|
833
911
|
**Configuration:**
|
|
912
|
+
|
|
834
913
|
```json
|
|
835
914
|
{
|
|
836
915
|
"MULE-801": {
|
|
@@ -850,32 +929,39 @@
|
|
|
850
929
|
|
|
851
930
|
### MULE-802: Project Structure
|
|
852
931
|
|
|
853
|
-
| Property
|
|
854
|
-
|
|
855
|
-
| **Severity** | Warning
|
|
932
|
+
| Property | Value |
|
|
933
|
+
| ------------ | --------- |
|
|
934
|
+
| **Severity** | Warning |
|
|
856
935
|
| **Category** | Structure |
|
|
857
|
-
| **Fixable**
|
|
936
|
+
| **Fixable** | No |
|
|
858
937
|
|
|
859
938
|
**Description:** Validate standard MuleSoft project folder structure.
|
|
860
939
|
|
|
861
940
|
**Required Directories:**
|
|
941
|
+
|
|
862
942
|
- `src/main/mule`
|
|
863
943
|
- `src/main/resources`
|
|
864
944
|
|
|
865
|
-
**Recommended Directories
|
|
945
|
+
**Recommended Directories** (configurable via `recommendedDirs` option):
|
|
946
|
+
|
|
866
947
|
- `src/main/resources/dwl`
|
|
867
|
-
- `src/main/resources/api`
|
|
868
948
|
- `src/test/munit`
|
|
869
949
|
|
|
950
|
+
> **Note:** `src/main/resources/api` was removed from the default recommended list in v1.20.0. Many Mule 4 projects reference their API specification from Anypoint Exchange and do not bundle it locally. To restore this check, configure the rule explicitly:
|
|
951
|
+
>
|
|
952
|
+
> ```json
|
|
953
|
+
> "MULE-802": { "enabled": true, "options": { "recommendedDirs": ["src/main/resources/dwl", "src/main/resources/api", "src/test/munit"] } }
|
|
954
|
+
> ```
|
|
955
|
+
|
|
870
956
|
---
|
|
871
957
|
|
|
872
958
|
### MULE-803: Global Config File
|
|
873
959
|
|
|
874
|
-
| Property
|
|
875
|
-
|
|
876
|
-
| **Severity** | Warning
|
|
960
|
+
| Property | Value |
|
|
961
|
+
| ------------ | --------- |
|
|
962
|
+
| **Severity** | Warning |
|
|
877
963
|
| **Category** | Structure |
|
|
878
|
-
| **Fixable**
|
|
964
|
+
| **Fixable** | No |
|
|
879
965
|
|
|
880
966
|
**Description:** Project should have `global.xml` with shared configurations (HTTP listeners, error handlers, etc.).
|
|
881
967
|
|
|
@@ -883,11 +969,11 @@
|
|
|
883
969
|
|
|
884
970
|
### MULE-804: Monolithic XML File
|
|
885
971
|
|
|
886
|
-
| Property
|
|
887
|
-
|
|
888
|
-
| **Severity** | Warning
|
|
972
|
+
| Property | Value |
|
|
973
|
+
| ------------ | --------- |
|
|
974
|
+
| **Severity** | Warning |
|
|
889
975
|
| **Category** | Structure |
|
|
890
|
-
| **Fixable**
|
|
976
|
+
| **Fixable** | No |
|
|
891
977
|
|
|
892
978
|
**Description:** XML files should not exceed 10 flows/sub-flows. Split large files by domain.
|
|
893
979
|
|
|
@@ -899,32 +985,48 @@
|
|
|
899
985
|
|
|
900
986
|
### YAML-001: Environment Properties Files
|
|
901
987
|
|
|
902
|
-
| Property
|
|
903
|
-
|
|
904
|
-
| **Severity** | Warning
|
|
988
|
+
| Property | Value |
|
|
989
|
+
| ------------ | --------- |
|
|
990
|
+
| **Severity** | Warning |
|
|
905
991
|
| **Category** | Standards |
|
|
906
|
-
| **Fixable**
|
|
992
|
+
| **Fixable** | No |
|
|
907
993
|
|
|
908
994
|
**Description:** Environment-specific YAML property files should exist for each environment.
|
|
909
995
|
|
|
910
|
-
**Expected Files
|
|
996
|
+
**Expected Files** (default environments: `dev`, `qa`, `prod`):
|
|
997
|
+
|
|
911
998
|
- `dev.yaml` or `config-dev.yaml`
|
|
912
999
|
- `qa.yaml` or `config-qa.yaml`
|
|
913
1000
|
- `prod.yaml` or `config-prod.yaml`
|
|
914
1001
|
|
|
1002
|
+
Files can also live in `src/main/resources/config/` or `src/main/resources/properties/` subdirectories.
|
|
1003
|
+
|
|
1004
|
+
**Options:**
|
|
1005
|
+
|
|
1006
|
+
| Option | Default | Description |
|
|
1007
|
+
| -------------- | ----------------------- | ---------------------------------- |
|
|
1008
|
+
| `environments` | `["dev", "qa", "prod"]` | List of required environment names |
|
|
1009
|
+
|
|
1010
|
+
**Example configuration** to add `staging` or change defaults:
|
|
1011
|
+
|
|
1012
|
+
```json
|
|
1013
|
+
"YAML-001": { "enabled": true, "options": { "environments": ["dev", "staging", "prod"] } }
|
|
1014
|
+
```
|
|
1015
|
+
|
|
915
1016
|
---
|
|
916
1017
|
|
|
917
1018
|
### YAML-003: Property Naming Convention
|
|
918
1019
|
|
|
919
|
-
| Property
|
|
920
|
-
|
|
921
|
-
| **Severity** | Info
|
|
1020
|
+
| Property | Value |
|
|
1021
|
+
| ------------ | --------- |
|
|
1022
|
+
| **Severity** | Info |
|
|
922
1023
|
| **Category** | Standards |
|
|
923
|
-
| **Fixable**
|
|
1024
|
+
| **Fixable** | No |
|
|
924
1025
|
|
|
925
1026
|
**Description:** Property keys should follow `category.property` format.
|
|
926
1027
|
|
|
927
1028
|
**Examples:**
|
|
1029
|
+
|
|
928
1030
|
```yaml
|
|
929
1031
|
# ✅ Good
|
|
930
1032
|
db.host: localhost
|
|
@@ -939,15 +1041,16 @@ ApiTimeout: 30000
|
|
|
939
1041
|
|
|
940
1042
|
### YAML-004: No Plaintext Secrets
|
|
941
1043
|
|
|
942
|
-
| Property
|
|
943
|
-
|
|
944
|
-
| **Severity** | Error
|
|
1044
|
+
| Property | Value |
|
|
1045
|
+
| ------------ | -------- |
|
|
1046
|
+
| **Severity** | Error |
|
|
945
1047
|
| **Category** | Security |
|
|
946
|
-
| **Fixable**
|
|
1048
|
+
| **Fixable** | No |
|
|
947
1049
|
|
|
948
1050
|
**Description:** Sensitive properties (passwords, keys, secrets) should be encrypted with `![...]` syntax.
|
|
949
1051
|
|
|
950
1052
|
**Example:**
|
|
1053
|
+
|
|
951
1054
|
```yaml
|
|
952
1055
|
# ❌ Bad - plaintext secret
|
|
953
1056
|
db.password: mySecretPassword
|
|
@@ -964,11 +1067,11 @@ db.password: "![encryptedValue]"
|
|
|
964
1067
|
|
|
965
1068
|
### DW-001: External DWL for Complex Transforms
|
|
966
1069
|
|
|
967
|
-
| Property
|
|
968
|
-
|
|
969
|
-
| **Severity** | Warning
|
|
1070
|
+
| Property | Value |
|
|
1071
|
+
| ------------ | --------- |
|
|
1072
|
+
| **Severity** | Warning |
|
|
970
1073
|
| **Category** | DataWeave |
|
|
971
|
-
| **Fixable**
|
|
1074
|
+
| **Fixable** | No |
|
|
972
1075
|
|
|
973
1076
|
**Description:** Complex DataWeave (10+ lines) should be externalized to `.dwl` files.
|
|
974
1077
|
|
|
@@ -976,23 +1079,38 @@ db.password: "![encryptedValue]"
|
|
|
976
1079
|
|
|
977
1080
|
### DW-002: DWL File Naming
|
|
978
1081
|
|
|
979
|
-
| Property
|
|
980
|
-
|
|
981
|
-
| **Severity** | Info
|
|
1082
|
+
| Property | Value |
|
|
1083
|
+
| ------------ | --------- |
|
|
1084
|
+
| **Severity** | Info |
|
|
982
1085
|
| **Category** | DataWeave |
|
|
983
|
-
| **Fixable**
|
|
1086
|
+
| **Fixable** | No |
|
|
984
1087
|
|
|
985
1088
|
**Description:** DataWeave files should use kebab-case naming (`my-transform.dwl`).
|
|
986
1089
|
|
|
1090
|
+
> **Note on DataWeave module directories:** DataWeave module files **must** use camelCase because hyphens (`-`) are invalid in DataWeave module identifiers (importing `my-module` would be a compile error). Use the `exemptPaths` option to exclude module directories from kebab-case enforcement.
|
|
1091
|
+
|
|
1092
|
+
**Options:**
|
|
1093
|
+
|
|
1094
|
+
| Option | Default | Description |
|
|
1095
|
+
| ------------- | ------------ | ---------------------------------------------------------- |
|
|
1096
|
+
| `convention` | `kebab-case` | Naming convention: `kebab-case`, `camelCase`, or `any` |
|
|
1097
|
+
| `exemptPaths` | `[]` | Glob patterns for paths to skip (e.g. `["**/modules/**"]`) |
|
|
1098
|
+
|
|
1099
|
+
**Example configuration** to exempt a modules directory:
|
|
1100
|
+
|
|
1101
|
+
```json
|
|
1102
|
+
"DW-002": { "enabled": true, "options": { "exemptPaths": ["**/modules/**", "**/lib/**"] } }
|
|
1103
|
+
```
|
|
1104
|
+
|
|
987
1105
|
---
|
|
988
1106
|
|
|
989
1107
|
### DW-003: DWL Modules
|
|
990
1108
|
|
|
991
|
-
| Property
|
|
992
|
-
|
|
993
|
-
| **Severity** | Info
|
|
1109
|
+
| Property | Value |
|
|
1110
|
+
| ------------ | --------- |
|
|
1111
|
+
| **Severity** | Info |
|
|
994
1112
|
| **Category** | DataWeave |
|
|
995
|
-
| **Fixable**
|
|
1113
|
+
| **Fixable** | No |
|
|
996
1114
|
|
|
997
1115
|
**Description:** Project should have common reusable DataWeave modules (`common.dwl`, `utils.dwl`).
|
|
998
1116
|
|
|
@@ -1000,24 +1118,25 @@ db.password: "![encryptedValue]"
|
|
|
1000
1118
|
|
|
1001
1119
|
### DW-004: Java 17 DataWeave Error Handling
|
|
1002
1120
|
|
|
1003
|
-
| Property
|
|
1004
|
-
|
|
1005
|
-
| **Severity** | Error
|
|
1121
|
+
| Property | Value |
|
|
1122
|
+
| ------------ | --------- |
|
|
1123
|
+
| **Severity** | Error |
|
|
1006
1124
|
| **Category** | DataWeave |
|
|
1007
|
-
| **Fixable**
|
|
1125
|
+
| **Fixable** | No |
|
|
1008
1126
|
|
|
1009
1127
|
**Description:** Enforces DataWeave error handling patterns compatible with Java 17 encapsulation. Detects restricted property access patterns that fail at runtime on Java 17.
|
|
1010
1128
|
|
|
1011
1129
|
**Forbidden Patterns & Replacements:**
|
|
1012
1130
|
|
|
1013
|
-
| Forbidden
|
|
1014
|
-
|
|
1015
|
-
| `error.description`
|
|
1131
|
+
| Forbidden | Replacement |
|
|
1132
|
+
| -------------------------- | ---------------------------------------------------------------- |
|
|
1133
|
+
| `error.description` | `error.detailedDescription` |
|
|
1016
1134
|
| `error.errorType.asString` | `error.errorType.namespace ++ ":" ++ error.errorType.identifier` |
|
|
1017
|
-
| `error.muleMessage`
|
|
1018
|
-
| `error.errors`
|
|
1135
|
+
| `error.muleMessage` | `error.errorMessage` |
|
|
1136
|
+
| `error.errors` | `error.childErrors` |
|
|
1019
1137
|
|
|
1020
1138
|
**Example:**
|
|
1139
|
+
|
|
1021
1140
|
```dataweave
|
|
1022
1141
|
// ❌ Bad - restricted in Java 17
|
|
1023
1142
|
error.description
|
|
@@ -1033,17 +1152,18 @@ error.errorType.namespace ++ ":" ++ error.errorType.identifier
|
|
|
1033
1152
|
## API-Led Rules
|
|
1034
1153
|
|
|
1035
1154
|
> **Best Practice**: Follow API-Led Connectivity architecture with clear layer separation:
|
|
1155
|
+
>
|
|
1036
1156
|
> - **Experience Layer**: Channel-specific APIs (web, mobile)
|
|
1037
1157
|
> - **Process Layer**: Orchestration and business logic
|
|
1038
1158
|
> - **System Layer**: Backend system connectivity
|
|
1039
1159
|
|
|
1040
1160
|
### API-001: Experience Layer Pattern
|
|
1041
1161
|
|
|
1042
|
-
| Property
|
|
1043
|
-
|
|
1044
|
-
| **Severity** | Info
|
|
1162
|
+
| Property | Value |
|
|
1163
|
+
| ------------ | ------- |
|
|
1164
|
+
| **Severity** | Info |
|
|
1045
1165
|
| **Category** | API-Led |
|
|
1046
|
-
| **Fixable**
|
|
1166
|
+
| **Fixable** | No |
|
|
1047
1167
|
|
|
1048
1168
|
**Description:** Experience layer APIs (with `-exp-` in name) should have HTTP listeners as entry points.
|
|
1049
1169
|
|
|
@@ -1051,11 +1171,11 @@ error.errorType.namespace ++ ":" ++ error.errorType.identifier
|
|
|
1051
1171
|
|
|
1052
1172
|
### API-002: Process Layer Pattern
|
|
1053
1173
|
|
|
1054
|
-
| Property
|
|
1055
|
-
|
|
1056
|
-
| **Severity** | Info
|
|
1174
|
+
| Property | Value |
|
|
1175
|
+
| ------------ | ------- |
|
|
1176
|
+
| **Severity** | Info |
|
|
1057
1177
|
| **Category** | API-Led |
|
|
1058
|
-
| **Fixable**
|
|
1178
|
+
| **Fixable** | No |
|
|
1059
1179
|
|
|
1060
1180
|
**Description:** Process layer APIs (with `-proc-` in name) should orchestrate other APIs via flow-refs or HTTP requests.
|
|
1061
1181
|
|
|
@@ -1063,11 +1183,11 @@ error.errorType.namespace ++ ":" ++ error.errorType.identifier
|
|
|
1063
1183
|
|
|
1064
1184
|
### API-003: System Layer Pattern
|
|
1065
1185
|
|
|
1066
|
-
| Property
|
|
1067
|
-
|
|
1068
|
-
| **Severity** | Info
|
|
1186
|
+
| Property | Value |
|
|
1187
|
+
| ------------ | ------- |
|
|
1188
|
+
| **Severity** | Info |
|
|
1069
1189
|
| **Category** | API-Led |
|
|
1070
|
-
| **Fixable**
|
|
1190
|
+
| **Fixable** | No |
|
|
1071
1191
|
|
|
1072
1192
|
**Description:** System layer APIs (with `-sys-` in name) should connect to external systems (databases, HTTP services).
|
|
1073
1193
|
|
|
@@ -1075,11 +1195,11 @@ error.errorType.namespace ++ ":" ++ error.errorType.identifier
|
|
|
1075
1195
|
|
|
1076
1196
|
### API-004: Single System Per SAPI
|
|
1077
1197
|
|
|
1078
|
-
| Property
|
|
1079
|
-
|
|
1198
|
+
| Property | Value |
|
|
1199
|
+
| ------------ | ------- |
|
|
1080
1200
|
| **Severity** | Warning |
|
|
1081
1201
|
| **Category** | API-Led |
|
|
1082
|
-
| **Fixable**
|
|
1202
|
+
| **Fixable** | No |
|
|
1083
1203
|
|
|
1084
1204
|
**Description:** System API should integrate with only one backend system. This promotes clear separation of concerns, easier maintenance, better reusability, and simplified error handling.
|
|
1085
1205
|
|
|
@@ -1093,11 +1213,11 @@ error.errorType.namespace ++ ":" ++ error.errorType.identifier
|
|
|
1093
1213
|
|
|
1094
1214
|
### HYG-002: Commented Code Detection
|
|
1095
1215
|
|
|
1096
|
-
| Property
|
|
1097
|
-
|
|
1098
|
-
| **Severity** | Info
|
|
1216
|
+
| Property | Value |
|
|
1217
|
+
| ------------ | --------- |
|
|
1218
|
+
| **Severity** | Info |
|
|
1099
1219
|
| **Category** | Standards |
|
|
1100
|
-
| **Fixable**
|
|
1220
|
+
| **Fixable** | No |
|
|
1101
1221
|
|
|
1102
1222
|
**Description:** Detects potentially commented-out code blocks in Mule configurations.
|
|
1103
1223
|
|
|
@@ -1109,16 +1229,18 @@ error.errorType.namespace ++ ":" ++ error.errorType.identifier
|
|
|
1109
1229
|
|
|
1110
1230
|
### HYG-003: Unused Flow Detection
|
|
1111
1231
|
|
|
1112
|
-
| Property
|
|
1113
|
-
|
|
1114
|
-
| **Severity** | Warning
|
|
1232
|
+
| Property | Value |
|
|
1233
|
+
| ------------ | --------- |
|
|
1234
|
+
| **Severity** | Warning |
|
|
1115
1235
|
| **Category** | Standards |
|
|
1116
|
-
| **Fixable**
|
|
1236
|
+
| **Fixable** | No |
|
|
1117
1237
|
|
|
1118
|
-
**Description:** Detects flows and sub-flows that are never referenced by `flow-ref`
|
|
1238
|
+
**Description:** Detects flows and sub-flows that are never referenced by `flow-ref` across the entire project.
|
|
1119
1239
|
|
|
1120
1240
|
**Check Logic:**
|
|
1121
|
-
|
|
1241
|
+
|
|
1242
|
+
- **Cross-file detection**: The engine pre-scans all XML files to collect every `<flow-ref name="...">` target before running rules. A sub-flow or flow is only flagged if it is not referenced in _any_ file in the project.
|
|
1243
|
+
- **Sub-flows**: Always expected to be referenced; flagged if no `flow-ref` points to them anywhere in the project.
|
|
1122
1244
|
- **Flows without triggers**: Flows that have no HTTP listener, scheduler, or VM listener and aren't referenced are flagged.
|
|
1123
1245
|
- **Exclusions**: Flows matching common external patterns (`-main`, `-api`, `api-`, `-console`, `-error-handler`, `global`) are excluded.
|
|
1124
1246
|
|
|
@@ -1128,15 +1250,16 @@ error.errorType.namespace ++ ":" ++ error.errorType.identifier
|
|
|
1128
1250
|
|
|
1129
1251
|
### PROJ-001: POM Validation
|
|
1130
1252
|
|
|
1131
|
-
| Property
|
|
1132
|
-
|
|
1133
|
-
| **Severity** | Error
|
|
1253
|
+
| Property | Value |
|
|
1254
|
+
| ------------ | --------- |
|
|
1255
|
+
| **Severity** | Error |
|
|
1134
1256
|
| **Category** | Structure |
|
|
1135
|
-
| **Fixable**
|
|
1257
|
+
| **Fixable** | No |
|
|
1136
1258
|
|
|
1137
1259
|
**Description:** Validates `pom.xml` existence and critical plugins.
|
|
1138
1260
|
|
|
1139
1261
|
**Checks:**
|
|
1262
|
+
|
|
1140
1263
|
1. `pom.xml` exists in project root
|
|
1141
1264
|
2. Contains `mule-maven-plugin` in build configuration
|
|
1142
1265
|
3. Contains `munit-maven-plugin` if test files exist
|
|
@@ -1145,11 +1268,11 @@ error.errorType.namespace ++ ":" ++ error.errorType.identifier
|
|
|
1145
1268
|
|
|
1146
1269
|
### PROJ-002: Git Hygiene
|
|
1147
1270
|
|
|
1148
|
-
| Property
|
|
1149
|
-
|
|
1150
|
-
| **Severity** | Warning
|
|
1271
|
+
| Property | Value |
|
|
1272
|
+
| ------------ | --------- |
|
|
1273
|
+
| **Severity** | Warning |
|
|
1151
1274
|
| **Category** | Structure |
|
|
1152
|
-
| **Fixable**
|
|
1275
|
+
| **Fixable** | No |
|
|
1153
1276
|
|
|
1154
1277
|
**Description:** Validates `.gitignore` existence and standard entries in git repositories.
|
|
1155
1278
|
|
|
@@ -1163,11 +1286,11 @@ error.errorType.namespace ++ ":" ++ error.errorType.identifier
|
|
|
1163
1286
|
|
|
1164
1287
|
### EXP-001: Flow Reference Depth
|
|
1165
1288
|
|
|
1166
|
-
| Property
|
|
1167
|
-
|
|
1168
|
-
| **Severity** | Info
|
|
1289
|
+
| Property | Value |
|
|
1290
|
+
| ------------ | ------------ |
|
|
1291
|
+
| **Severity** | Info |
|
|
1169
1292
|
| **Category** | Experimental |
|
|
1170
|
-
| **Fixable**
|
|
1293
|
+
| **Fixable** | No |
|
|
1171
1294
|
|
|
1172
1295
|
**Description:** Limit the number of flow-refs in a single flow to avoid deep call chains.
|
|
1173
1296
|
|
|
@@ -1175,11 +1298,11 @@ error.errorType.namespace ++ ":" ++ error.errorType.identifier
|
|
|
1175
1298
|
|
|
1176
1299
|
### EXP-002: Connector Config Naming
|
|
1177
1300
|
|
|
1178
|
-
| Property
|
|
1179
|
-
|
|
1180
|
-
| **Severity** | Info
|
|
1301
|
+
| Property | Value |
|
|
1302
|
+
| ------------ | ------------ |
|
|
1303
|
+
| **Severity** | Info |
|
|
1181
1304
|
| **Category** | Experimental |
|
|
1182
|
-
| **Fixable**
|
|
1305
|
+
| **Fixable** | No |
|
|
1183
1306
|
|
|
1184
1307
|
**Description:** Connector configurations should follow `Convention_Type` pattern (e.g., `HTTP_Request_Config`).
|
|
1185
1308
|
|
|
@@ -1187,11 +1310,11 @@ error.errorType.namespace ++ ":" ++ error.errorType.identifier
|
|
|
1187
1310
|
|
|
1188
1311
|
### EXP-003: MUnit Coverage
|
|
1189
1312
|
|
|
1190
|
-
| Property
|
|
1191
|
-
|
|
1192
|
-
| **Severity** | Info
|
|
1313
|
+
| Property | Value |
|
|
1314
|
+
| ------------ | ------------ |
|
|
1315
|
+
| **Severity** | Info |
|
|
1193
1316
|
| **Category** | Experimental |
|
|
1194
|
-
| **Fixable**
|
|
1317
|
+
| **Fixable** | No |
|
|
1195
1318
|
|
|
1196
1319
|
**Description:** Flows should have corresponding MUnit tests in `src/test/munit`.
|
|
1197
1320
|
|
|
@@ -1199,11 +1322,11 @@ error.errorType.namespace ++ ":" ++ error.errorType.identifier
|
|
|
1199
1322
|
|
|
1200
1323
|
## Rule Priority Matrix
|
|
1201
1324
|
|
|
1202
|
-
| Severity | Count | Rules
|
|
1203
|
-
|
|
1204
|
-
| Error
|
|
1205
|
-
| Warning
|
|
1206
|
-
| Info
|
|
1325
|
+
| Severity | Count | Rules |
|
|
1326
|
+
| -------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1327
|
+
| Error | 10 | MULE-001, 003, 004, 201, 202, SEC-002, SEC-006, LOG-004, DW-004, YAML-004, PROJ-001 |
|
|
1328
|
+
| Warning | 25 | MULE-002, 005, 006, 007, 008, 009, 101, 102, 301, 303, 401, 402, 403, 502, 503, 604, 701, 801, 802, 803, 804, SEC-003, SEC-004, PERF-002, RES-001, OPS-002, OPS-003, HYG-001, HYG-003, API-004, PROJ-002 |
|
|
1329
|
+
| Info | 21 | MULE-010, 501, 601, YAML-001, 003, DW-001, 002, 003, API-001, 002, 003, 005, EXP-001, 002, 003, ERR-001, LOG-001, OPS-001, DOC-001, HYG-002 |
|
|
1207
1330
|
|
|
1208
1331
|
---
|
|
1209
1332
|
|