import java.util.Set;
import org.apache.ibatis.cursor.Cursor;
import org.slf4j.LoggerFactory;
+import org.sonar.api.rules.CleanCodeAttribute;
import org.sonar.ce.task.projectexport.steps.DumpElement;
import org.sonar.ce.task.projectexport.steps.DumpWriter;
import org.sonar.ce.task.projectexport.steps.ProjectHolder;
}
private static ProjectDump.AdHocRule convertToAdHocRule(RuleDto ruleDto, ProjectDump.AdHocRule.Builder builder) {
+ CleanCodeAttribute cleanCodeAttribute = ruleDto.getCleanCodeAttribute();
return builder
.clear()
.setRef(ruleDto.getUuid())
.setType(ruleDto.getType())
.setScope(ruleDto.getScope().name())
.setMetadata(buildMetadata(ruleDto))
- .setCleanCodeAttribute(ruleDto.getCleanCodeAttribute() != null ? ruleDto.getCleanCodeAttribute().name() : null)
+ .setCleanCodeAttribute(cleanCodeAttribute != null ? cleanCodeAttribute.name() : null)
.addAllImpacts(buildImpacts(ruleDto.getDefaultImpacts()))
.build();
}
import javax.annotation.CheckForNull;
import org.sonar.api.rule.RuleKey;
import org.sonar.api.rule.RuleStatus;
+import org.sonar.api.rules.CleanCodeAttribute;
import org.sonar.api.rules.RuleType;
import org.sonar.db.issue.ImpactDto;
ruleForIndexingDto.setRuleDescriptionSectionsDtos(Sets.newHashSet(r.getRuleDescriptionSectionDtos()));
}
- if (r.getCleanCodeAttribute() != null) {
- ruleForIndexingDto.cleanCodeAttributeCategory = r.getCleanCodeAttribute().getAttributeCategory().name();
+ CleanCodeAttribute cleanCodeAttribute = r.getCleanCodeAttribute();
+ if (cleanCodeAttribute != null) {
+ ruleForIndexingDto.cleanCodeAttributeCategory = cleanCodeAttribute.getAttributeCategory().name();
}
ruleForIndexingDto.setImpacts(r.getDefaultImpacts());
import org.sonar.api.resources.Languages;
import org.sonar.api.rule.RuleKey;
import org.sonar.api.rules.CleanCodeAttribute;
-import org.sonar.api.rules.RuleType;
import org.sonar.api.server.debt.DebtRemediationFunction;
import org.sonar.api.server.debt.internal.DefaultDebtRemediationFunction;
import org.sonar.db.issue.ImpactDto;