kodingo-cli 1.1.6 → 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.
@@ -136,19 +136,29 @@ async function securityScanCommand(options = {}) {
136
136
  console.log(" ✔ No suspicious patterns detected.");
137
137
  }
138
138
  else {
139
- const codeScanRes = await fetch(`${apiUrl}/security/scan-code`, {
140
- method: "POST",
141
- headers: { "Content-Type": "application/json", "X-Kodingo-Token": token },
142
- body: JSON.stringify({ repo: repoName, candidates }),
143
- });
144
- if (codeScanRes.ok) {
145
- const codeResult = await codeScanRes.json();
146
- if (!options.silent) {
147
- console.log(` Checked ${codeResult.scanned} candidates — ${codeResult.findingsCreated} confirmed, ${codeResult.dismissed} dismissed as false positives after review\n`);
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
- else if (!options.silent) {
151
- console.error(` ✖ Code analysis failed: ${codeScanRes.status}`);
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kodingo-cli",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "description": "Kodingo CLI",
5
5
  "license": "MIT",
6
6
  "private": false,