@sun-asterisk/sunlint 1.3.12 ā 1.3.13
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/core/output-service.js +1 -1
- package/core/summary-report-service.js +19 -11
- package/package.json +1 -1
package/core/output-service.js
CHANGED
|
@@ -214,7 +214,7 @@ class SummaryReportService {
|
|
|
214
214
|
info_count: 0, // Reserved for future use
|
|
215
215
|
lines_of_code: scoringSummary.metrics.linesOfCode,
|
|
216
216
|
files_analyzed: options.filesAnalyzed || 0,
|
|
217
|
-
sunlint_version: options.version || '1.3.
|
|
217
|
+
sunlint_version: options.version || '1.3.13',
|
|
218
218
|
analysis_duration_ms: options.duration || 0,
|
|
219
219
|
violations: violationsSummary,
|
|
220
220
|
|
|
@@ -222,7 +222,7 @@ class SummaryReportService {
|
|
|
222
222
|
metadata: {
|
|
223
223
|
generated_at: new Date().toISOString(),
|
|
224
224
|
tool: 'SunLint',
|
|
225
|
-
version: options.version || '1.3.
|
|
225
|
+
version: options.version || '1.3.13',
|
|
226
226
|
analysis_duration_ms: options.duration || 0
|
|
227
227
|
},
|
|
228
228
|
quality: {
|
|
@@ -294,20 +294,28 @@ class SummaryReportService {
|
|
|
294
294
|
* @returns {string} Formatted text summary
|
|
295
295
|
*/
|
|
296
296
|
formatTextSummary(summaryReport) {
|
|
297
|
-
|
|
297
|
+
// Extract data from flat structure
|
|
298
|
+
const score = summaryReport.score;
|
|
299
|
+
const grade = summaryReport.quality?.grade || 'N/A';
|
|
300
|
+
const filesAnalyzed = summaryReport.files_analyzed || 0;
|
|
301
|
+
const linesOfCode = summaryReport.lines_of_code || 0;
|
|
302
|
+
const totalViolations = summaryReport.total_violations || 0;
|
|
303
|
+
const errorCount = summaryReport.error_count || 0;
|
|
304
|
+
const warningCount = summaryReport.warning_count || 0;
|
|
305
|
+
const violationsByRule = summaryReport.violations || [];
|
|
306
|
+
const violationsPerKLOC = summaryReport.quality?.metrics?.violationsPerKLOC || 0;
|
|
298
307
|
|
|
299
308
|
let output = '\nš Quality Summary Report\n';
|
|
300
309
|
output += 'ā'.repeat(50) + '\n';
|
|
301
|
-
output += `š Quality Score: ${
|
|
302
|
-
output += `š Files Analyzed: ${
|
|
303
|
-
output +=
|
|
304
|
-
output +=
|
|
305
|
-
output +=
|
|
306
|
-
output += `š Violations per KLOC: ${quality.metrics.violationsPerKLOC}\n`;
|
|
310
|
+
output += `š Quality Score: ${score} (Grade: ${grade})\n`;
|
|
311
|
+
output += `š Files Analyzed: ${filesAnalyzed}\n`;
|
|
312
|
+
output += `š Lines of Code: ${linesOfCode.toLocaleString()}\n`;
|
|
313
|
+
output += `ā ļø Total Violations: ${totalViolations} (${errorCount} errors, ${warningCount} warnings)\n`;
|
|
314
|
+
output += `š Violations per KLOC: ${violationsPerKLOC}\n`;
|
|
307
315
|
|
|
308
|
-
if (
|
|
316
|
+
if (violationsByRule.length > 0) {
|
|
309
317
|
output += '\nš Top Violations by Rule:\n';
|
|
310
|
-
|
|
318
|
+
violationsByRule.slice(0, 10).forEach((item, index) => {
|
|
311
319
|
output += ` ${index + 1}. ${item.rule_code}: ${item.count} violations (${item.severity})\n`;
|
|
312
320
|
});
|
|
313
321
|
}
|
package/package.json
CHANGED