(checks)
| 150 | } |
| 151 | |
| 152 | function rankActionableChecks(checks) { |
| 153 | return checks |
| 154 | .filter((check) => check.status === "fail" || check.status === "warn") |
| 155 | .map((check) => ({ |
| 156 | ...check, |
| 157 | penalty: computeCheckPenalty(check), |
| 158 | why: deriveCheckWhy(check), |
| 159 | })) |
| 160 | .sort((left, right) => { |
| 161 | if (right.penalty !== left.penalty) { |
| 162 | return right.penalty - left.penalty; |
| 163 | } |
| 164 | if ((STATUS_PRIORITY[left.status] ?? 99) !== (STATUS_PRIORITY[right.status] ?? 99)) { |
| 165 | return (STATUS_PRIORITY[left.status] ?? 99) - (STATUS_PRIORITY[right.status] ?? 99); |
| 166 | } |
| 167 | if ((CATEGORY_PRIORITY[left.category] ?? 99) !== (CATEGORY_PRIORITY[right.category] ?? 99)) { |
| 168 | return (CATEGORY_PRIORITY[left.category] ?? 99) - (CATEGORY_PRIORITY[right.category] ?? 99); |
| 169 | } |
| 170 | return left.id.localeCompare(right.id); |
| 171 | }); |
| 172 | } |
| 173 | |
| 174 | function summarizeFinding(check) { |
| 175 | return { |
no test coverage detected