use of com.mercedesbenz.sechub.sarif.model.Tool in project sechub by mercedes-benz.
the class SarifReportSupport method fetchRuleForResult.
public Rule fetchRuleForResult(Result result, Run run) {
// Each run has ONE tool, multiple results and taxonomies
Tool tool = run.getTool();
Driver driver = tool.getDriver();
List<Rule> rules = driver.getRules();
String ruleId = result.getRuleId();
/* @formatter:off */
Rule ruleFound = rules.stream().filter(rule -> rule.getId().equals(ruleId)).findFirst().orElse(null);
/* @formatter:on */
return ruleFound;
}