本文整理了Java中org.sonar.api.rules.Rule.setKey
方法的一些代码示例,展示了Rule.setKey
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rule.setKey
方法的具体详情如下:
包路径:org.sonar.api.rules.Rule
类名称:Rule
方法名:setKey
[英]Sets the rule key
[中]设置规则键
代码示例来源:origin: SonarSource/sonarqube
public Rule setUniqueKey(String repositoryKey, String key) {
return setRepositoryKey(repositoryKey).setKey(key).setConfigKey(key);
}
代码示例来源:origin: SonarSource/sonarqube
rule.setKey(StringUtils.trim(keyAttribute));
rule.setKey(StringUtils.trim(cursor.collectDescendantText(false)));
代码示例来源:origin: SonarSource/sonarqube
.setName(rule.getName())
.setLanguage(rule.getLanguage())
.setKey(rule.getRuleKey())
.setConfigKey(rule.getConfigKey())
.setIsTemplate(rule.isTemplate())
代码示例来源:origin: SonarSource/sonarqube
.setName(ruleDefinition.getName())
.setLanguage(ruleDefinition.getLanguage())
.setKey(ruleDefinition.getRuleKey())
.setConfigKey(ruleDefinition.getConfigKey())
.setIsTemplate(ruleDefinition.isTemplate())
代码示例来源:origin: org.sonarsource.sonarqube/sonar-plugin-api
public Rule setUniqueKey(String repositoryKey, String key) {
return setRepositoryKey(repositoryKey).setKey(key).setConfigKey(key);
}
代码示例来源:origin: org.codehaus.sonar/sonar-plugin-api
public Rule setUniqueKey(String repositoryKey, String key) {
return setRepositoryKey(repositoryKey).setKey(key).setConfigKey(key);
}
代码示例来源:origin: octo-technology/sonar-objective-c
rules.add(rule);
rule.setName(previousLine);
rule.setKey(previousLine);
} else if (line.matches("Summary:.*")) {
inDescription = true;
代码示例来源:origin: org.codehaus.sonar/sonar-deprecated
rule.setKey(StringUtils.trim(keyAttribute));
rule.setKey(StringUtils.trim(cursor.collectDescendantText(false)));
代码示例来源:origin: octo-technology/sonar-objective-c
private void recordViolation(final org.sonar.api.resources.File resource,
final SMInputCursor line) throws XMLStreamException {
final Rule rule = Rule.create();
final Violation violation = Violation.create(rule, resource);
// PMD Priorities are 1, 2, 3, 4, 5 RulePriority[0] is INFO
rule.setSeverity(RulePriority.values()[PMD_MINIMUM_PRIORITY
- Integer.valueOf(line.getAttrValue("priority"))]);
rule.setKey(line.getAttrValue("rule"));
rule.setRepositoryKey(OCLintRuleRepository.REPOSITORY_KEY);
violation.setLineId(Integer.valueOf(line.getAttrValue("beginline")));
violation.setMessage(line.getElemStringValue());
foundViolations.add(violation);
}
代码示例来源:origin: org.sonarsource.sonarqube/sonar-server
.setName(rule.getName())
.setLanguage(rule.getLanguage())
.setKey(rule.getRuleKey())
.setConfigKey(rule.getConfigKey())
.setIsTemplate(rule.isTemplate())
代码示例来源:origin: org.sonarsource.sonarqube/sonar-server
.setName(ruleDefinition.getName())
.setLanguage(ruleDefinition.getLanguage())
.setKey(ruleDefinition.getRuleKey())
.setConfigKey(ruleDefinition.getConfigKey())
.setIsTemplate(ruleDefinition.isTemplate())
代码示例来源:origin: org.sonarsource.sonarqube/sonar-plugin-api
rule.setKey(StringUtils.trim(keyAttribute));
rule.setKey(StringUtils.trim(cursor.collectDescendantText(false)));
内容来源于网络,如有侵权,请联系作者删除!