use of org.sonar.server.computation.task.projectanalysis.qualityprofile.ActiveRule in project sonarqube by SonarSource.
the class CommonRule method processFile.
@CheckForNull
public DefaultIssue processFile(Component file, String fileLanguage) {
DefaultIssue issue = null;
RuleKey ruleKey = RuleKey.of(commonRepositoryForLang(fileLanguage), key);
Optional<ActiveRule> activeRule = activeRulesHolder.get(ruleKey);
if (activeRule.isPresent()) {
CommonRuleIssue cri = doProcessFile(file, activeRule.get());
if (cri != null) {
issue = new DefaultIssue();
issue.setGap(cri.effortToFix);
issue.setMessage(cri.message);
issue.setRuleKey(ruleKey);
issue.setSeverity(activeRule.get().getSeverity());
issue.setLine(null);
issue.setChecksum("");
}
}
return issue;
}
Aggregations