use of com.synopsys.integration.alert.processor.api.extract.model.project.ComponentConcernSeverity in project hub-alert by blackducksoftware.
the class ComponentConcernConverter method createPolicySectionPiece.
private String createPolicySectionPiece(ComponentConcern policyConcern) {
String verb = createItemOperationVerb(policyConcern.getOperation());
ComponentConcernSeverity policySeverity = policyConcern.getSeverity();
String severityString = "";
if (!ComponentConcernSeverity.UNSPECIFIED_UNKNOWN.equals(policySeverity)) {
severityString = String.format(TRIPLE_STRING_REPLACEMENT, formattedOpenParen, formatter.encode(policySeverity.getPolicyLabel()), formattedCloseParen);
}
return String.format("%s%s%s%s%s", policyConcern.getType().getDisplayName(), verb, severityString, formattedColonSpace, formatter.encode(policyConcern.getName()));
}
use of com.synopsys.integration.alert.processor.api.extract.model.project.ComponentConcernSeverity in project hub-alert by blackducksoftware.
the class ProjectIssueModelConverter method createVulnerabilitySeverityStatusSectionPieces.
private List<String> createVulnerabilitySeverityStatusSectionPieces(ProjectIssueModel projectIssueModel) {
List<String> severityStatusSectionPieces = new LinkedList<>();
String encodedSeverityStatus = formatter.encode(LABEL_SEVERITY_STATUS);
IssueBomComponentDetails bomComponentDetails = projectIssueModel.getBomComponentDetails();
Optional<IssueVulnerabilityDetails> vulnerabilityDetails = projectIssueModel.getVulnerabilityDetails();
if (vulnerabilityDetails.isPresent()) {
ComponentVulnerabilities componentVulnerabilities = bomComponentDetails.getComponentVulnerabilities();
componentVulnerabilities.computeHighestSeverity().map(ComponentConcernSeverity::getVulnerabilityLabel).map(formatter::encode).map(severity -> encodedSeverityStatus + severity).ifPresentOrElse(severityStatusSectionPieces::add, () -> severityStatusSectionPieces.add(encodedSeverityStatus + "None"));
severityStatusSectionPieces.add(formatter.getLineSeparator());
severityStatusSectionPieces.add(formatter.getSectionSeparator());
severityStatusSectionPieces.add(formatter.getLineSeparator());
}
return severityStatusSectionPieces;
}
Aggregations