use of com.contrastsecurity.sarif.Tool in project bsl-language-server by 1c-syntax.
the class SarifReporter method createTool.
private Tool createTool() {
var name = serverInfo.getName();
var organization = "1c-syntax";
var version = serverInfo.getVersion();
var informationUri = URI.create(configuration.getSiteRoot());
var language = configuration.getLanguage().getLanguageCode();
var rules = diagnosticInfos.stream().map(SarifReporter::createReportingDescriptor).collect(Collectors.toSet());
var driver = new ToolComponent().withName(name).withOrganization(organization).withVersion(version).withInformationUri(informationUri).withLanguage(language).withRules(rules);
return new Tool().withDriver(driver);
}
use of com.contrastsecurity.sarif.Tool 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