(checks)
| 107 | } |
| 108 | |
| 109 | function buildDeductions(checks) { |
| 110 | return checks |
| 111 | .map((check) => ({ |
| 112 | id: check.id, |
| 113 | category: check.category, |
| 114 | severity: check.severity, |
| 115 | status: check.status, |
| 116 | message: check.message, |
| 117 | penalty: computeCheckPenalty(check), |
| 118 | remediation: check.remediation, |
| 119 | source: check.source, |
| 120 | ...(check.targetPath ? { targetPath: check.targetPath } : {}), |
| 121 | })) |
| 122 | .filter((entry) => entry.penalty > 0) |
| 123 | .sort((left, right) => { |
| 124 | if (right.penalty !== left.penalty) { |
| 125 | return right.penalty - left.penalty; |
| 126 | } |
| 127 | return left.id.localeCompare(right.id); |
| 128 | }); |
| 129 | } |
| 130 | |
| 131 | function buildCategoryDeductions(deductions) { |
| 132 | const totals = new Map(); |
no test coverage detected