kodingo-cli 1.1.5 → 1.1.7
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/commands/security-scan.js +22 -12
- package/package.json +1 -1
|
@@ -84,7 +84,7 @@ async function securityScanCommand(options = {}) {
|
|
|
84
84
|
if (findings.length === 0) {
|
|
85
85
|
if (!options.silent)
|
|
86
86
|
console.log(" ✔ No known vulnerabilities found in your dependencies.");
|
|
87
|
-
return
|
|
87
|
+
// Do NOT return here — continue to code-level analysis below
|
|
88
88
|
}
|
|
89
89
|
if (!options.silent) {
|
|
90
90
|
console.log(` ⚠ ${findings.length} vulnerabilit${findings.length === 1 ? "y" : "ies"} found:\n`);
|
|
@@ -136,19 +136,29 @@ async function securityScanCommand(options = {}) {
|
|
|
136
136
|
console.log(" ✔ No suspicious patterns detected.");
|
|
137
137
|
}
|
|
138
138
|
else {
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
139
|
+
const BATCH_SIZE = 20;
|
|
140
|
+
let totalScanned = 0, totalFindings = 0, totalDismissed = 0;
|
|
141
|
+
for (let i = 0; i < candidates.length; i += BATCH_SIZE) {
|
|
142
|
+
const batch = candidates.slice(i, i + BATCH_SIZE);
|
|
143
|
+
const codeScanRes = await fetch(`${apiUrl}/security/scan-code`, {
|
|
144
|
+
method: "POST",
|
|
145
|
+
headers: { "Content-Type": "application/json", "X-Kodingo-Token": token },
|
|
146
|
+
body: JSON.stringify({ repo: repoName, candidates: batch }),
|
|
147
|
+
});
|
|
148
|
+
if (codeScanRes.ok) {
|
|
149
|
+
const codeResult = await codeScanRes.json();
|
|
150
|
+
totalScanned += codeResult.scanned;
|
|
151
|
+
totalFindings += codeResult.findingsCreated;
|
|
152
|
+
totalDismissed += codeResult.dismissed;
|
|
153
|
+
}
|
|
154
|
+
else if (!options.silent) {
|
|
155
|
+
console.error(` ✖ Code analysis batch failed: ${codeScanRes.status}`);
|
|
156
|
+
break;
|
|
148
157
|
}
|
|
149
158
|
}
|
|
150
|
-
|
|
151
|
-
console.
|
|
159
|
+
if (!options.silent && totalScanned > 0) {
|
|
160
|
+
console.log(` Checked ${totalScanned} candidates — ${totalFindings} confirmed, ${totalDismissed} dismissed after review
|
|
161
|
+
`);
|
|
152
162
|
}
|
|
153
163
|
}
|
|
154
164
|
}
|