Skip to content

Commit

Permalink
Merge pull request snyk#1284 from snyk/fix/count-graph-packages-corre…
Browse files Browse the repository at this point in the history
…ctly

fix: correctly count graph packages
  • Loading branch information
lili2311 committed Jul 24, 2020
2 parents c2221a2 + e80c8a1 commit 870212f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/lib/snyk-test/run-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,10 @@ async function parseRes(
pkgManager,
options.severityThreshold,
);

// For Node.js: inject additional information (for remediation etc.) into the response.
if (payload.modules) {
res.dependencyCount =
payload.modules.numDependencies ||
depGraph.countPathsToRoot(depGraph.rootPkg);
payload.modules.numDependencies || depGraph.getPkgs().length - 1;
if (res.vulnerabilities) {
res.vulnerabilities.forEach((vuln) => {
if (payload.modules && payload.modules.pluck) {
Expand Down

0 comments on commit 870212f

Please sign in to comment.