Skip to content

Commit

Permalink
[fix]:完善解析结果逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
Xing0317 committed Aug 13, 2024
1 parent 9ef52ca commit b19af35
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/cn/xmirror/sca/common/ResultParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ public static MutableTreeNode parseResult(String path, Overview overview) {
* @return
*/
private static List<Component> getAllComponent(Component component, ArrayList<Component> componentList) {
if (component.getVulnerabilities() != null && !component.getVulnerabilities().isEmpty()) {
componentList.add(component);
}
if (component.getChildren() == null || component.getChildren().isEmpty()) {
return componentList;
}
for (Component child : component.getChildren()) {
if (child.getVulnerabilities() != null && !child.getVulnerabilities().isEmpty()) {
componentList.add(child);
}
getAllComponent(child, componentList);
}
return componentList;
Expand Down Expand Up @@ -175,6 +175,6 @@ private static Collection<Component> distinctAndSortComponent(List<Component> co
@Data
public static class Result {
private List<Component> children;
private String error;
private String error;
}
}

0 comments on commit b19af35

Please sign in to comment.