org.sonar.check.Rule.status()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(174)

本文整理了Java中org.sonar.check.Rule.status方法的一些代码示例,展示了Rule.status的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rule.status方法的具体详情如下:
包路径:org.sonar.check.Rule
类名称:Rule
方法名:status

Rule.status介绍

暂无

代码示例

代码示例来源:origin: SonarSource/sonarqube

private static Rule toRule(String repositoryKey, Class clazz, org.sonar.check.Rule ruleAnnotation) {
 String ruleKey = StringUtils.defaultIfEmpty(ruleAnnotation.key(), clazz.getCanonicalName());
 String ruleName = StringUtils.defaultIfEmpty(ruleAnnotation.name(), null);
 String description = StringUtils.defaultIfEmpty(ruleAnnotation.description(), null);
 Rule rule = Rule.create(repositoryKey, ruleKey, ruleName);
 rule.setDescription(description);
 rule.setSeverity(RulePriority.fromCheckPriority(ruleAnnotation.priority()));
 rule.setCardinality(ruleAnnotation.cardinality());
 rule.setStatus(ruleAnnotation.status());
 rule.setTags(ruleAnnotation.tags());
 List<Field> fields = FieldUtils2.getFields(clazz, true);
 for (Field field : fields) {
  addRuleProperty(rule, field);
 }
 return rule;
}

代码示例来源:origin: SonarSource/sonarqube

private static RulesDefinition.NewRule loadRule(RulesDefinition.NewExtendedRepository repo, Class clazz, org.sonar.check.Rule ruleAnnotation) {
 String ruleKey = StringUtils.defaultIfEmpty(ruleAnnotation.key(), clazz.getCanonicalName());
 String ruleName = StringUtils.defaultIfEmpty(ruleAnnotation.name(), null);
 String description = StringUtils.defaultIfEmpty(ruleAnnotation.description(), null);
 RulesDefinition.NewRule rule = repo.createRule(ruleKey);
 rule.setName(ruleName).setHtmlDescription(description);
 rule.setSeverity(ruleAnnotation.priority().name());
 rule.setTemplate(ruleAnnotation.cardinality() == Cardinality.MULTIPLE);
 rule.setStatus(RuleStatus.valueOf(ruleAnnotation.status()));
 rule.setTags(ruleAnnotation.tags());
 List<Field> fields = FieldUtils2.getFields(clazz, true);
 for (Field field : fields) {
  loadParameters(rule, field);
 }
 return rule;
}

代码示例来源:origin: org.sonarsource.sonarqube/sonar-plugin-api

private static Rule toRule(String repositoryKey, Class clazz, org.sonar.check.Rule ruleAnnotation) {
 String ruleKey = StringUtils.defaultIfEmpty(ruleAnnotation.key(), clazz.getCanonicalName());
 String ruleName = StringUtils.defaultIfEmpty(ruleAnnotation.name(), null);
 String description = StringUtils.defaultIfEmpty(ruleAnnotation.description(), null);
 Rule rule = Rule.create(repositoryKey, ruleKey, ruleName);
 rule.setDescription(description);
 rule.setSeverity(RulePriority.fromCheckPriority(ruleAnnotation.priority()));
 rule.setCardinality(ruleAnnotation.cardinality());
 rule.setStatus(ruleAnnotation.status());
 rule.setTags(ruleAnnotation.tags());
 List<Field> fields = FieldUtils2.getFields(clazz, true);
 for (Field field : fields) {
  addRuleProperty(rule, field);
 }
 return rule;
}

代码示例来源:origin: org.codehaus.sonar/sonar-deprecated

