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

Function toIssue

packages/plugin-axe/src/lib/runner/transform.ts:87–103  ·  view source on GitHub ↗
(node: axe.NodeResult, result: axe.Result, url: string)

Source from the content-addressed store, hash-verified

85}
86
87function toIssue(node: axe.NodeResult, result: axe.Result, url: string): Issue {
88 const selector = node.target?.[0]
89 ? formatSelector(node.target[0])
90 : undefined;
91
92 const message = formatNodeMessage(node, result.help);
93
94 return {
95 message: truncateIssueMessage(message),
96 severity: impactToSeverity(node.impact),
97 source: {
98 url,
99 ...(node.html && { snippet: node.html }),
100 ...(selector && { selector }),
101 },
102 };
103}
104
105function impactToSeverity(impact: axe.ImpactValue | undefined): IssueSeverity {
106 switch (impact) {

Callers 1

toAuditOutputFunction · 0.85

Calls 4

truncateIssueMessageFunction · 0.90
formatSelectorFunction · 0.85
formatNodeMessageFunction · 0.85
impactToSeverityFunction · 0.85

Tested by

no test coverage detected