Search in sources :

Example 1 with Tool

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;
}
Also used : Driver(com.mercedesbenz.sechub.sarif.model.Driver) Rule(com.mercedesbenz.sechub.sarif.model.Rule) Tool(com.mercedesbenz.sechub.sarif.model.Tool)

Aggregations

Driver (com.mercedesbenz.sechub.sarif.model.Driver)1 Rule (com.mercedesbenz.sechub.sarif.model.Rule)1 Tool (com.mercedesbenz.sechub.sarif.model.Tool)1