private Rule toRule(String repositoryKey, Class clazz, org.sonar.check.Rule ruleAnnotation) {
 String ruleKey = StringUtils.defaultIfEmpty(ruleAnnotation.key(), clazz.getCanonicalName());
 String ruleName = StringUtils.defaultIfEmpty(ruleAnnotation.name(), null);
 String description = StringUtils.defaultIfEmpty(ruleAnnotation.description(), null);
 Rule rule = Rule.create(repositoryKey, ruleKey, ruleName);
 rule.setDescription(description);
 rule.setSeverity(RulePriority.fromCheckPriority(ruleAnnotation.priority()));
 rule.setCardinality(ruleAnnotation.cardinality());
 rule.setStatus(ruleAnnotation.status());
 rule.setTags(ruleAnnotation.tags());
 List<Field> fields = FieldUtils2.getFields(clazz, true);
 for (Field field : fields) {
  addRuleProperty(rule, field);
 }
 return rule;
}

代码示例来源:origin: org.codehaus.sonar/sonar-plugin-api

private RulesDefinition.NewRule loadRule(RulesDefinition.NewExtendedRepository repo, Class clazz, org.sonar.check.Rule ruleAnnotation) {
 String ruleKey = StringUtils.defaultIfEmpty(ruleAnnotation.key(), clazz.getCanonicalName());
 String ruleName = StringUtils.defaultIfEmpty(ruleAnnotation.name(), null);
 String description = StringUtils.defaultIfEmpty(ruleAnnotation.description(), null);
 RulesDefinition.NewRule rule = repo.createRule(ruleKey);
 rule.setName(ruleName).setHtmlDescription(description);
 rule.setSeverity(ruleAnnotation.priority().name());
 rule.setTemplate(ruleAnnotation.cardinality() == Cardinality.MULTIPLE);
 rule.setStatus(RuleStatus.valueOf(ruleAnnotation.status()));
 rule.setTags(ruleAnnotation.tags());
 List<Field> fields = FieldUtils2.getFields(clazz, true);
 for (Field field : fields) {
  loadParameters(rule, field);
 }
 return rule;
}

代码示例来源:origin: Cognifide/AEM-Rules-for-SonarQube

private RulesDefinition.NewRule createRule(RulesDefinition.NewExtendedRepository repo, Class clazz, Rule ruleAnnotation) {
  String ruleKey = StringUtils.defaultIfEmpty(ruleAnnotation.key(), clazz.getCanonicalName());
  String ruleName = StringUtils.defaultIfEmpty(ruleAnnotation.name(), null);
  String description = StringUtils.defaultIfEmpty(loadDescription(ruleKey), "No description yet.");
  RulesDefinition.NewRule rule = repo.createRule(ruleKey);
  rule.setName(ruleName).setMarkdownDescription(description);
  rule.setSeverity(ruleAnnotation.priority().name());
  rule.setStatus(RuleStatus.valueOf(ruleAnnotation.status()));
  rule.setTags(ruleAnnotation.tags());
  setMetadata(rule, clazz);
  List<Field> fields = FieldUtils2.getFields(clazz, true);
  for (Field field : fields) {
    loadParameters(rule, field);
  }
  return rule;
}

代码示例来源:origin: org.sonarsource.sonarqube/sonar-plugin-api

private static RulesDefinition.NewRule loadRule(RulesDefinition.NewExtendedRepository repo, Class clazz, org.sonar.check.Rule ruleAnnotation) {
 String ruleKey = StringUtils.defaultIfEmpty(ruleAnnotation.key(), clazz.getCanonicalName());
 String ruleName = StringUtils.defaultIfEmpty(ruleAnnotation.name(), null);
 String description = StringUtils.defaultIfEmpty(ruleAnnotation.description(), null);
 RulesDefinition.NewRule rule = repo.createRule(ruleKey);
 rule.setName(ruleName).setHtmlDescription(description);
 rule.setSeverity(ruleAnnotation.priority().name());
 rule.setTemplate(ruleAnnotation.cardinality() == Cardinality.MULTIPLE);
 rule.setStatus(RuleStatus.valueOf(ruleAnnotation.status()));
 rule.setTags(ruleAnnotation.tags());
 List<Field> fields = FieldUtils2.getFields(clazz, true);
 for (Field field : fields) {
  loadParameters(rule, field);
 }
 return rule;
}

相关文章