From 182e837a08dcdfc3e8a7b3a667fdf2ab92d79cd4 Mon Sep 17 00:00:00 2001 From: Eyal Kapon Date: Sun, 27 Oct 2024 14:23:07 +0200 Subject: [PATCH] checking all cves in applicability scan --- .../ide/idea/scan/SourceCodeScannerManager.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/jfrog/ide/idea/scan/SourceCodeScannerManager.java b/src/main/java/com/jfrog/ide/idea/scan/SourceCodeScannerManager.java index 071df92c..1649a2c4 100644 --- a/src/main/java/com/jfrog/ide/idea/scan/SourceCodeScannerManager.java +++ b/src/main/java/com/jfrog/ide/idea/scan/SourceCodeScannerManager.java @@ -90,16 +90,14 @@ public List applicabilityScan(ProgressIndicator indicator, Collect return Collections.emptyList(); } List scanResults = new ArrayList<>(); - Map> issuesMap = mapDirectIssuesByCve(fileTreeNodes); - + Map> issuesMap = mapIssuesByCve(fileTreeNodes); try { if (applicability.isPackageTypeSupported(packageType)) { indicator.setText("Running applicability scan"); indicator.setFraction(0.25); - Set directIssuesCVEs = issuesMap.keySet(); - // If no direct dependencies with issues are found by Xray, the applicability scan is irrelevant. - if (!directIssuesCVEs.isEmpty()) { - List applicabilityResults = applicability.execute(createBasicScannerInput().cves(List.copyOf(directIssuesCVEs)), checkCanceled, indicator); + Set issuesCVEs = issuesMap.keySet(); + if (!issuesCVEs.isEmpty()) { + List applicabilityResults = applicability.execute(createBasicScannerInput().cves(List.copyOf(issuesCVEs)), checkCanceled, indicator); scanResults.addAll(applicabilityResults); } } @@ -294,14 +292,11 @@ public static List convertToSkippedFolders(String excludePattern) { * @param fileTreeNodes collection of FileTreeNodes. * @return a map of CVE IDs to lists of issues with them. */ - private Map> mapDirectIssuesByCve(Collection fileTreeNodes) { + private Map> mapIssuesByCve(Collection fileTreeNodes) { Map> issues = new HashMap<>(); for (FileTreeNode fileTreeNode : fileTreeNodes) { for (TreeNode treeNode : fileTreeNode.getChildren()) { DependencyNode dep = (DependencyNode) treeNode; - if (dep.isIndirect()) { - continue; - } Enumeration treeNodeEnumeration = dep.children(); while (treeNodeEnumeration.hasMoreElements()) { TreeNode node = treeNodeEnumeration.nextElement();