org.sonar.api.server.rule
Class RulesDefinition.NewRule
java.lang.Object
org.sonar.api.server.rule.RulesDefinition.NewRule
- Enclosing interface:
- RulesDefinition
public static class RulesDefinition.NewRule
- extends Object
key
public String key()
setName
public RulesDefinition.NewRule setName(@Nullable
String s)
- Required rule name
setTemplate
public RulesDefinition.NewRule setTemplate(boolean template)
setSeverity
public RulesDefinition.NewRule setSeverity(String s)
setHtmlDescription
public RulesDefinition.NewRule setHtmlDescription(@Nullable
String s)
setHtmlDescription
public RulesDefinition.NewRule setHtmlDescription(@Nullable
URL classpathUrl)
- Load description from a file available in classpath. Example :
setHtmlDescription(getClass().getResource("/myrepo/Rule1234.html")
setMarkdownDescription
public RulesDefinition.NewRule setMarkdownDescription(@Nullable
String s)
setMarkdownDescription
public RulesDefinition.NewRule setMarkdownDescription(@Nullable
URL classpathUrl)
- Load description from a file available in classpath. Example :
setMarkdownDescription(getClass().getResource("/myrepo/Rule1234.md")
setStatus
public RulesDefinition.NewRule setStatus(RuleStatus status)
- Default value is
RuleStatus.READY. The value
RuleStatus.REMOVED is not accepted and raises an
IllegalArgumentException.
setDebtSubCharacteristic
public RulesDefinition.NewRule setDebtSubCharacteristic(@Nullable
String s)
- SQALE sub-characteristic. See http://www.sqale.org
- See Also:
for constant values
debtRemediationFunctions
public RulesDefinition.DebtRemediationFunctions debtRemediationFunctions()
- Factory of
DebtRemediationFunction
setDebtRemediationFunction
public RulesDefinition.NewRule setDebtRemediationFunction(@Nullable
DebtRemediationFunction fn)
- See Also:
debtRemediationFunctions()
setEffortToFixDescription
public RulesDefinition.NewRule setEffortToFixDescription(@Nullable
String s)
- For rules that use "Linear"/"Linear with offset" remediation functions, the meaning
of the function parameter (= "effort to fix") must be set. This description
explains what 1 point of "effort to fix" represents for the rule.
Example : : for the "Insufficient condition coverage", this description for the
remediation function coefficient/offset would be something like
"Effort to test one uncovered condition".
createParam
public RulesDefinition.NewParam createParam(String paramKey)
param
@CheckForNull
public RulesDefinition.NewParam param(String paramKey)
params
public Collection<RulesDefinition.NewParam> params()
addTags
public RulesDefinition.NewRule addTags(String... list)
- See Also:
RuleTagFormat
setTags
public RulesDefinition.NewRule setTags(String... list)
- See Also:
RuleTagFormat
setInternalKey
public RulesDefinition.NewRule setInternalKey(@Nullable
String s)
- Optional key that can be used by the rule engine. Not displayed
in webapp. For example the Java Checkstyle plugin feeds this field
with the internal path ("Checker/TreeWalker/AnnotationUseStyle").
toString
public String toString()
- Overrides:
toString in class Object
Copyright © 2009–2015 SonarSource. All rights reserved.