Search in sources :

Example 1 with AdHocRule

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());
}
Also used : ScannerReportWriter(org.sonar.scanner.protocol.output.ScannerReportWriter) AdHocRule(org.sonar.api.batch.sensor.rule.AdHocRule)

Aggregations

AdHocRule (org.sonar.api.batch.sensor.rule.AdHocRule)1 ScannerReportWriter (org.sonar.scanner.protocol.output.ScannerReportWriter)1