snyk-cpp-plugin 2.16.3 → 2.16.4

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.
@@ -10,42 +10,41 @@ async function display(scanResults, testResults, errors, options) {
10
10
  if (errors.length > 0) {
11
11
  error_1.exitWith(error_1.ExitCode.Error, display_1.displayErrors(errors).join('\n'));
12
12
  }
13
- const result = [];
13
+ let result = [];
14
14
  let hasDependencies = false;
15
15
  let hasVulnerabilities = false;
16
16
  try {
17
17
  if (options === null || options === void 0 ? void 0 : options.path) {
18
18
  const prefix = chalk.bold.white(`\nTesting ${options.path}...\n`);
19
- result.push(prefix);
19
+ result = result.concat(prefix);
20
20
  }
21
21
  if (options === null || options === void 0 ? void 0 : options.debug) {
22
- const signatureLines = display_1.displaySignatures(scanResults);
23
- result.push(...signatureLines);
22
+ result = result.concat(display_1.displaySignatures(scanResults));
24
23
  }
25
24
  for (const testResult of testResults) {
26
25
  const depGraph = dep_graph_1.createFromJSON(testResult.depGraphData);
27
- const [dependencySection, issuesSection] = display_1.selectDisplayStrategy(options, depGraph, testResult);
26
+ const [dependencies, issues] = display_1.selectDisplayStrategy(options, depGraph, testResult);
28
27
  if (testResult.depGraphData.pkgs.length > 1) {
29
28
  hasDependencies = true;
30
29
  }
31
30
  if (testResult.issues.length > 0) {
32
31
  hasVulnerabilities = true;
33
32
  }
34
- result.push(...dependencySection, ...issuesSection);
33
+ result = result.concat(dependencies, issues);
35
34
  }
36
35
  }
37
36
  catch (error) {
38
37
  debug_1.debug(error.message || `Error displaying the results: ${error}`);
39
38
  error_1.exitWith(error_1.ExitCode.Error, 'Error displaying results.');
40
39
  }
40
+ const output = result.join('\n');
41
41
  if (hasVulnerabilities) {
42
- error_1.exitWith(error_1.ExitCode.VulnerabilitiesFound, result.join('\n'), testResults);
42
+ error_1.exitWith(error_1.ExitCode.VulnerabilitiesFound, output, testResults);
43
43
  }
44
44
  if (!hasDependencies) {
45
- result.push(`Could not detect supported target files in ${options === null || options === void 0 ? void 0 : options.path}`);
46
- error_1.exitWith(error_1.ExitCode.NoSupportedFiles, result.join('\n'));
45
+ error_1.exitWith(error_1.ExitCode.NoSupportedFiles, `${output}\nCould not detect supported target files in ${options === null || options === void 0 ? void 0 : options.path}`);
47
46
  }
48
- return result.join('\n');
47
+ return output;
49
48
  }
50
49
  exports.display = display;
51
50
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/display/index.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,oCAAiC;AACjC,+CAAiD;AAEjD,uCAImB;AACnB,0CAAoD;AAE7C,KAAK,UAAU,OAAO,CAC3B,WAAyB,EACzB,WAAyB,EACzB,MAAgB,EAChB,OAAiB;IAEjB,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;QACrB,gBAAQ,CAAC,gBAAQ,CAAC,KAAK,EAAE,uBAAa,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;KAC5D;IAED,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,eAAe,GAAG,KAAK,CAAC;IAC5B,IAAI,kBAAkB,GAAG,KAAK,CAAC;IAE/B,IAAI;QACF,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,EAAE;YACjB,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,OAAO,CAAC,IAAI,OAAO,CAAC,CAAC;YAClE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SACrB;QAED,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,EAAE;YAClB,MAAM,cAAc,GAAG,2BAAiB,CAAC,WAAW,CAAC,CAAC;YACtD,MAAM,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,CAAC;SAChC;QAED,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE;YACpC,MAAM,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