@sun-asterisk/sunlint 1.3.12 ā 1.3.14
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 +21 -1
- package/core/summary-report-service.js +19 -11
- package/core/upload-service.js +1 -1
- package/package.json +1 -1
package/core/output-service.js
CHANGED
|
@@ -111,7 +111,7 @@ class OutputService {
|
|
|
111
111
|
cwd: process.cwd(),
|
|
112
112
|
filesAnalyzed: totalFiles,
|
|
113
113
|
duration: metadata.duration,
|
|
114
|
-
version: metadata.version || '1.3.
|
|
114
|
+
version: metadata.version || '1.3.13'
|
|
115
115
|
}
|
|
116
116
|
);
|
|
117
117
|
|
|
@@ -376,6 +376,26 @@ class OutputService {
|
|
|
376
376
|
if (uploadResult.statusCode) {
|
|
377
377
|
console.log(chalk.green(`š” HTTP Status: ${uploadResult.statusCode}`));
|
|
378
378
|
}
|
|
379
|
+
if (uploadResult.response) {
|
|
380
|
+
try {
|
|
381
|
+
const responseData = JSON.parse(uploadResult.response);
|
|
382
|
+
if (responseData.message) {
|
|
383
|
+
console.log(chalk.blue(`š¬ Server response: ${responseData.message}`));
|
|
384
|
+
}
|
|
385
|
+
if (responseData.report_id) {
|
|
386
|
+
console.log(chalk.blue(`š Report ID: ${responseData.report_id}`));
|
|
387
|
+
}
|
|
388
|
+
if (responseData.repository) {
|
|
389
|
+
console.log(chalk.blue(`š Repository: ${responseData.repository}`));
|
|
390
|
+
}
|
|
391
|
+
if (responseData.actor) {
|
|
392
|
+
console.log(chalk.blue(`š¤ Submitted by: ${responseData.actor}`));
|
|
393
|
+
}
|
|
394
|
+
} catch (parseError) {
|
|
395
|
+
// If response is not JSON, show raw response
|
|
396
|
+
console.log(chalk.gray(`š Response: ${uploadResult.response.substring(0, 200)}...`));
|
|
397
|
+
}
|
|
398
|
+
}
|
|
379
399
|
}
|
|
380
400
|
} else {
|
|
381
401
|
console.warn(chalk.yellow(`ā ļø Failed to upload report: ${uploadResult.error}`));
|
|
@@ -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/core/upload-service.js
CHANGED
package/package.json
CHANGED