Skip to content

Commit

Permalink
Merge branch 'jfrog:master' into go-embed
Browse files Browse the repository at this point in the history
  • Loading branch information
noyshabtay authored Nov 30, 2023
2 parents b56cdc3 + bc67740 commit 748d6ec
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 1 addition & 3 deletions src/main/java/com/jfrog/ide/common/nodes/DependencyNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ public ImpactTree getImpactTree() {

@SuppressWarnings("unused")
public void setImpactTree(ImpactTree impactTree) {
if (this.impactTree == null) {
this.impactTree = impactTree;
}
this.impactTree = impactTree;
}

public void addIssue(IssueNode issue) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
import lombok.Getter;

public class ImpactTree {

public static final int IMPACT_PATHS_LIMIT = 50;
public static final int IMPACT_PATHS_LIMIT = 20;

@Getter
@JsonProperty
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/com/jfrog/ide/common/yarn/YarnTreeBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,13 @@ private List<String> extractSinglePath(String projectRootId, String packageFullN
*/
List<List<String>> extractMultiplePaths(String projectRootId, String packageFullName, List<String> rawDependencyPaths) {
List<List<String>> paths = new ArrayList<>();
int limit = Math.min(rawDependencyPaths.size(), ImpactTree.IMPACT_PATHS_LIMIT);
for (int i = 0; i < limit; i++) {
List<String> path = extractSinglePath(projectRootId, packageFullName, rawDependencyPaths.get(i));
for (String rawDepPath : rawDependencyPaths) {
List<String> path = extractSinglePath(projectRootId, packageFullName, rawDepPath);
if (path != null) {
paths.add(path);
if (paths.size() >= ImpactTree.IMPACT_PATHS_LIMIT) {
break;
}
}
}
return paths;
Expand Down

0 comments on commit 748d6ec

Please sign in to comment.