From 4f66413d5ddc124ceb02ce74cec2c0d8e0694bef Mon Sep 17 00:00:00 2001 From: elchananarb Date: Tue, 8 Oct 2024 15:34:18 +0300 Subject: [PATCH 1/2] Enhance createKicsScan function to format additional parameters by replacing spaces with commas before executing the scan --- src/kics/kicsRealtimeProvider.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/kics/kicsRealtimeProvider.ts b/src/kics/kicsRealtimeProvider.ts index b70faea1..a0aadeee 100644 --- a/src/kics/kicsRealtimeProvider.ts +++ b/src/kics/kicsRealtimeProvider.ts @@ -296,9 +296,10 @@ export class KicsProvider { async createKicsScan(file: string | undefined) { let results; try { - const additionalParams = vscode.workspace + let additionalParams = vscode.workspace .getConfiguration("CheckmarxKICS") .get("Additional Parameters") as string; + additionalParams = additionalParams.replace(/\s+/g, ","); if (file) { results = await cx.getResultsRealtime(file, additionalParams); } else { From 4152d8b3cc6234eab0b220a562586613eabcaa7c Mon Sep 17 00:00:00 2001 From: elchananarb Date: Tue, 8 Oct 2024 19:21:43 +0300 Subject: [PATCH 2/2] preserve spaces within quotes when formatting additional parameters --- src/kics/kicsRealtimeProvider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kics/kicsRealtimeProvider.ts b/src/kics/kicsRealtimeProvider.ts index a0aadeee..c7f9c4e7 100644 --- a/src/kics/kicsRealtimeProvider.ts +++ b/src/kics/kicsRealtimeProvider.ts @@ -299,7 +299,7 @@ export class KicsProvider { let additionalParams = vscode.workspace .getConfiguration("CheckmarxKICS") .get("Additional Parameters") as string; - additionalParams = additionalParams.replace(/\s+/g, ","); + additionalParams = additionalParams.replace(/("[^"]*")|\s+/g, (match, quoted) => quoted ? quoted : ","); if (file) { results = await cx.getResultsRealtime(file, additionalParams); } else {