cve-lite-cli 1.33.0 → 1.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -3
- package/dist/advisory/local-db.js +31 -2
- package/dist/advisory/osv-advisory-source.js +3 -0
- package/dist/cli/advisories-init.js +13 -0
- package/dist/cli/advisories-sync.js +30 -0
- package/dist/cli/args.js +41 -2
- package/dist/cli/config-command.js +15 -0
- package/dist/cli/config.js +29 -0
- package/dist/cli/help.js +7 -5
- package/dist/cli/overrides.js +10 -1
- package/dist/cli/validate.js +6 -2
- package/dist/constants.js +52 -0
- package/dist/index.js +25 -719
- package/dist/output/cyclonedx.js +28 -24
- package/dist/output/formatters.js +13 -0
- package/dist/output/html-reporter.js +81 -40
- package/dist/output/multi-folder-html-reporter.js +16 -10
- package/dist/output/multi-folder-printer.js +1 -1
- package/dist/output/override-findings-sarif.js +1 -0
- package/dist/output/printers.js +436 -271
- package/dist/output/sarif.js +17 -1
- package/dist/output/sbom-dependency-edges.js +86 -0
- package/dist/output/sbom-file.js +27 -0
- package/dist/output/spdx.js +293 -0
- package/dist/output/write-outputs.js +18 -3
- package/dist/overrides/admitted-scan.js +158 -0
- package/dist/overrides/api.js +16 -0
- package/dist/overrides/context-builder.js +4 -0
- package/dist/overrides/context.js +8 -1
- package/dist/overrides/detectors/index.js +2 -0
- package/dist/overrides/detectors/oa010-vulnerable-floor.js +123 -0
- package/dist/overrides/parsing/registry.js +53 -0
- package/dist/parsers/bun-lock-graph.js +182 -0
- package/dist/parsers/bun-lock.js +93 -132
- package/dist/parsers/index.js +75 -149
- package/dist/parsers/multi-package.js +5 -6
- package/dist/parsers/package-lock.js +11 -1
- package/dist/parsers/pnpm-lock-graph.js +94 -0
- package/dist/parsers/pnpm-lock.js +5 -5
- package/dist/parsers/utils.js +3 -0
- package/dist/parsers/yarn-lock-graph.js +148 -0
- package/dist/parsers/yarn-lock.js +3 -3
- package/dist/remediation/fix-commands.js +48 -7
- package/dist/remediation/npm-registry.js +8 -2
- package/dist/scan/completeness.js +1 -0
- package/dist/scan/single-scan.js +643 -0
- package/dist/scanner.js +62 -7
- package/dist/types.js +1 -1
- package/dist/utils/file.js +11 -14
- package/dist/utils/purl.js +10 -0
- package/dist/utils/sbom-format.js +12 -0
- package/dist/utils/version.js +84 -10
- package/package.json +2 -2
package/dist/output/printers.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { chalk, stripAnsi } from "../utils/chalk.js";
|
|
2
|
-
import { buildSuggestedFixCommandPlan, UNVERIFIED_PARENT_UPGRADE_NOTE } from "../remediation/fix-commands.js";
|
|
2
|
+
import { buildSuggestedFixCommandPlan, findFixTargetForFinding, UNVERIFIED_PARENT_UPGRADE_NOTE } from "../remediation/fix-commands.js";
|
|
3
3
|
import { isBreakingUpgrade } from "../utils/version.js";
|
|
4
4
|
import { getPrimaryParent } from "../utils/finding.js";
|
|
5
|
-
import { countUniqueAdvisories, formatRelationshipLabel, formatRelLabel, formatRootDependencySummary, formatFixCommandWithPublishDates, formatCooldownWarning, } from "./formatters.js";
|
|
5
|
+
import { countUniqueAdvisories, countProdFindings, formatRelationshipLabel, formatRelLabel, formatRootDependencySummary, formatFixCommandWithPublishDates, formatCooldownWarning, } from "./formatters.js";
|
|
6
6
|
import { formatSeverityLabel } from "../utils/severity.js";
|
|
7
|
+
import { severityOrder } from "../constants.js";
|
|
7
8
|
import { pluralize } from "../utils/string.js";
|
|
8
9
|
import { hasMaliciousAdvisory } from "../utils/vuln.js";
|
|
9
10
|
import { selectFindingsForCompact } from "./finding-display.js";
|
|
@@ -34,6 +35,10 @@ export function printSummary(findings, packageCount, scanInput) {
|
|
|
34
35
|
};
|
|
35
36
|
console.log(chalk.redBright(`✗ Found ${uniquePkgCount} ${pkgLabel} (${totalCVEs} ${cveLabel}) with known OSV matches from ${scanInput.source}`));
|
|
36
37
|
console.log(renderSeverityTable(counts));
|
|
38
|
+
const prodSplit = countProdFindings(findings);
|
|
39
|
+
if (prodSplit !== null) {
|
|
40
|
+
console.log(chalk.gray(` └ ${prodSplit.prodTotal} of ${prodSplit.total} findings in prod dependencies`));
|
|
41
|
+
}
|
|
37
42
|
}
|
|
38
43
|
export function printActionSummary(findings, overrideCount = 0, packageManager) {
|
|
39
44
|
if (findings.length === 0 && overrideCount === 0)
|
|
@@ -71,68 +76,38 @@ function printUnverifiedParentUpgradeWarning(target) {
|
|
|
71
76
|
console.log(chalk.yellow(` ${UNVERIFIED_PARENT_UPGRADE_NOTE}`));
|
|
72
77
|
}
|
|
73
78
|
}
|
|
74
|
-
function printChainProofLines(targets) {
|
|
75
|
-
for (const target of targets) {
|
|
76
|
-
if (!target.chainProof || !target.chainSafeVersion)
|
|
77
|
-
continue;
|
|
78
|
-
const pkgLabel = target.chainVulnerablePackage
|
|
79
|
-
? `${target.chainVulnerablePackage}@${target.chainSafeVersion}`
|
|
80
|
-
: target.chainSafeVersion;
|
|
81
|
-
const hops = target.chainProof.map(h => `${h.name}@${h.version}`);
|
|
82
|
-
const proof = hops.length > 0
|
|
83
|
-
? ` resolves via ${hops.join(" -> ")} -> ${pkgLabel} (safe)`
|
|
84
|
-
: ` resolves to ${pkgLabel} (safe)`;
|
|
85
|
-
console.log(chalk.gray(proof));
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
79
|
export function printSuggestedFixCommands(findings, scanInput, options) {
|
|
89
80
|
const plan = buildSuggestedFixCommandPlan(findings, scanInput, options);
|
|
90
81
|
if (!plan)
|
|
91
82
|
return;
|
|
83
|
+
const fixRowContexts = buildFixRowContexts(findings);
|
|
92
84
|
if (plan.sections.length === 0)
|
|
93
85
|
return;
|
|
94
|
-
|
|
95
|
-
|
|
86
|
+
// One decision for every fix table in the run, so sections that share widths
|
|
87
|
+
// cannot disagree about whether the Usage column exists.
|
|
88
|
+
const showUsage = findings.some(finding => !!finding.usage);
|
|
89
|
+
const sharedActionTableWidths = computeSharedActionTableWidths(plan.sections, showUsage, fixRowContexts);
|
|
96
90
|
console.log("");
|
|
97
91
|
console.log(chalk.bold.yellow("🛠 Suggested Fix Commands"));
|
|
98
92
|
console.log(chalk.white(formatFixCommandSummary(plan)));
|
|
99
93
|
for (const section of plan.sections) {
|
|
100
94
|
console.log("");
|
|
101
95
|
console.log(colorFixSectionTitle(section.severity, section.title));
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
const directTargets = section.targets.filter(t => t.kind === "direct");
|
|
112
|
-
const parentUpgradeTargets = section.targets.filter(t => t.kind === "parent-upgrade" || t.kind === "parent-update");
|
|
113
|
-
if (directTargets.length > 0) {
|
|
114
|
-
const validationSummary = summarizeAdjustedValidation(directTargets);
|
|
115
|
-
const remainingNotes = [];
|
|
116
|
-
// Urgent sections compute their own widths so the Breaking? column
|
|
117
|
-
// is not truncated by widths derived from smaller non-urgent sections.
|
|
118
|
-
printDirectTargetsTable(directTargets, remainingNotes, validationSummary, undefined);
|
|
119
|
-
for (const note of remainingNotes) {
|
|
120
|
-
console.log(chalk.gray(` Note: ${note}`));
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
if (parentUpgradeTargets.length > 0) {
|
|
124
|
-
printParentUpgradeTargetsTable(parentUpgradeTargets, undefined);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
else if (shouldRenderParentUpgradeTable(section.targets)) {
|
|
128
|
-
printParentUpgradeTargetsTable(section.targets, sharedParentUpgradeTableWidths);
|
|
96
|
+
// One table per section, always, holding every target the section covers.
|
|
97
|
+
// Direct and parent upgrades used to go in separately shaped tables chosen by
|
|
98
|
+
// section kind, which is why the same title drew a 7-column table in one
|
|
99
|
+
// project and a 4-column one in another, and why a section whose targets
|
|
100
|
+
// matched neither shape drew no table at all.
|
|
101
|
+
const remainingNotes = [];
|
|
102
|
+
printActionTargetsTable(section.targets, remainingNotes, sharedActionTableWidths, fixRowContexts, showUsage);
|
|
103
|
+
for (const note of remainingNotes) {
|
|
104
|
+
console.log(chalk.gray(` Note: ${note}`));
|
|
129
105
|
}
|
|
130
106
|
for (const target of section.targets) {
|
|
131
107
|
printCooldownWarning(target);
|
|
132
108
|
printUnverifiedParentUpgradeWarning(target);
|
|
133
109
|
}
|
|
134
110
|
console.log(renderCommandCallout(section.command, section.targets));
|
|
135
|
-
printChainProofLines(section.targets);
|
|
136
111
|
}
|
|
137
112
|
if (plan.coveredFindingCount > 0) {
|
|
138
113
|
console.log("");
|
|
@@ -207,89 +182,293 @@ function formatPrioritySignal(signal) {
|
|
|
207
182
|
return chalk.blue(label);
|
|
208
183
|
return chalk.gray(label);
|
|
209
184
|
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
185
|
+
// Package names are the only unbounded values in a table, so they are capped
|
|
186
|
+
// tighter than versions, counts and fixed labels.
|
|
187
|
+
const PACKAGE_NAME_COLUMN_CAP = 32;
|
|
188
|
+
const DEFAULT_COLUMN_CAP = 40;
|
|
189
|
+
// Root holds a package name too, but it is a secondary column, so it is capped
|
|
190
|
+
// below Package. 24 is a floor rather than a preference: unscoped roots such as
|
|
191
|
+
// "start-server-and-test +1" are themselves 24 characters with nothing to trim.
|
|
192
|
+
const ROOT_COLUMN_CAP = 24;
|
|
193
|
+
// Context is prose, so it gets room and is word-wrapped rather than truncated.
|
|
194
|
+
const CONTEXT_COLUMN_CAP = 60;
|
|
195
|
+
const dash = (value) => (value == null || value === "" ? "-" : value);
|
|
196
|
+
const TABLE_COLUMNS = [
|
|
197
|
+
{
|
|
198
|
+
name: "package",
|
|
199
|
+
header: "Package",
|
|
200
|
+
cap: PACKAGE_NAME_COLUMN_CAP,
|
|
201
|
+
cell: row => ({ value: row.package, decorated: row.packageDecorated }),
|
|
202
|
+
},
|
|
203
|
+
{ name: "version", header: "Version", cell: row => ({ value: dash(row.version) }) },
|
|
204
|
+
{
|
|
205
|
+
name: "severity",
|
|
206
|
+
header: "Severity",
|
|
207
|
+
cell: row => (row.severity
|
|
208
|
+
? { value: row.severity, decorated: formatSeverityLabel(row.severity) }
|
|
209
|
+
: { value: "-" }),
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
name: "type",
|
|
213
|
+
header: "Type",
|
|
214
|
+
cell: row => (row.relationship
|
|
215
|
+
? { value: row.relationship, decorated: formatRelationshipLabel(row.relationship) }
|
|
216
|
+
: { value: "-" }),
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
name: "root",
|
|
220
|
+
header: "Root",
|
|
221
|
+
cap: ROOT_COLUMN_CAP,
|
|
222
|
+
cell: row => ({ value: dash(row.root) }),
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
name: "usage",
|
|
226
|
+
header: "Usage",
|
|
227
|
+
cell: row => {
|
|
228
|
+
if (!row.usage)
|
|
229
|
+
return { value: "n/a", decorated: chalk.gray("n/a") };
|
|
230
|
+
const value = row.usage.imported ? `${row.usage.files.length} file(s)` : "unused";
|
|
231
|
+
return { value, decorated: row.usage.imported ? chalk.red(value) : chalk.green(value) };
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
name: "advisory",
|
|
236
|
+
header: "Advisory",
|
|
237
|
+
cell: row => {
|
|
238
|
+
const value = dash(row.advisoryVersion);
|
|
239
|
+
return { value, decorated: chalk.gray(value) };
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
{ name: "target", header: "Target", cell: row => ({ value: dash(row.target) }) },
|
|
243
|
+
{
|
|
244
|
+
name: "scanned",
|
|
245
|
+
header: "Scanned",
|
|
246
|
+
cell: row => {
|
|
247
|
+
const value = row.scanned == null ? "-" : String(row.scanned);
|
|
248
|
+
return { value, decorated: chalk.blue(value) };
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
name: "stillVulnerable",
|
|
253
|
+
header: "Still\nvulnerable",
|
|
254
|
+
cell: row => {
|
|
255
|
+
if (row.stillVulnerable == null)
|
|
256
|
+
return { value: "-", decorated: chalk.gray("-") };
|
|
257
|
+
const value = String(row.stillVulnerable);
|
|
258
|
+
return { value, decorated: row.stillVulnerable > 0 ? chalk.yellow(value) : chalk.green(value) };
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
name: "breaking",
|
|
263
|
+
header: "Breaking?",
|
|
264
|
+
cell: row => (row.breaking ? { value: "⚠", decorated: chalk.yellow("⚠") } : { value: "" }),
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
name: "epss",
|
|
268
|
+
header: "EPSS",
|
|
269
|
+
cell: row => {
|
|
270
|
+
const value = row.epss == null ? "-" : `${(row.epss * 100).toFixed(1)}%`;
|
|
271
|
+
return { value, decorated: chalk.gray(value) };
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
name: "epssPriority",
|
|
276
|
+
header: "EPSS\nPriority",
|
|
277
|
+
cell: row => ({
|
|
278
|
+
value: row.signal ? PRIORITY_SIGNAL_TABLE_LABELS[row.signal] : "-",
|
|
279
|
+
decorated: formatPrioritySignal(row.signal ?? null),
|
|
280
|
+
}),
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
name: "ids",
|
|
284
|
+
header: "IDs",
|
|
285
|
+
cell: row => ({ value: row.ids ? formatAdvisoryIdFoothold(row.ids) : "-" }),
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
name: "context",
|
|
289
|
+
header: "Context",
|
|
290
|
+
cap: CONTEXT_COLUMN_CAP,
|
|
291
|
+
wrapCap: CONTEXT_COLUMN_CAP,
|
|
292
|
+
cell: row => {
|
|
293
|
+
const value = dash(row.context);
|
|
294
|
+
return { value, decorated: chalk.gray(value) };
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
];
|
|
298
|
+
/**
|
|
299
|
+
* The findings table is the research view: everything we know, in one place.
|
|
300
|
+
* The action tables are what you read to decide what to run, so they carry the
|
|
301
|
+
* remediation columns only. Both are selections from TABLE_COLUMNS.
|
|
302
|
+
*/
|
|
303
|
+
const FINDINGS_TABLE_COLUMNS = [
|
|
304
|
+
"package", "version", "severity", "type", "root", "usage",
|
|
305
|
+
"advisory", "target", "scanned", "stillVulnerable", "breaking",
|
|
306
|
+
"epss", "epssPriority", "ids",
|
|
307
|
+
];
|
|
308
|
+
// Both remediation tables draw the same columns. A direct upgrade and a parent
|
|
309
|
+
// upgrade are different rows, but showing them in differently shaped tables made
|
|
310
|
+
// the same section title render two different tables depending on the project.
|
|
311
|
+
const ACTION_TABLE_COLUMNS = [
|
|
312
|
+
"package", "version", "usage", "advisory", "target",
|
|
313
|
+
"scanned", "stillVulnerable", "breaking", "context",
|
|
314
|
+
];
|
|
315
|
+
// Usage is "n/a" on every row unless --usage or --only-used ran, so it is dropped
|
|
316
|
+
// rather than shown empty. Keyed off the data, which cannot disagree with the rows.
|
|
317
|
+
const USAGE_COLUMN = "usage";
|
|
318
|
+
function selectColumns(names, showUsage) {
|
|
319
|
+
return TABLE_COLUMNS.filter(column => {
|
|
320
|
+
if (!names.includes(column.name))
|
|
321
|
+
return false;
|
|
322
|
+
return column.name !== USAGE_COLUMN || showUsage;
|
|
260
323
|
});
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
324
|
+
}
|
|
325
|
+
function columnWidths(columns, rows) {
|
|
326
|
+
return columns.map(column => Math.min(column.cap ?? DEFAULT_COLUMN_CAP, Math.max(cellWidth(column.header), ...rows.map(row => cellWidth(column.cell(row).value)))));
|
|
327
|
+
}
|
|
328
|
+
function renderCells(columns, row) {
|
|
329
|
+
return columns.map(column => {
|
|
330
|
+
const { value, decorated } = column.cell(row);
|
|
331
|
+
return decorated ?? value;
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
/** Draws a table from a column selection. `wrap` word-wraps instead of truncating. */
|
|
335
|
+
function printColumnTable(columns, rows, widths, options) {
|
|
266
336
|
const line = (left, mid, right) => left + widths.map(w => "─".repeat(w + 2)).join(mid) + right;
|
|
267
337
|
console.log(line("┌", "┬", "┐"));
|
|
268
|
-
console.log(renderRow(
|
|
338
|
+
console.log(renderRow(columns.map(column => column.header), widths));
|
|
269
339
|
console.log(line("├", "┼", "┤"));
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
if (
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
else
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
usageDecorated,
|
|
285
|
-
row[6],
|
|
286
|
-
chalk.gray(String(row[7])),
|
|
287
|
-
formatPrioritySignal(rowSignals[idx] ?? null),
|
|
288
|
-
row[9],
|
|
289
|
-
];
|
|
290
|
-
console.log(renderRow(decorated, widths));
|
|
291
|
-
});
|
|
340
|
+
for (const row of rows) {
|
|
341
|
+
const cells = renderCells(columns, row);
|
|
342
|
+
if (options?.wrap) {
|
|
343
|
+
for (const outputRow of renderWrappedRow(cells, widths))
|
|
344
|
+
console.log(outputRow);
|
|
345
|
+
}
|
|
346
|
+
else {
|
|
347
|
+
console.log(renderRow(cells, widths));
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
if (options?.totalsRow) {
|
|
351
|
+
console.log(line("├", "┼", "┤"));
|
|
352
|
+
console.log(renderRow(renderCells(columns, options.totalsRow), widths));
|
|
353
|
+
}
|
|
292
354
|
console.log(line("└", "┴", "┘"));
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Drops the scope from a root that would otherwise be truncated.
|
|
358
|
+
*
|
|
359
|
+
* The end of the name is what distinguishes "@angular-devkit/build-angular" from
|
|
360
|
+
* "@angular-devkit/build-webpack", so an ellipsis would eat the useful half. Only
|
|
361
|
+
* roots past the cap are shortened, which is what keeps this unambiguous: short
|
|
362
|
+
* scoped roots keep their scope, so "@angular/cli" and "@swc/cli" stay distinct
|
|
363
|
+
* rather than both collapsing to "cli".
|
|
364
|
+
*/
|
|
365
|
+
function shortenRootSummary(summary) {
|
|
366
|
+
if (summary.length <= ROOT_COLUMN_CAP)
|
|
367
|
+
return summary;
|
|
368
|
+
const separator = summary.indexOf("/");
|
|
369
|
+
if (!summary.startsWith("@") || separator === -1)
|
|
370
|
+
return summary;
|
|
371
|
+
return summary.slice(separator + 1);
|
|
372
|
+
}
|
|
373
|
+
/** Highest EPSS probability across a finding's advisories, or null when unscored. */
|
|
374
|
+
function bestEpssScore(finding) {
|
|
375
|
+
if (!finding.epssScores || finding.epssScores.length === 0)
|
|
376
|
+
return null;
|
|
377
|
+
return finding.epssScores.slice().sort((a, b) => b.percentile - a.percentile)[0].epss;
|
|
378
|
+
}
|
|
379
|
+
function findingToTableRow(finding, plan, skippedKeys) {
|
|
380
|
+
const isSkipped = !!skippedKeys?.has(`${finding.pkg.name}@${finding.pkg.version}`);
|
|
381
|
+
// Prefer the version the fix plan will actually install. A package that is both
|
|
382
|
+
// a direct finding and the parent of other findings needs a higher version than
|
|
383
|
+
// its own advisory requires, and showing the lower one here contradicted the fix
|
|
384
|
+
// command sitting a few lines above.
|
|
385
|
+
const planTarget = plan ? findFixTargetForFinding(plan, finding)?.targetVersion : undefined;
|
|
386
|
+
const ownFixVersion = finding.validatedFirstFixedVersion ?? finding.firstFixedVersion;
|
|
387
|
+
const fixVersion = planTarget ?? ownFixVersion ?? null;
|
|
388
|
+
return {
|
|
389
|
+
package: finding.pkg.name,
|
|
390
|
+
version: finding.pkg.version,
|
|
391
|
+
severity: finding.severity,
|
|
392
|
+
relationship: formatRelLabel(finding).replace(" · dev", "\n· dev"),
|
|
393
|
+
root: shortenRootSummary(formatRootDependencySummary(finding)),
|
|
394
|
+
usage: finding.usage ?? null,
|
|
395
|
+
advisoryVersion: finding.firstFixedVersion ?? null,
|
|
396
|
+
target: formatTargetDisplay(finding, fixVersion, isSkipped),
|
|
397
|
+
// These count the versions walked above the installed one while checking the
|
|
398
|
+
// advisory's hint, so they stand on their own even when the fix plan then
|
|
399
|
+
// raises Target higher to cover a package's children. Blanking them whenever
|
|
400
|
+
// that happened hid real validation on most rows of a typical scan.
|
|
401
|
+
scanned: finding.validatedTargetScannedVersions,
|
|
402
|
+
stillVulnerable: finding.validatedTargetKnownVulnerableVersions,
|
|
403
|
+
breaking: !!fixVersion && isBreakingUpgrade(finding.pkg.version, fixVersion),
|
|
404
|
+
epss: bestEpssScore(finding),
|
|
405
|
+
signal: finding.epssScores && finding.epssScores.length > 0
|
|
406
|
+
? computePrioritySignal(finding.severity, finding.epssScores)
|
|
407
|
+
: null,
|
|
408
|
+
ids: finding.vulnerabilities.map(v => v.id),
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
function formatTargetDisplay(finding, fixVersion, isSkipped) {
|
|
412
|
+
if (isSkipped && fixVersion)
|
|
413
|
+
return chalk.gray(`${fixVersion} ⊘`);
|
|
414
|
+
if (fixVersion)
|
|
415
|
+
return fixVersion;
|
|
416
|
+
if (finding.maliciousUnverifiable)
|
|
417
|
+
return chalk.yellow("⚠ Unverifiable (private source)");
|
|
418
|
+
if (finding.maliciousGitSource) {
|
|
419
|
+
return chalk.yellow(finding.maliciousGitSourcePinned ? MAL_GIT_SOURCE_PINNED_DISPLAY : MAL_GIT_SOURCE_FLOATING_DISPLAY);
|
|
420
|
+
}
|
|
421
|
+
if (hasMaliciousAdvisory(finding.vulnerabilities))
|
|
422
|
+
return chalk.yellow("⚠ Malicious");
|
|
423
|
+
return chalk.yellow("⚠ no fix");
|
|
424
|
+
}
|
|
425
|
+
function fixTargetToTableRow(target, context) {
|
|
426
|
+
return {
|
|
427
|
+
package: target.package,
|
|
428
|
+
version: target.currentVersion ?? "-",
|
|
429
|
+
severity: context?.severity ?? null,
|
|
430
|
+
relationship: context?.relationship ?? null,
|
|
431
|
+
root: context?.root ?? null,
|
|
432
|
+
usage: target.usage ?? null,
|
|
433
|
+
advisoryVersion: target.advisoryVersion ?? context?.advisoryVersion ?? null,
|
|
434
|
+
target: chalk.cyan(target.targetVersion),
|
|
435
|
+
// A parent-upgrade target carries no validation counts of its own, but the
|
|
436
|
+
// finding it resolves does, and the action table is a filtered view of the
|
|
437
|
+
// findings table: the same package must read the same on both.
|
|
438
|
+
scanned: target.scannedVersions ?? context?.scanned ?? null,
|
|
439
|
+
stillVulnerable: target.knownVulnerableVersions ?? context?.stillVulnerable ?? null,
|
|
440
|
+
breaking: !!target.currentVersion && isBreakingUpgrade(target.currentVersion, target.targetVersion),
|
|
441
|
+
epss: context?.epss ?? null,
|
|
442
|
+
signal: context?.prioritySignal ?? null,
|
|
443
|
+
ids: context?.ids,
|
|
444
|
+
context: target.reason ?? target.adjustmentNote ?? null,
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
/** The bold summary row under a fix table: only the validation counts carry values. */
|
|
448
|
+
function validationTotalsRow(summary) {
|
|
449
|
+
return {
|
|
450
|
+
package: "Total",
|
|
451
|
+
packageDecorated: chalk.bold("Total"),
|
|
452
|
+
version: "-",
|
|
453
|
+
scanned: summary.checked,
|
|
454
|
+
stillVulnerable: summary.vulnerable,
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
export function printTable(findings, threshold, skippedKeys, plan) {
|
|
458
|
+
const columns = selectColumns(FINDINGS_TABLE_COLUMNS, findings.some(finding => !!finding.usage));
|
|
459
|
+
const rows = findings.map(finding => findingToTableRow(finding, plan, skippedKeys));
|
|
460
|
+
console.log("");
|
|
461
|
+
// Every other block announces itself (Quick take, Suggested Fix Commands,
|
|
462
|
+
// Coverage notes). This table was the only one arriving unlabelled, so it read
|
|
463
|
+
// as a continuation of the fix plan above it rather than its own section.
|
|
464
|
+
//
|
|
465
|
+
// The filter belongs in the title rather than on its own line: as a separate
|
|
466
|
+
// bold line it read as a second heading stacked under the first.
|
|
467
|
+
console.log(chalk.bold.magenta(`Vulnerability findings${threshold ? ` (${threshold}+)` : ""}`));
|
|
468
|
+
if (threshold) {
|
|
469
|
+
console.log(chalk.gray("Use --all to show every finding."));
|
|
470
|
+
}
|
|
471
|
+
printColumnTable(columns, rows, columnWidths(columns, rows));
|
|
293
472
|
const maliciousFindings = findings.filter(f => hasMaliciousAdvisory(f.vulnerabilities));
|
|
294
473
|
if (maliciousFindings.length > 0) {
|
|
295
474
|
console.log("");
|
|
@@ -365,13 +544,38 @@ export function printFinalStatus(findings, overrideCount = 0, completeness) {
|
|
|
365
544
|
export function printOverrideHint() {
|
|
366
545
|
console.log("💡 " + chalk.gray("Tip:") + " override entries detected - run with --check-overrides to audit them for stale or broken overrides.");
|
|
367
546
|
}
|
|
547
|
+
// A cell may contain newlines, which render as extra physical lines within the
|
|
548
|
+
// same logical row. This is what keeps the table width bounded: a finding with
|
|
549
|
+
// twelve advisory IDs is twelve short lines rather than one 628-character cell
|
|
550
|
+
// that has to be truncated into uselessness.
|
|
551
|
+
// One searchable advisory ID plus a count of the rest. The full list belongs in
|
|
552
|
+
// --json, --sarif and the HTML report, where it is not competing for terminal
|
|
553
|
+
// width and each ID is a link. Joined into the table it ran to 628 characters on
|
|
554
|
+
// a real project, and truncated it left a single usable ID followed by a stump.
|
|
555
|
+
function formatAdvisoryIdFoothold(ids) {
|
|
556
|
+
if (ids.length === 0)
|
|
557
|
+
return "-";
|
|
558
|
+
if (ids.length === 1)
|
|
559
|
+
return ids[0];
|
|
560
|
+
return `${ids[0]} ${chalk.gray(`+${ids.length - 1}`)}`;
|
|
561
|
+
}
|
|
368
562
|
function renderRow(cells, widths) {
|
|
369
|
-
const
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
563
|
+
const columnLines = cells.map(cell => String(cell).split("\n"));
|
|
564
|
+
const height = Math.max(1, ...columnLines.map(lines => lines.length));
|
|
565
|
+
const physicalLines = [];
|
|
566
|
+
for (let line = 0; line < height; line++) {
|
|
567
|
+
const formatted = columnLines.map((lines, i) => {
|
|
568
|
+
const truncated = truncate(lines[line] ?? "", widths[i]);
|
|
569
|
+
const visible = stripAnsi(truncated);
|
|
570
|
+
return ` ${truncated}${" ".repeat(Math.max(0, widths[i] - visible.length))} `;
|
|
571
|
+
});
|
|
572
|
+
physicalLines.push("│" + formatted.join("│") + "│");
|
|
573
|
+
}
|
|
574
|
+
return physicalLines.join("\n");
|
|
575
|
+
}
|
|
576
|
+
// Width of the longest single line in a cell, not of the whole cell.
|
|
577
|
+
function cellWidth(value) {
|
|
578
|
+
return Math.max(...String(value).split("\n").map(line => stripAnsi(line).length));
|
|
375
579
|
}
|
|
376
580
|
function truncate(value, width) {
|
|
377
581
|
const plain = stripAnsi(value);
|
|
@@ -546,7 +750,6 @@ export function printCompactOutput(findings, scanInput, options) {
|
|
|
546
750
|
printCooldownWarning(target);
|
|
547
751
|
}
|
|
548
752
|
console.log(renderCommandCallout(section.command, section.targets));
|
|
549
|
-
printChainProofLines(section.targets);
|
|
550
753
|
console.log("");
|
|
551
754
|
}
|
|
552
755
|
}
|
|
@@ -590,6 +793,10 @@ export function printCompactOutput(findings, scanInput, options) {
|
|
|
590
793
|
console.log(`${chalk.cyan(String(direct))} ${chalk.white("direct")}` +
|
|
591
794
|
`${chalk.gray(" · ")}` +
|
|
592
795
|
`${chalk.cyan(String(transitive))} ${chalk.white("transitive")}`);
|
|
796
|
+
const compactProdSplit = countProdFindings(findings);
|
|
797
|
+
if (compactProdSplit !== null) {
|
|
798
|
+
console.log(chalk.gray(` └ ${compactProdSplit.prodTotal} of ${compactProdSplit.total} findings in prod dependencies`));
|
|
799
|
+
}
|
|
593
800
|
if (options?.licenseFindings && options.licenseFindings.length > 0) {
|
|
594
801
|
const lHigh = options.licenseFindings.filter(f => f.severity === "high").length;
|
|
595
802
|
const lMed = options.licenseFindings.filter(f => f.severity === "medium").length;
|
|
@@ -620,7 +827,7 @@ export function printCompactOutput(findings, scanInput, options) {
|
|
|
620
827
|
}
|
|
621
828
|
}
|
|
622
829
|
if (options?.all) {
|
|
623
|
-
printTable(findings, null);
|
|
830
|
+
printTable(findings, null, undefined, plan);
|
|
624
831
|
}
|
|
625
832
|
else {
|
|
626
833
|
console.log("");
|
|
@@ -717,6 +924,8 @@ function formatFixCommandSummary(plan) {
|
|
|
717
924
|
const sectionLabel = sectionCount === 1 ? "group" : "groups";
|
|
718
925
|
return `${sectionCount} command ${sectionLabel} ready across ${packageCount} ${packageLabel}${severitySummary ? ` (${severitySummary})` : ""}.`;
|
|
719
926
|
}
|
|
927
|
+
// No table carries a Published column, so the publish date rides on the command
|
|
928
|
+
// itself in both verbose and compact output, as it did before the column existed.
|
|
720
929
|
function renderCommandCallout(command, targets) {
|
|
721
930
|
const display = targets ? formatFixCommandWithPublishDates(command, targets) : command;
|
|
722
931
|
return chalk.bold.cyan(`> ${display}`);
|
|
@@ -732,151 +941,107 @@ function summarizeAdjustedValidation(targets) {
|
|
|
732
941
|
}
|
|
733
942
|
return { checked, vulnerable };
|
|
734
943
|
}
|
|
735
|
-
function
|
|
736
|
-
const
|
|
737
|
-
const
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
944
|
+
function buildFixRowContexts(findings) {
|
|
945
|
+
const byPackage = new Map();
|
|
946
|
+
for (const finding of findings) {
|
|
947
|
+
const list = byPackage.get(finding.pkg.name);
|
|
948
|
+
if (list)
|
|
949
|
+
list.push(finding);
|
|
950
|
+
else
|
|
951
|
+
byPackage.set(finding.pkg.name, [finding]);
|
|
952
|
+
}
|
|
953
|
+
const contexts = new Map();
|
|
954
|
+
for (const [name, group] of byPackage) {
|
|
955
|
+
// The package's own finding describes Type, Root and IDs; fall back to the
|
|
956
|
+
// first of the group when the package only appears as somebody else's parent.
|
|
957
|
+
const own = group.find(f => f.relationship === "direct") ?? group[0];
|
|
958
|
+
const worst = group.reduce((a, b) => (severityOrder[b.severity] > severityOrder[a.severity] ? b : a));
|
|
959
|
+
let bestEpss = null;
|
|
960
|
+
let bestSignal = null;
|
|
961
|
+
for (const finding of group) {
|
|
962
|
+
if (!finding.epssScores || finding.epssScores.length === 0)
|
|
963
|
+
continue;
|
|
964
|
+
const top = finding.epssScores.slice().sort((a, b) => b.percentile - a.percentile)[0];
|
|
965
|
+
if (bestEpss === null || top.epss > bestEpss) {
|
|
966
|
+
bestEpss = top.epss;
|
|
967
|
+
bestSignal = computePrioritySignal(finding.severity, finding.epssScores);
|
|
744
968
|
}
|
|
745
969
|
}
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
? chalk.blue(String(target.scannedVersions))
|
|
758
|
-
: "-",
|
|
759
|
-
target.knownVulnerableVersions !== null && target.knownVulnerableVersions !== undefined
|
|
760
|
-
? target.knownVulnerableVersions > 0
|
|
761
|
-
? chalk.yellow(String(target.knownVulnerableVersions))
|
|
762
|
-
: chalk.green(String(target.knownVulnerableVersions))
|
|
763
|
-
: "-",
|
|
764
|
-
isBreaking ? chalk.yellow("⚠") : "",
|
|
765
|
-
];
|
|
766
|
-
});
|
|
767
|
-
if (rows.length === 0)
|
|
768
|
-
return;
|
|
769
|
-
const widths = widthsOverride ?? computeTableWidths(headers, rows);
|
|
770
|
-
const line = (left, mid, right) => left + widths.map(w => "─".repeat(w + 2)).join(mid) + right;
|
|
771
|
-
console.log(line("┌", "┬", "┐"));
|
|
772
|
-
console.log(renderRow(headers, widths));
|
|
773
|
-
console.log(line("├", "┼", "┤"));
|
|
774
|
-
for (const row of rows) {
|
|
775
|
-
console.log(renderRow(row.map(value => String(value)), widths));
|
|
776
|
-
}
|
|
777
|
-
if (validationSummary) {
|
|
778
|
-
console.log(line("├", "┼", "┤"));
|
|
779
|
-
console.log(renderRow([
|
|
780
|
-
chalk.bold("Total"),
|
|
781
|
-
"-",
|
|
782
|
-
"-",
|
|
783
|
-
"-",
|
|
784
|
-
chalk.blue(String(validationSummary.checked)),
|
|
785
|
-
validationSummary.vulnerable > 0
|
|
786
|
-
? chalk.yellow(String(validationSummary.vulnerable))
|
|
787
|
-
: chalk.green(String(validationSummary.vulnerable)),
|
|
788
|
-
"",
|
|
789
|
-
], widths));
|
|
970
|
+
contexts.set(name, {
|
|
971
|
+
severity: worst.severity,
|
|
972
|
+
relationship: formatRelLabel(own),
|
|
973
|
+
root: shortenRootSummary(formatRootDependencySummary(own)),
|
|
974
|
+
epss: bestEpss,
|
|
975
|
+
prioritySignal: bestSignal,
|
|
976
|
+
ids: own.vulnerabilities.map(v => v.id),
|
|
977
|
+
advisoryVersion: own.firstFixedVersion ?? null,
|
|
978
|
+
scanned: own.validatedTargetScannedVersions ?? null,
|
|
979
|
+
stillVulnerable: own.validatedTargetKnownVulnerableVersions ?? null,
|
|
980
|
+
});
|
|
790
981
|
}
|
|
791
|
-
|
|
982
|
+
return contexts;
|
|
792
983
|
}
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
984
|
+
/**
|
|
985
|
+
* The one remediation table. Every fix-plan section draws exactly this.
|
|
986
|
+
*
|
|
987
|
+
* Context is word-wrapped rather than truncated because it is prose, so the whole
|
|
988
|
+
* table wraps. An adjustment note already represented by the Scanned and Still
|
|
989
|
+
* vulnerable columns is dropped rather than repeated underneath.
|
|
990
|
+
*/
|
|
991
|
+
/**
|
|
992
|
+
* Totals row for a set of rendered rows, or undefined when nothing was scanned.
|
|
993
|
+
*
|
|
994
|
+
* Parent upgrades carry no validation counts, so a totals row across only those
|
|
995
|
+
* would read 0 of 0 and mean nothing.
|
|
996
|
+
*/
|
|
997
|
+
function summarizeRenderedValidation(rows) {
|
|
998
|
+
const scanned = rows.filter(row => row.scanned != null);
|
|
999
|
+
if (scanned.length === 0)
|
|
1000
|
+
return undefined;
|
|
1001
|
+
return validationTotalsRow({
|
|
1002
|
+
checked: scanned.reduce((total, row) => total + (row.scanned ?? 0), 0),
|
|
1003
|
+
vulnerable: scanned.reduce((total, row) => total + (row.stillVulnerable ?? 0), 0),
|
|
807
1004
|
});
|
|
808
|
-
if (rows.length === 0)
|
|
809
|
-
return;
|
|
810
|
-
// Allow the Context column (index 4) up to 60 chars so reason text is not truncated.
|
|
811
|
-
const widths = widthsOverride ?? computeTableWidths(headers, rows, [40, 40, 40, 40, 60]);
|
|
812
|
-
const line = (left, mid, right) => left + widths.map(w => "─".repeat(w + 2)).join(mid) + right;
|
|
813
|
-
console.log(line("┌", "┬", "┐"));
|
|
814
|
-
console.log(renderRow(headers, widths));
|
|
815
|
-
console.log(line("├", "┼", "┤"));
|
|
816
|
-
for (const row of rows) {
|
|
817
|
-
for (const outputRow of renderWrappedRow(row.map(value => String(value)), widths)) {
|
|
818
|
-
console.log(outputRow);
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
console.log(line("└", "┴", "┘"));
|
|
822
1005
|
}
|
|
823
|
-
function
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
1006
|
+
function printActionTargetsTable(targets, remainingNotes, widthsOverride, contexts, showUsage = true) {
|
|
1007
|
+
for (const target of targets) {
|
|
1008
|
+
if (!target.adjustmentNote)
|
|
1009
|
+
continue;
|
|
1010
|
+
const isCountedVulnerabilityNote = target.scannedVersions !== null &&
|
|
1011
|
+
target.scannedVersions !== undefined &&
|
|
1012
|
+
target.adjustmentNote.includes("is still known vulnerable for");
|
|
1013
|
+
if (!isCountedVulnerabilityNote)
|
|
1014
|
+
remainingNotes.push(target.adjustmentNote);
|
|
1015
|
+
}
|
|
1016
|
+
if (targets.length === 0)
|
|
1017
|
+
return;
|
|
1018
|
+
const columns = selectColumns(ACTION_TABLE_COLUMNS, showUsage);
|
|
1019
|
+
const rows = targets.map(target => fixTargetToTableRow(target, contexts?.get(target.package)));
|
|
1020
|
+
// Totalled from the rendered rows, not the raw targets, so the total always adds
|
|
1021
|
+
// up the numbers printed above it. A target with no counts of its own can still
|
|
1022
|
+
// resolve them from its finding, and summing the targets missed exactly those.
|
|
1023
|
+
const totalsRow = summarizeRenderedValidation(rows);
|
|
1024
|
+
const widths = widthsOverride ?? columnWidths(columns, totalsRow ? [...rows, totalsRow] : rows);
|
|
1025
|
+
printColumnTable(columns, rows, widths, { wrap: true, totalsRow });
|
|
828
1026
|
}
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
usageText = target.usage.imported ? `${target.usage.files.length} file(s)` : "unused";
|
|
841
|
-
}
|
|
842
|
-
rows.push([
|
|
843
|
-
target.package,
|
|
844
|
-
target.currentVersion ?? "-",
|
|
845
|
-
target.targetVersion,
|
|
846
|
-
usageText,
|
|
847
|
-
target.scannedVersions !== null && target.scannedVersions !== undefined ? String(target.scannedVersions) : "-",
|
|
848
|
-
target.knownVulnerableVersions !== null && target.knownVulnerableVersions !== undefined ? String(target.knownVulnerableVersions) : "-",
|
|
849
|
-
isBreaking ? "⚠" : "",
|
|
850
|
-
]);
|
|
851
|
-
}
|
|
852
|
-
const summary = summarizeAdjustedValidation(section.targets);
|
|
853
|
-
rows.push(["Total", "-", "-", "-", String(summary.checked), String(summary.vulnerable), ""]);
|
|
854
|
-
}
|
|
855
|
-
return computeTableWidths(headers, rows);
|
|
856
|
-
}
|
|
857
|
-
function shouldRenderParentUpgradeTable(targets) {
|
|
858
|
-
return targets.length > 0 && targets.every(target => target.kind === "parent-upgrade" || target.kind === "parent-update");
|
|
859
|
-
}
|
|
860
|
-
function computeSharedParentUpgradeTableWidths(sections) {
|
|
861
|
-
const parentSections = sections.filter(section => shouldRenderParentUpgradeTable(section.targets));
|
|
862
|
-
if (parentSections.length === 0)
|
|
1027
|
+
/**
|
|
1028
|
+
* One width set for every remediation table in the run.
|
|
1029
|
+
*
|
|
1030
|
+
* Both tables draw the same columns, so they must also be measured together:
|
|
1031
|
+
* sizing them separately produced 134 and 151 in the same Nest report. Every
|
|
1032
|
+
* target is measured regardless of section kind, because the renderer splits by
|
|
1033
|
+
* target kind and anything left unmeasured gets truncated.
|
|
1034
|
+
*/
|
|
1035
|
+
function computeSharedActionTableWidths(sections, showUsage, contexts) {
|
|
1036
|
+
const allTargets = sections.flatMap(section => section.targets);
|
|
1037
|
+
if (allTargets.length === 0)
|
|
863
1038
|
return undefined;
|
|
864
|
-
const
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
rows.push([
|
|
873
|
-
target.package,
|
|
874
|
-
target.currentVersion ?? "-",
|
|
875
|
-
target.targetVersion,
|
|
876
|
-
usageText,
|
|
877
|
-
target.reason,
|
|
878
|
-
]);
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
return computeTableWidths(headers, rows, [40, 40, 40, 40, 60]);
|
|
1039
|
+
const columns = selectColumns(ACTION_TABLE_COLUMNS, showUsage);
|
|
1040
|
+
// Built with the same contexts the renderer uses, so a count resolved from a
|
|
1041
|
+
// finding is measured rather than truncated when it is wider than the target's.
|
|
1042
|
+
const rows = allTargets.map(target => fixTargetToTableRow(target, contexts?.get(target.package)));
|
|
1043
|
+
const totalsRow = summarizeRenderedValidation(rows);
|
|
1044
|
+
if (totalsRow)
|
|
1045
|
+
rows.push(totalsRow);
|
|
1046
|
+
return columnWidths(columns, rows);
|
|
882
1047
|
}
|