use of com.contrastsecurity.sarif.Run in project aws-codeguru-cli by aws.
the class ResultsAdapter method createSarifReport.
private static SarifSchema210 createSarifReport(final List<RecommendationSummary> recommendations) throws IOException {
val docUrl = "https://docs.aws.amazon.com/codeguru/latest/reviewer-ug/how-codeguru-reviewer-works.html";
val rulesMap = createSarifRuleDescriptions(recommendations);
val driver = new ToolComponent().withName("CodeGuru Reviewer Scanner").withInformationUri(URI.create(docUrl)).withRules(new HashSet<>(rulesMap.values()));
val results = recommendations.stream().map(ResultsAdapter::convertToSarif).collect(Collectors.toList());
val run = new Run().withTool(new Tool().withDriver(driver)).withResults(results);
return new SarifSchema210().withVersion(SarifSchema210.Version._2_1_0).with$schema(URI.create("http://json.schemastore.org/sarif-2.1.0-rtm.4")).withRuns(Arrays.asList(run));
}
Aggregations