agentsqripts
Version:
Comprehensive static code analysis toolkit for identifying technical debt, security vulnerabilities, performance issues, and code quality problems
26 lines (21 loc) • 625 B
JavaScript
/**
* @file Priority calculation
* @description Calculates cleanup priority based on score and opportunities
*/
/**
* Determine cleanup priority based on score and opportunities
*/
function determinePriority(score, opportunities) {
const highSeverityCount = opportunities.filter(op => op.severity === 'HIGH').length;
const mediumSeverityCount = opportunities.filter(op => op.severity === 'MEDIUM').length;
if (score < 60 || highSeverityCount > 0) {
return 'HIGH';
}
if (score < 80 || mediumSeverityCount > 2) {
return 'MEDIUM';
}
return 'LOW';
}
module.exports = {
determinePriority
};