Skip to content

Commit 51e8285

Browse files
committed
AST-12643 SCA Details
- Add supportsQuickFix field to SCA results and each package path
1 parent 6a84482 commit 51e8285

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

src/main/java/com/checkmarx/ast/results/result/DependencyPath.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,23 @@ public class DependencyPath {
2020
List<String> locations;
2121
boolean isResolved;
2222
boolean isDevelopment;
23+
boolean supportsQuickFix;
2324

2425

2526
public DependencyPath(@JsonProperty("Id") String id,
2627
@JsonProperty("name") String name,
2728
@JsonProperty("version") String version,
2829
@JsonProperty("locations") List<String> locations,
2930
@JsonProperty("isResolved") boolean isResolved,
30-
@JsonProperty("isDevelopment") boolean isDevelopment) {
31+
@JsonProperty("isDevelopment") boolean isDevelopment,
32+
@JsonProperty("supportsQuickFix") boolean supportsQuickFix) {
3133

3234
Id = id;
3335
this.name = name;
3436
this.version = version;
3537
this.locations = locations;
3638
this.isResolved = isResolved;
3739
this.isDevelopment = isDevelopment;
40+
this.supportsQuickFix = supportsQuickFix;
3841
}
3942
}

src/main/java/com/checkmarx/ast/results/result/ScaPackageData.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,19 @@ public class ScaPackageData {
1818
String fixLink;
1919
List<List<DependencyPath>> dependencyPaths;
2020
boolean outdated;
21+
boolean supportsQuickFix;
2122

2223

2324
public ScaPackageData(@JsonProperty("Id") String id,
2425
@JsonProperty("fixLink") String fixLink,
2526
@JsonProperty("dependencyPaths") List<List<DependencyPath>> dependencyPaths,
26-
@JsonProperty("outdated") boolean outdated) {
27+
@JsonProperty("outdated") boolean outdated,
28+
@JsonProperty("supportsQuickFix") boolean supportsQuickFix) {
2729

2830
Id = id;
2931
this.fixLink = fixLink;
3032
this.dependencyPaths = dependencyPaths;
3133
this.outdated = outdated;
34+
this.supportsQuickFix = supportsQuickFix;
3235
}
3336
}

src/main/java/com/checkmarx/ast/wrapper/CxConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public final class CxConstants {
5353
static final String ADDITONAL_PARAMS = "--additional-params";
5454
static final String ENGINE = "--engine";
5555
static final String SUB_CMD_KICS_REALTIME = "kics-realtime";
56-
static final String SCA_REMEDIATION_PACKAGE_FILE = "--package-file";
56+
static final String SCA_REMEDIATION_PACKAGE_FILES = "--package-files";
5757
static final String SCA_REMEDIATION_PACKAGE = "--package";
5858
static final String SCA_REMEDIATION_PACKAGE_VERSION = "--package-version";
5959
static final String CMD_UTILS = "utils";

src/main/java/com/checkmarx/ast/wrapper/CxWrapper.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,17 @@
1313
import com.fasterxml.jackson.databind.ObjectMapper;
1414
import com.fasterxml.jackson.databind.type.CollectionType;
1515
import com.fasterxml.jackson.databind.type.TypeFactory;
16-
import jdk.nashorn.internal.runtime.regexp.joni.ast.StringNode;
1716
import lombok.NonNull;
1817
import org.apache.commons.lang3.StringUtils;
1918
import org.slf4j.Logger;
2019
import org.slf4j.LoggerFactory;
20+
2121
import java.io.IOException;
2222
import java.nio.file.Files;
23-
import java.util.*;
23+
import java.util.ArrayList;
24+
import java.util.List;
25+
import java.util.Map;
26+
import java.util.UUID;
2427

2528
public class CxWrapper {
2629

@@ -284,20 +287,19 @@ private List<String> buildResultsArgumentsArray(UUID scanId, ReportFormat report
284287
return arguments;
285288
}
286289

287-
public String scaRemediation(String packageFile, String packages, String packageVersion) throws CxException, IOException, InterruptedException {
290+
public String scaRemediation(String packageFiles, String packages, String packageVersion) throws CxException, IOException, InterruptedException {
288291
List<String> arguments = new ArrayList<>();
289292
arguments.add(CxConstants.CMD_UTILS);
290293
arguments.add(CxConstants.CMD_REMEDIATION);
291294
arguments.add(CxConstants.SUB_CMD_REMEDIATION_SCA);
292-
arguments.add(CxConstants.SCA_REMEDIATION_PACKAGE_FILE);
293-
arguments.add(packageFile);
295+
arguments.add(CxConstants.SCA_REMEDIATION_PACKAGE_FILES);
296+
arguments.add(packageFiles);
294297
arguments.add(CxConstants.SCA_REMEDIATION_PACKAGE);
295298
arguments.add(packages);
296299
arguments.add(CxConstants.SCA_REMEDIATION_PACKAGE_VERSION);
297300
arguments.add(packageVersion);
298301

299302
return Execution.executeCommand(withConfigArguments(arguments), logger, line -> null);
300-
301303
}
302304

303305
public int getResultsBfl(@NonNull UUID scanId, @NonNull String queryId, List<Node> resultNodes)

0 commit comments

Comments
 (0)