Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix settings #154

Merged
merged 2 commits into from
May 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 31 additions & 25 deletions src/main/java/com/hcl/appscan/sdk/scanners/sast/SAClient.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* © Copyright IBM Corporation 2016.
* © Copyright HCL Technologies Ltd. 2017, 2022, 2023.
* © Copyright HCL Technologies Ltd. 2017, 2024.
* LICENSE: Apache License, Version 2.0 https://www.apache.org/licenses/LICENSE-2.0
*/

Expand Down Expand Up @@ -320,36 +320,42 @@ private List<String> getClientArgs(Map<String, String> properties) {
args.add(OPT_CONFIG);
args.add(properties.get(CONFIG_FILE));
}
if(properties.containsKey(DEBUG) || System.getProperty(DEBUG.toUpperCase()) != null)
if(properties.containsKey(DEBUG) || System.getProperty(DEBUG.toUpperCase()) != null) {
args.add(OPT_DEBUG);
if(properties.containsKey(VERBOSE))
}
if(properties.containsKey(VERBOSE)) {
args.add(OPT_VERBOSE);
if(properties.containsKey(THIRD_PARTY) || System.getProperty(THIRD_PARTY) != null)
}
if(properties.containsKey(THIRD_PARTY) || System.getProperty(THIRD_PARTY) != null) {
args.add(OPT_THIRD_PARTY);
if (properties.containsKey(OPEN_SOURCE_ONLY) || System.getProperty(OPEN_SOURCE_ONLY) != null || properties.get(CoreConstants.SCANNER_TYPE).equals(CoreConstants.SOFTWARE_COMPOSITION_ANALYZER))
}
if (properties.containsKey(OPEN_SOURCE_ONLY) || System.getProperty(OPEN_SOURCE_ONLY) != null || properties.getOrDefault(CoreConstants.SCANNER_TYPE, "").equals(CoreConstants.SOFTWARE_COMPOSITION_ANALYZER)) {
args.add(OPT_OPEN_SOURCE_ONLY);
if (properties.containsKey(SOURCE_CODE_ONLY) || System.getProperty(SOURCE_CODE_ONLY) != null)
args.add(OPT_SOURCE_CODE_ONLY);
if(properties.containsKey(SCAN_SPEED)){
args.add(OPT_SCAN_SPEED);
if(properties.containsKey(SECRETS_ENABLED) || System.getProperty(SECRETS_ENABLED) != null)
}
if (properties.containsKey(SOURCE_CODE_ONLY) || System.getProperty(SOURCE_CODE_ONLY) != null) {
args.add(OPT_SOURCE_CODE_ONLY);
}
if(properties.containsKey(SCAN_SPEED)) {
args.add(OPT_SCAN_SPEED);
if(properties.get(SCAN_SPEED).equals(NORMAL)){
args.add(THOROUGH);
} else if (properties.get(SCAN_SPEED).equals(FAST)) {
args.add(DEEP);
} else if (properties.get(SCAN_SPEED).equals(FASTER)) {
args.add(BALANCED);
} else if (properties.get(SCAN_SPEED).equals(FASTEST)) {
args.add(SIMPLE);
} else {
args.add(properties.get(SCAN_SPEED));
}
}
if(properties.containsKey(SECRETS_ENABLED) || System.getProperty(SECRETS_ENABLED) != null) {
args.add(OPT_SECRETS_ENABLED);
if(properties.containsKey(SECRETS_ONLY) || System.getProperty(SECRETS_ONLY) != null)
}
if(properties.containsKey(SECRETS_ONLY) || System.getProperty(SECRETS_ONLY) != null) {
args.add(OPT_SECRETS_ONLY);
//it is being used to have the same values in the freestyle & pipeline projects
if(properties.get(SCAN_SPEED).equals(NORMAL)){
args.add(THOROUGH);
} else if (properties.get(SCAN_SPEED).equals(FAST)) {
args.add(DEEP);
} else if (properties.get(SCAN_SPEED).equals(FASTER)) {
args.add(BALANCED);
} else if (properties.get(SCAN_SPEED).equals(FASTEST)) {
args.add(SIMPLE);
} else {
args.add(properties.get(SCAN_SPEED));
}
}

}

return args;
}

Expand Down
Loading