MCPcopy Create free account
hub / github.com/code-pushup/cli / formatSeverityCounts

Function formatSeverityCounts

packages/utils/src/lib/reports/formatting.ts:196–203  ·  view source on GitHub ↗
(
  severityCounts: Partial<Record<IssueSeverity, number>>,
)

Source from the content-addressed store, hash-verified

194}
195
196export function formatSeverityCounts(
197 severityCounts: Partial<Record<IssueSeverity, number>>,
198): string {
199 return objectToEntries(severityCounts)
200 .toSorted(([a], [b]) => -compareIssueSeverity(a, b))
201 .map(([severity, count = 0]) => pluralizeToken(severity, count))
202 .join(', ');
203}
204
205/**
206 * Formats issues into a human-readable severity summary string.

Callers 2

formatIssueSeveritiesFunction · 0.85

Calls 3

objectToEntriesFunction · 0.85
compareIssueSeverityFunction · 0.85
pluralizeTokenFunction · 0.85

Tested by

no test coverage detected