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

Function scoreAuditsWithTarget

packages/utils/src/lib/reports/scoring.ts:144–155  ·  view source on GitHub ↗
(
  audits: AuditOutput[],
  scoreTargets: PluginScoreTargets,
)

Source from the content-addressed store, hash-verified

142 * @returns Transformed audits with scoreTarget field
143 */
144export function scoreAuditsWithTarget(
145 audits: AuditOutput[],
146 scoreTargets: PluginScoreTargets,
147): AuditOutput[] {
148 if (typeof scoreTargets === 'number') {
149 return audits.map(audit => scoreAuditWithTarget(audit, scoreTargets));
150 }
151 return audits.map(audit => {
152 const target = scoreTargets?.[audit.slug];
153 return target == null ? audit : scoreAuditWithTarget(audit, target);
154 });
155}

Callers 2

executePluginFunction · 0.90

Calls 1

scoreAuditWithTargetFunction · 0.85

Tested by

no test coverage detected