UNPKG

agentsqripts

Version:

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

17 lines (13 loc) 562 B
/** * @file Calculate integration health score * @description Single responsibility: Calculate score based on integration issues */ function calculateIntegrationScore(frontendCalls, backendEndpoints, issues) { const totalItems = frontendCalls.length + backendEndpoints.length; if (totalItems === 0) return 100; const issueWeight = issues.reduce((sum, issue) => { return sum + (issue.severity === 'HIGH' ? 10 : 5); }, 0); return Math.max(0, 100 - Math.round((issueWeight / totalItems) * 10)); } module.exports = calculateIntegrationScore;