Skip to content

Commit 84a8192

Browse files
author
Mithilesh Pawar
authored
Returning immediately once the Bfl node is matched. (#92)
1 parent 564e033 commit 84a8192

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public List<String> projectBranches(@NonNull UUID projectId, String filter)
203203
line -> CxBaseObject.parse(line, BRANCHES_TYPE));
204204
}
205205

206-
public List<CodeBashing> codeBashingList(@NonNull String cweId,@NonNull String language,@NonNull String queryName) throws IOException, InterruptedException, CxException {
206+
public List<CodeBashing> codeBashingList(@NonNull String cweId, @NonNull String language, @NonNull String queryName) throws IOException, InterruptedException, CxException {
207207
this.logger.info("Fetching the codebashing link");
208208

209209
List<String> arguments = new ArrayList<>();
@@ -276,16 +276,16 @@ public int getResultsBfl(@NonNull UUID scanId, @NonNull String queryId, List<Nod
276276
}
277277

278278
private int getIndexOfBfLNode(List<Node> bflNodes, List<Node> resultNodes) {
279-
280-
int bflNodeIndex = -1;
279+
280+
int bflNodeNotFound = -1;
281281
for (Node bflNode : bflNodes) {
282282
for (Node resultNode : resultNodes) {
283283
if (bflNode.equals(resultNode)) {
284-
bflNodeIndex = resultNodes.indexOf(resultNode);
284+
return resultNodes.indexOf(resultNode);
285285
}
286286
}
287287
}
288-
return bflNodeIndex;
288+
return bflNodeNotFound;
289289
}
290290

291291
private List<String> withConfigArguments(List<String> commands) {

0 commit comments

Comments
 (0)