Ejemplo n.º 1
0
 private boolean initAndAddIssue(DefaultIssue issue, @Nullable Violation violation) {
   RuleKey ruleKey = issue.ruleKey();
   Rule rule = rules.find(ruleKey);
   validateRule(issue, rule);
   ActiveRule activeRule = activeRules.find(ruleKey);
   if (activeRule == null) {
     // rule does not exist or is not enabled -> ignore the issue
     return false;
   }
   updateIssue(issue, rule, activeRule);
   if (filters.accept(issue, violation)) {
     cache.put(issue);
     return true;
   }
   return false;
 }
Ejemplo n.º 2
0
 private String getRuleName(RuleKey ruleKey) {
   Rule rule = rules.find(ruleKey);
   return rule != null ? rule.name() : null;
 }