UNPKG

agentsqripts

Version:

Comprehensive static code analysis toolkit for identifying technical debt, security vulnerabilities, performance issues, and code quality problems

28 lines (23 loc) 928 B
/** * @file Generate refactoring recommendations for duplicate code groups * @description Single responsibility: Orchestrate recommendation generation */ const analyzeGroupAndRecommend = require('./analyzeGroupAndRecommend'); /** * Generate refactoring recommendations for duplicate code groups * @param {Array} duplicateGroups - Groups of duplicate blocks * @param {Object} projectContext - Project context information * @returns {Array} Refactoring recommendations */ function generateRefactoringRecommendations(duplicateGroups, projectContext = {}) { const recommendations = []; duplicateGroups.forEach((group, index) => { const recommendation = analyzeGroupAndRecommend(group, projectContext); if (recommendation) { recommendation.priority = index + 1; recommendations.push(recommendation); } }); return recommendations; } module.exports = generateRefactoringRecommendations;