MCPcopy Create free account
hub / github.com/dfinity/orbit / groupBySeverity

Function groupBySeverity

cli/src/audit/report.ts:30–38  ·  view source on GitHub ↗
(findings: Finding[])

Source from the content-addressed store, hash-verified

28 [...findings].sort((a, b) => RANK[a.severity] - RANK[b.severity]);
29
30const groupBySeverity = (findings: Finding[]): Map<Severity, Finding[]> => {
31 const map = new Map<Severity, Finding[]>();
32 for (const finding of findings) {
33 const bucket = map.get(finding.severity) ?? [];
34 bucket.push(finding);
35 map.set(finding.severity, bucket);
36 }
37 return map;
38};
39
40export const renderReport = (report: AuditReport): string => {
41 const lines: string[] = [];

Callers 1

renderReportFunction · 0.85

Calls 2

getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected