use of org.sonar.api.batch.sensor.rule.AdHocRule in project sonarqube by SonarSource.
the class DefaultSensorStorage method store.
@Override
public void store(AdHocRule adHocRule) {
ScannerReportWriter writer = reportPublisher.getWriter();
final ScannerReport.AdHocRule.Builder builder = ScannerReport.AdHocRule.newBuilder();
builder.setEngineId(adHocRule.engineId());
builder.setRuleId(adHocRule.ruleId());
builder.setName(adHocRule.name());
String description = adHocRule.description();
if (description != null) {
builder.setDescription(description);
}
builder.setSeverity(Constants.Severity.valueOf(adHocRule.severity().name()));
builder.setType(ScannerReport.IssueType.valueOf(adHocRule.type().name()));
writer.appendAdHocRule(builder.build());
}
Aggregations