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

Function logResultsForAllUrls

packages/plugin-lighthouse/src/lib/runner/runner.ts:126–152  ·  view source on GitHub ↗
(results: ResultForUrl[])

Source from the content-addressed store, hash-verified

124}
125
126function logResultsForAllUrls(results: ResultForUrl[]): void {
127 const categoryNames = Object.fromEntries(
128 results
129 .flatMap(res => Object.values(res.lhr.categories))
130 .map(category => [category.id, category.title]),
131 );
132
133 logger.info(
134 formatAsciiTable({
135 columns: [
136 { key: 'url', label: 'URL', align: 'left' },
137 ...Object.entries(categoryNames).map(
138 ([key, label]): TableColumnObject => ({ key, label, align: 'right' }),
139 ),
140 ],
141 rows: results.map(({ url, lhr }) => ({
142 url,
143 ...Object.fromEntries(
144 Object.values(lhr.categories).map(category => [
145 category.id,
146 category.score == null ? '-' : formatReportScore(category.score),
147 ]),
148 ),
149 })),
150 }),
151 );
152}

Callers 1

createRunnerFunctionFunction · 0.70

Calls 3

formatAsciiTableFunction · 0.90
formatReportScoreFunction · 0.90
infoMethod · 0.80

Tested by

no test coverage detected