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.
- package/dist/display/index.js +9 -10
- package/dist/display/index.js.map +1 -1
- package/package.json +1 -1
package/dist/display/index.js
CHANGED
|
@@ -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
|
-
|
|
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.
|
|
19
|
+
result = result.concat(prefix);
|
|
20
20
|
}
|
|
21
21
|
if (options === null || options === void 0 ? void 0 : options.debug) {
|
|
22
|
-
|
|
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 [
|
|
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.
|
|
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,
|
|
42
|
+
error_1.exitWith(error_1.ExitCode.VulnerabilitiesFound, output, testResults);
|
|
43
43
|
}
|
|
44
44
|
if (!hasDependencies) {
|
|
45
|
-
|
|
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
|
|
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,
|
|
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,C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