vibecodingmachine-core 2026.2.26-1739 → 2026.3.9-850
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/package.json +1 -1
- package/src/agents/AgentCheckDiscoveryService.js +180 -0
- package/src/agents/AgentCheckService.js +18 -261
- package/src/agents/AgentCheckStatisticsService.js +195 -0
- package/src/agents/EnvironmentConfigurationManager.js +31 -380
- package/src/agents/InstallationType.js +19 -6
- package/src/agents/SimpleAgentCheckService.js +472 -0
- package/src/agents/config-managers/ConfigUtils.js +72 -0
- package/src/agents/config-managers/DefaultConfig.js +58 -0
- package/src/agents/config-managers/EnvVarLoader.js +66 -0
- package/src/agents/config-managers/FileConfigLoader.js +124 -0
- package/src/agents/config-managers/TypeConverters.js +61 -0
- package/src/agents/config-managers/VariableMappings.js +92 -0
- package/src/agents/discovery/AgentDiscoveryService-refactored.js +272 -0
- package/src/agents/discovery/AgentDiscoveryService.js +29 -403
- package/src/agents/discovery/agent-validator.js +262 -0
- package/src/agents/discovery/discovery-results.js +176 -0
- package/src/agents/discovery/discovery-scanner.js +268 -0
- package/src/agents/discovery/discovery-utils.js +161 -0
- package/src/agents/discovery/executable-analyzer.js +290 -0
- package/src/agents/discovery/history-manager.js +310 -0
- package/src/agents/verification/ResultAnalyzer-refactored.js +341 -0
- package/src/agents/verification/ResultAnalyzer.js +30 -431
- package/src/agents/verification/analysis-utils.js +310 -0
- package/src/agents/verification/batch-analyzer.js +440 -0
- package/src/agents/verification/pattern-recognizer.js +369 -0
- package/src/agents/verification/report-generator.js +320 -0
- package/src/agents/verification/test-analyzer.js +290 -0
- package/src/agents/windows/InstallerFactory.js +4 -0
- package/src/agents/windows/VSCodeExtensionInstaller.js +404 -0
- package/src/analysis/analysis-engine.js +314 -0
- package/src/analysis/ast-analyzer.js +342 -0
- package/src/analysis/boundary-detector-refactored.js +378 -0
- package/src/analysis/boundary-detector.js +200 -603
- package/src/analysis/boundary-scanner.js +609 -0
- package/src/analysis/boundary-types.js +118 -0
- package/src/analysis/boundary-utils.js +293 -0
- package/src/analysis/deadline-priority-calculator.js +18 -0
- package/src/analysis/detection-methods.js +347 -0
- package/src/analysis/importance-priority-calculator.js +18 -0
- package/src/analysis/priority/factor-calculators.js +204 -0
- package/src/analysis/priority/factor-helpers.js +71 -0
- package/src/analysis/priority/priority-constants.js +73 -0
- package/src/analysis/priority/priority-factor-calculators.js +301 -0
- package/src/analysis/priority/reasons-generator.js +44 -0
- package/src/analysis/priority-calculator.js +15 -580
- package/src/analysis/strategy-generator.js +16 -66
- package/src/analysis/type-priority-calculator.js +18 -0
- package/src/analysis/urgency-priority-calculator.js +18 -0
- package/src/auto-mode/AutoModeBusinessLogic.js +2 -40
- package/src/commands/disable-requirement.js +60 -0
- package/src/commands/disable-spec.js +60 -0
- package/src/commands/enable-requirement.js +60 -0
- package/src/commands/enable-spec.js +60 -0
- package/src/commands/registry.js +1 -6
- package/src/commands/requirements.js +8 -2
- package/src/ide-integration/applescript-manager.cjs +9 -24
- package/src/ide-integration/cdp-handlers/chat-reader.js +44 -0
- package/src/ide-integration/cdp-handlers/connection-handler.js +88 -0
- package/src/ide-integration/cdp-handlers/continuation-handler.js +314 -0
- package/src/ide-integration/cdp-handlers/message-submitter.js +75 -0
- package/src/ide-integration/cdp-handlers/text-sender.js +138 -0
- package/src/ide-integration/cdp-manager.js +28 -573
- package/src/ide-integration/claude-code-cli-manager.cjs +48 -12
- package/src/ide-integration/ide-openers/claude-opener.js +171 -0
- package/src/ide-integration/ide-openers/cursor-opener.js +53 -0
- package/src/ide-integration/ide-openers/other-ides-opener.js +230 -0
- package/src/ide-integration/ide-openers/vscode-opener.js +147 -0
- package/src/ide-integration/macos-ide-manager.js +20 -582
- package/src/ide-integration/macos-quota-checker.js +164 -0
- package/src/ide-integration/macos-text-sender.js +19 -38
- package/src/ide-integration/provider-manager.cjs +52 -7
- package/src/index.cjs +6 -0
- package/src/index.js +10 -0
- package/src/llm/direct-llm-manager.cjs +501 -0
- package/src/localization/translations/en-part1.js +363 -0
- package/src/localization/translations/en-part2.js +320 -0
- package/src/localization/translations/en.js +4 -687
- package/src/localization/translations/es-part1.js +363 -0
- package/src/localization/translations/es-part2.js +320 -0
- package/src/localization/translations/es.js +4 -688
- package/src/models/file-analysis-collection.js +139 -0
- package/src/models/file-analysis-metrics.js +50 -0
- package/src/models/file-analysis.js +15 -262
- package/src/models/plan-manager.js +410 -0
- package/src/models/refactoring-models.js +380 -0
- package/src/models/refactoring-plan-refactored.js +81 -0
- package/src/models/refactoring-plan.js +2 -663
- package/src/monitoring/alert-system.js +4 -45
- package/src/monitoring/continuous-scan-notifications.js +37 -191
- package/src/monitoring/notification-handlers/base-handler.js +58 -0
- package/src/monitoring/notification-handlers/error-handler.js +36 -0
- package/src/monitoring/notification-handlers/index.js +21 -0
- package/src/monitoring/notification-handlers/new-violation-handler.js +91 -0
- package/src/monitoring/notification-handlers/progress-handler.js +48 -0
- package/src/monitoring/notification-handlers/resolved-violation-handler.js +54 -0
- package/src/monitoring/notification-handlers/threshold-handler.js +36 -0
- package/src/provider-registry.js +8 -0
- package/src/refactoring/boundary/boundary-detector-refactored.js +58 -0
- package/src/refactoring/boundary/boundary-detector.js +26 -596
- package/src/refactoring/boundary/detectors/boundary-analyzers.js +281 -0
- package/src/refactoring/boundary/detectors/boundary-core.js +167 -0
- package/src/refactoring/boundary/detectors/class-detector.js +247 -0
- package/src/refactoring/boundary/detectors/config-detector.js +270 -0
- package/src/refactoring/boundary/detectors/constant-detector.js +269 -0
- package/src/refactoring/boundary/detectors/function-detector.js +248 -0
- package/src/refactoring/boundary/detectors/module-detector.js +249 -0
- package/src/refactoring/boundary/detectors/object-detector.js +247 -0
- package/src/refactoring/boundary/detectors/type-detectors.js +338 -0
- package/src/refactoring/boundary/detectors/utility-detector.js +270 -0
- package/src/refactoring/circular-dependency-resolver-original.js +16 -76
- package/src/refactoring/code-mover-refactored.js +309 -0
- package/src/refactoring/code-mover.js +48 -355
- package/src/refactoring/execution-status.js +18 -0
- package/src/refactoring/execution-strategies.js +172 -0
- package/src/refactoring/file-splitter-core.js +568 -0
- package/src/refactoring/file-splitter-types.js +136 -0
- package/src/refactoring/file-splitter.js +2 -682
- package/src/refactoring/functionality-validator.js +11 -51
- package/src/refactoring/import-manager-refactored.js +385 -0
- package/src/refactoring/import-manager.js +112 -487
- package/src/refactoring/import-models.js +189 -0
- package/src/refactoring/import-parser.js +306 -0
- package/src/refactoring/move-executor.js +431 -0
- package/src/refactoring/move-utils.js +368 -0
- package/src/refactoring/operation-executor.js +76 -0
- package/src/refactoring/plan-creator.js +36 -0
- package/src/refactoring/plan-executor.js +143 -0
- package/src/refactoring/plan-validator.js +68 -0
- package/src/refactoring/refactoring-executor-result.js +70 -0
- package/src/refactoring/refactoring-executor.js +34 -569
- package/src/refactoring/refactoring-operation.js +94 -0
- package/src/refactoring/refactoring-plan.js +69 -0
- package/src/refactoring/refactoring-rollback.js +22 -527
- package/src/refactoring/rollback-handlers/RollbackExecutor.js +107 -0
- package/src/refactoring/rollback-handlers/RollbackManager.js +265 -0
- package/src/refactoring/rollback-handlers/RollbackOperation.js +105 -0
- package/src/refactoring/rollback-handlers/RollbackResult.js +109 -0
- package/src/refactoring/rollback-handlers/RollbackStatistics.js +77 -0
- package/src/refactoring/test-validator.js +32 -448
- package/src/refactoring/validation/baseline-runner.js +71 -0
- package/src/refactoring/validation/report-generator.js +136 -0
- package/src/refactoring/validation/result-comparator.js +92 -0
- package/src/refactoring/validation/test-suite.js +59 -0
- package/src/refactoring/validation/test-validation-result.js +83 -0
- package/src/refactoring/validation/validation-runner.js +95 -0
- package/src/refactoring/validation/validation-status.js +18 -0
- package/src/rui/commands/AgentCommandParser.js +60 -369
- package/src/rui/commands/AgentResponseFormatter.js +7 -47
- package/src/rui/commands/parsers/CommandMapper.js +148 -0
- package/src/rui/commands/parsers/CommandValidator.js +228 -0
- package/src/rui/commands/parsers/ComponentExtractor.js +100 -0
- package/src/rui/commands/parsers/TokenParser.js +69 -0
- package/src/rui/commands/parsers/tokenizer.js +153 -0
- package/src/utils/current-requirement-operations.js +50 -1
- package/src/utils/report-generator.js +18 -514
- package/src/utils/report-generators/analysis-generator.js +115 -0
- package/src/utils/report-generators/base-generator.js +141 -0
- package/src/utils/report-generators/compliance-generator.js +41 -0
- package/src/utils/report-generators/format-handlers.js +185 -0
- package/src/utils/report-generators/refactoring-generator.js +46 -0
- package/src/utils/report-generators/validation-generator.js +63 -0
- package/src/utils/requirement-enable-disable.js +265 -0
- package/src/utils/requirement-helpers/requirement-file-ops.js +69 -1
- package/src/utils/requirement-helpers/requirement-mover.js +88 -1
- package/src/utils/requirement-helpers.js +5 -2
- package/src/utils/smoke-test-cli.js +45 -8
- package/src/utils/specification-enable-disable.js +122 -0
- package/src/utils/specification-helpers.js +30 -4
- package/src/utils/specification-migration.js +5 -5
- package/src/utils/test-comparator.js +118 -0
- package/src/utils/test-config.js +54 -0
- package/src/utils/test-executor.js +133 -0
- package/src/utils/test-parser.js +215 -0
- package/src/utils/test-runner-baseline.js +63 -0
- package/src/utils/test-runner-core.js +98 -0
- package/src/utils/test-runner-report.js +39 -0
- package/src/utils/test-runner-validation.js +71 -0
- package/src/utils/test-runner.js +11 -535
- package/src/validation/comparison-analyzer.js +333 -0
- package/src/validation/compliance-reporter-new.js +282 -0
- package/src/validation/compliance-reporter-refactored.js +344 -0
- package/src/validation/compliance-reporter.js +278 -591
- package/src/validation/compliance-utils.js +278 -0
- package/src/validation/html-generator.js +446 -0
- package/src/validation/metrics/category-calculator.js +137 -0
- package/src/validation/metrics/metrics-helpers.js +155 -0
- package/src/validation/metrics/overview-calculator.js +85 -0
- package/src/validation/metrics/overview-metrics.js +41 -0
- package/src/validation/metrics/quality-calculator.js +166 -0
- package/src/validation/metrics/size-calculator.js +69 -0
- package/src/validation/metrics-calculator.js +27 -551
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compliance Report Utilities
|
|
3
|
+
*
|
|
4
|
+
* Utility functions for compliance reporting and analysis.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const { ComplianceReport, FileComplianceSummary, ComplianceIssue } = require('../models/compliance-report');
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Create compliance report from validation results
|
|
11
|
+
* @param {Array} validationResults - Array of validation results
|
|
12
|
+
* @param {Object} options - Report options
|
|
13
|
+
* @returns {ComplianceReport} - Compliance report
|
|
14
|
+
*/
|
|
15
|
+
function createComplianceReport(validationResults, options = {}) {
|
|
16
|
+
const report = new ComplianceReport();
|
|
17
|
+
|
|
18
|
+
// Process validation results
|
|
19
|
+
validationResults.forEach(result => {
|
|
20
|
+
if (result.compliant) {
|
|
21
|
+
report.addCompliantFile(result.filePath, result.metrics);
|
|
22
|
+
} else {
|
|
23
|
+
report.addNonCompliantFile(result.filePath, result.issues);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
// Add metadata
|
|
28
|
+
report.addMetadata({
|
|
29
|
+
generatedAt: new Date().toISOString(),
|
|
30
|
+
totalFiles: validationResults.length,
|
|
31
|
+
options: options
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
return report;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Calculate compliance metrics
|
|
39
|
+
* @param {ComplianceReport} report - Compliance report
|
|
40
|
+
* @returns {Object} - Calculated metrics
|
|
41
|
+
*/
|
|
42
|
+
function calculateComplianceMetrics(report) {
|
|
43
|
+
const totalFiles = report.compliantFiles.length + report.nonCompliantFiles.length;
|
|
44
|
+
const complianceRate = totalFiles > 0 ? (report.compliantFiles.length / totalFiles * 100) : 0;
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
totalFiles,
|
|
48
|
+
compliantFiles: report.compliantFiles.length,
|
|
49
|
+
nonCompliantFiles: report.nonCompliantFiles.length,
|
|
50
|
+
complianceRate: complianceRate.toFixed(2),
|
|
51
|
+
totalIssues: report.getTotalIssues(),
|
|
52
|
+
issuesByCategory: groupIssuesByCategory(report),
|
|
53
|
+
issuesBySeverity: groupIssuesBySeverity(report),
|
|
54
|
+
averageFileSize: calculateAverageFileSize(report),
|
|
55
|
+
largestFiles: findLargestFiles(report),
|
|
56
|
+
mostCommonIssues: findMostCommonIssues(report)
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Group issues by category
|
|
62
|
+
* @param {ComplianceReport} report - Compliance report
|
|
63
|
+
* @returns {Object} - Issues grouped by category
|
|
64
|
+
*/
|
|
65
|
+
function groupIssuesByCategory(report) {
|
|
66
|
+
const categories = {};
|
|
67
|
+
|
|
68
|
+
report.nonCompliantFiles.forEach(file => {
|
|
69
|
+
file.issues.forEach(issue => {
|
|
70
|
+
const category = issue.category || 'general';
|
|
71
|
+
categories[category] = (categories[category] || 0) + 1;
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
return categories;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Group issues by severity
|
|
80
|
+
* @param {ComplianceReport} report - Compliance report
|
|
81
|
+
* @returns {Object} - Issues grouped by severity
|
|
82
|
+
*/
|
|
83
|
+
function groupIssuesBySeverity(report) {
|
|
84
|
+
const severities = {
|
|
85
|
+
critical: 0,
|
|
86
|
+
high: 0,
|
|
87
|
+
medium: 0,
|
|
88
|
+
low: 0,
|
|
89
|
+
info: 0
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
report.nonCompliantFiles.forEach(file => {
|
|
93
|
+
file.issues.forEach(issue => {
|
|
94
|
+
const severity = issue.severity || 'medium';
|
|
95
|
+
if (severities[severity] !== undefined) {
|
|
96
|
+
severities[severity]++;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
return severities;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Calculate average file size
|
|
106
|
+
* @param {ComplianceReport} report - Compliance report
|
|
107
|
+
* @returns {number} - Average file size
|
|
108
|
+
*/
|
|
109
|
+
function calculateAverageFileSize(report) {
|
|
110
|
+
const allFiles = [...report.compliantFiles, ...report.nonCompliantFiles];
|
|
111
|
+
const totalSize = allFiles.reduce((sum, file) => sum + (file.size || 0), 0);
|
|
112
|
+
return allFiles.length > 0 ? totalSize / allFiles.length : 0;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Find largest files
|
|
117
|
+
* @param {ComplianceReport} report - Compliance report
|
|
118
|
+
* @returns {Array} - Array of largest files
|
|
119
|
+
*/
|
|
120
|
+
function findLargestFiles(report) {
|
|
121
|
+
const allFiles = [...report.compliantFiles, ...report.nonCompliantFiles];
|
|
122
|
+
return allFiles
|
|
123
|
+
.sort((a, b) => (b.size || 0) - (a.size || 0))
|
|
124
|
+
.slice(0, 10);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Find most common issues
|
|
129
|
+
* @param {ComplianceReport} report - Compliance report
|
|
130
|
+
* @returns {Array} - Array of common issues
|
|
131
|
+
*/
|
|
132
|
+
function findMostCommonIssues(report) {
|
|
133
|
+
const issueCounts = {};
|
|
134
|
+
|
|
135
|
+
report.nonCompliantFiles.forEach(file => {
|
|
136
|
+
file.issues.forEach(issue => {
|
|
137
|
+
const key = `${issue.category}:${issue.type}`;
|
|
138
|
+
issueCounts[key] = (issueCounts[key] || 0) + 1;
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
return Object.entries(issueCounts)
|
|
143
|
+
.sort(([, a], [, b]) => b - a)
|
|
144
|
+
.slice(0, 10)
|
|
145
|
+
.map(([key, count]) => ({
|
|
146
|
+
key,
|
|
147
|
+
count,
|
|
148
|
+
category: key.split(':')[0],
|
|
149
|
+
type: key.split(':')[1]
|
|
150
|
+
}));
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Generate compliance recommendations
|
|
155
|
+
* @param {ComplianceReport} report - Compliance report
|
|
156
|
+
* @returns {Array} - Array of recommendations
|
|
157
|
+
*/
|
|
158
|
+
function generateComplianceRecommendations(report) {
|
|
159
|
+
const recommendations = [];
|
|
160
|
+
const metrics = calculateComplianceMetrics(report);
|
|
161
|
+
|
|
162
|
+
// Overall compliance recommendations
|
|
163
|
+
if (metrics.complianceRate < 80) {
|
|
164
|
+
recommendations.push({
|
|
165
|
+
type: 'compliance',
|
|
166
|
+
priority: 'high',
|
|
167
|
+
title: 'Low Compliance Rate',
|
|
168
|
+
description: `Overall compliance rate is ${metrics.complianceRate}%, below target of 80%`,
|
|
169
|
+
action: 'review_and_fix_non_compliant_files'
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// Critical issues recommendations
|
|
174
|
+
if (metrics.issuesBySeverity.critical > 0) {
|
|
175
|
+
recommendations.push({
|
|
176
|
+
type: 'critical_issues',
|
|
177
|
+
priority: 'critical',
|
|
178
|
+
title: 'Critical Compliance Issues',
|
|
179
|
+
description: `${metrics.issuesBySeverity.critical} critical issues found that require immediate attention`,
|
|
180
|
+
action: 'address_critical_issues_first'
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// File size recommendations
|
|
185
|
+
if (metrics.averageFileSize > 800) {
|
|
186
|
+
recommendations.push({
|
|
187
|
+
type: 'file_size',
|
|
188
|
+
priority: 'medium',
|
|
189
|
+
title: 'Large File Sizes',
|
|
190
|
+
description: `Average file size is ${metrics.averageFileSize} lines, exceeding the 800-line limit`,
|
|
191
|
+
action: 'refactor_large_files'
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// Most common issue categories
|
|
196
|
+
const topCategories = Object.entries(metrics.issuesByCategory)
|
|
197
|
+
.sort(([, a], [, b]) => b - a)
|
|
198
|
+
.slice(0, 3);
|
|
199
|
+
|
|
200
|
+
if (topCategories.length > 0) {
|
|
201
|
+
recommendations.push({
|
|
202
|
+
type: 'common_issues',
|
|
203
|
+
priority: 'medium',
|
|
204
|
+
title: 'Common Issue Categories',
|
|
205
|
+
description: `Top issue categories: ${topCategories.map(([cat]) => cat).join(', ')}`,
|
|
206
|
+
action: 'focus_on_common_issue_categories'
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
return recommendations;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Create file compliance summary
|
|
215
|
+
* @param {Object} file - File information
|
|
216
|
+
* @returns {FileComplianceSummary} - File summary
|
|
217
|
+
*/
|
|
218
|
+
function createFileComplianceSummary(file) {
|
|
219
|
+
return new FileComplianceSummary({
|
|
220
|
+
filePath: file.path,
|
|
221
|
+
size: file.size,
|
|
222
|
+
lines: file.lines,
|
|
223
|
+
compliant: file.compliant || false,
|
|
224
|
+
issues: file.issues || [],
|
|
225
|
+
metrics: file.metrics || {},
|
|
226
|
+
lastChecked: new Date().toISOString()
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Validate compliance report
|
|
232
|
+
* @param {ComplianceReport} report - Compliance report to validate
|
|
233
|
+
* @returns {Object} - Validation result
|
|
234
|
+
*/
|
|
235
|
+
function validateComplianceReport(report) {
|
|
236
|
+
const validation = {
|
|
237
|
+
isValid: true,
|
|
238
|
+
errors: [],
|
|
239
|
+
warnings: []
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
// Check required fields
|
|
243
|
+
if (!report.metadata) {
|
|
244
|
+
validation.isValid = false;
|
|
245
|
+
validation.errors.push('Missing report metadata');
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
if (!Array.isArray(report.compliantFiles)) {
|
|
249
|
+
validation.isValid = false;
|
|
250
|
+
validation.errors.push('Invalid compliant files array');
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
if (!Array.isArray(report.nonCompliantFiles)) {
|
|
254
|
+
validation.isValid = false;
|
|
255
|
+
validation.errors.push('Invalid non-compliant files array');
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// Check data consistency
|
|
259
|
+
const totalFiles = report.compliantFiles.length + report.nonCompliantFiles.length;
|
|
260
|
+
if (totalFiles !== report.metadata.totalFiles) {
|
|
261
|
+
validation.warnings.push('File count mismatch in metadata');
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
return validation;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
module.exports = {
|
|
268
|
+
createComplianceReport,
|
|
269
|
+
calculateComplianceMetrics,
|
|
270
|
+
groupIssuesByCategory,
|
|
271
|
+
groupIssuesBySeverity,
|
|
272
|
+
calculateAverageFileSize,
|
|
273
|
+
findLargestFiles,
|
|
274
|
+
findMostCommonIssues,
|
|
275
|
+
generateComplianceRecommendations,
|
|
276
|
+
createFileComplianceSummary,
|
|
277
|
+
validateComplianceReport
|
|
278
|
+
};
|