agentsqripts
Version:
Comprehensive static code analysis toolkit for identifying technical debt, security vulnerabilities, performance issues, and code quality problems
26 lines (22 loc) • 696 B
JavaScript
/**
* @file Format breakdown utility
* @description Single responsibility: Format issue count breakdowns
*/
/**
* Format issue count breakdown
* @param {Object} breakdown - Object with issue counts by type
* @param {Object} labelMap - Map of type to display label
* @param {string} title - Section title
* @returns {string} Formatted breakdown
*/
function formatBreakdown(breakdown, labelMap, title = 'Breakdown') {
let output = `${title}:\n`;
Object.entries(breakdown).forEach(([key, count]) => {
if (count > 0) {
const label = labelMap[key] || key;
output += ` ${label}: ${count}\n`;
}
});
return output + '\n';
}
module.exports = formatBreakdown;