Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
Signed-off-by: nscuro <[email protected]>
  • Loading branch information
nscuro committed Mar 28, 2024
1 parent c43745a commit cf0b3e2
Show file tree
Hide file tree
Showing 17 changed files with 0 additions and 1,585 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,16 @@
import org.dependencytrack.notification.vo.AnalysisDecisionChange;
import org.dependencytrack.notification.vo.BomConsumedOrProcessed;
import org.dependencytrack.notification.vo.BomProcessingFailed;
import org.dependencytrack.notification.vo.ComponentVulnAnalysisComplete;
import org.dependencytrack.notification.vo.NewVulnerabilityIdentified;
import org.dependencytrack.notification.vo.NewVulnerableDependency;
import org.dependencytrack.notification.vo.PolicyViolationIdentified;
import org.dependencytrack.notification.vo.ProjectVulnAnalysisComplete;
import org.dependencytrack.notification.vo.VexConsumedOrProcessed;
import org.dependencytrack.notification.vo.ViolationAnalysisDecisionChange;
import org.dependencytrack.parser.common.resolver.CweResolver;
import org.dependencytrack.proto.notification.v1.BackReference;
import org.dependencytrack.proto.notification.v1.BomConsumedOrProcessedSubject;
import org.dependencytrack.proto.notification.v1.BomProcessingFailedSubject;
import org.dependencytrack.proto.notification.v1.Component;
import org.dependencytrack.proto.notification.v1.ComponentVulnAnalysisCompleteSubject;
import org.dependencytrack.proto.notification.v1.Group;
import org.dependencytrack.proto.notification.v1.Level;
import org.dependencytrack.proto.notification.v1.NewVulnerabilitySubject;
Expand All @@ -55,7 +52,6 @@
import org.dependencytrack.proto.notification.v1.PolicyViolationAnalysisDecisionChangeSubject;
import org.dependencytrack.proto.notification.v1.PolicyViolationSubject;
import org.dependencytrack.proto.notification.v1.Project;
import org.dependencytrack.proto.notification.v1.ProjectVulnAnalysisCompleteSubject;
import org.dependencytrack.proto.notification.v1.Scope;
import org.dependencytrack.proto.notification.v1.VexConsumedOrProcessedSubject;
import org.dependencytrack.proto.notification.v1.Vulnerability;
Expand All @@ -66,7 +62,6 @@
import java.math.BigDecimal;
import java.time.ZoneOffset;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;

Expand Down Expand Up @@ -185,8 +180,6 @@ private static Optional<com.google.protobuf.Any> convert(final Object subject) {
return Optional.of(Any.pack(convert(vcop)));
} else if (subject instanceof final PolicyViolationIdentified pvi) {
return Optional.of(Any.pack(convert(pvi)));
} else if (subject instanceof final ProjectVulnAnalysisComplete pac) {
return Optional.of(Any.pack(convert(pac)));
} else if (subject instanceof final org.dependencytrack.model.Project p) {
return Optional.of(Any.pack(convert(p)));
}
Expand Down Expand Up @@ -324,26 +317,6 @@ private static Project convert(final org.dependencytrack.model.Project project)
return builder.build();
}

private static ComponentVulnAnalysisCompleteSubject convert(ComponentVulnAnalysisComplete componentVulnAnalysisComplete) {

Component component = convert(componentVulnAnalysisComplete.getComponent());
ComponentVulnAnalysisCompleteSubject.Builder builder = ComponentVulnAnalysisCompleteSubject.newBuilder();
builder.setComponent(component);
List<Vulnerability> vulnerabilities = componentVulnAnalysisComplete.getVulnerabilityList().stream().map(NotificationModelConverter::convert).toList();
builder.addAllVulnerabilities(vulnerabilities);
return builder.build();
}

private static ProjectVulnAnalysisCompleteSubject convert(ProjectVulnAnalysisComplete notification) {
ProjectVulnAnalysisCompleteSubject.Builder builder = ProjectVulnAnalysisCompleteSubject.newBuilder();
builder.setToken(notification.getToken().toString());
builder.setProject(convert(notification.getProject()));
List<ComponentVulnAnalysisCompleteSubject> componentAnalysisCompleteSubjects = notification.getComponentAnalysisCompleteList().stream().map(NotificationModelConverter::convert).toList();
builder.addAllFindings(componentAnalysisCompleteSubjects);
builder.setStatus(notification.getStatus());
return builder.build();
}

private static Vulnerability convert(final org.dependencytrack.model.Vulnerability vulnerability) {
final Vulnerability.Builder builder = Vulnerability.newBuilder()
.setUuid(vulnerability.getUuid().toString())
Expand Down

This file was deleted.

Loading

0 comments on commit cf0b3e2

Please sign in to comment.