(region, pass)
| 322 | } |
| 323 | |
| 324 | function selection(region, pass) { |
| 325 | const host = el('div'); |
| 326 | host.append(el('h2', 'source-path', region.path), el('p', 'region-meta', `${location(region)} · ${regionName(region)} · ${viewComparison ? viewComparison.from.view+' → '+viewComparison.to.view : viewSnapshot ? 'view ' + viewSnapshot.view : 'change ' + region.change.slice(0, 12)}`)); |
| 327 | const relevant = regionFindings(region).filter(finding => inPass(finding, pass) && (pass !== 'slop' || lifecycleMatches(finding))); |
| 328 | for (const finding of relevant) host.append(findingBlock(finding.number)); |
| 329 | if (pass === 'risk') host.append(impactEvidence(region)); |
| 330 | const measurements = metricTable(region); |
| 331 | const metricCount = region.metrics.length || region.context_metrics.length; |
| 332 | if (metricCount) { |
| 333 | if (pass === 'slop' && state.filter !== 'concerns') host.append(measurements); |
| 334 | else host.append(detail(`${metricCount} measurements & metric cards`, measurements)); |
| 335 | } |
| 336 | host.append(sourceViewer(region)); |
| 337 | if (relevant.length) showCard(relevant[0].finding.requirement_or_rule.id); |
| 338 | return host; |
| 339 | } |
| 340 | |
| 341 | function lifecycleMatches(item) { |
| 342 | if (!viewComparison || !['new','existing','resolved','uncertain'].includes(state.filter)) return true; |
no test coverage detected