Package org.sonar.api.batch.sensor.rule
Interface NewAdHocRule
-
public interface NewAdHocRuleBuilder for a rule imported from an external rule engine by aSensor. This allows to provide more metadata for rules associated toExternalIssue. Don't forget tosave()after setting the fields.- Since:
- 7.4
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description NewAdHocRuleaddDefaultImpact(SoftwareQuality softwareQuality, Severity severity)Add new default impact to the rule.NewAdHocRulecleanCodeAttribute(CleanCodeAttribute attribute)Clean Code Attribute of the rule.NewAdHocRuledescription(java.lang.String description)The description of the rule.NewAdHocRuleengineId(java.lang.String engineId)Unique identifier of the external analyzer (e.g.NewAdHocRulename(java.lang.String name)The name of the rule.NewAdHocRuleruleId(java.lang.String ruleId)Unique rule identifier for a givenengineId(String)voidsave()Save the rule.NewAdHocRuleseverity(Severity severity)Set the severity of the rule.NewAdHocRuletype(RuleType type)Type of the rule.
-
-
-
Method Detail
-
engineId
NewAdHocRule engineId(java.lang.String engineId)
Unique identifier of the external analyzer (e.g. eslint, pmd, ...)
-
ruleId
NewAdHocRule ruleId(java.lang.String ruleId)
Unique rule identifier for a givenengineId(String)
-
name
NewAdHocRule name(java.lang.String name)
The name of the rule.
-
description
NewAdHocRule description(@Nullable java.lang.String description)
The description of the rule.
-
type
NewAdHocRule type(RuleType type)
Type of the rule.
-
cleanCodeAttribute
NewAdHocRule cleanCodeAttribute(CleanCodeAttribute attribute)
Clean Code Attribute of the rule. Providing it is optional for now but will become mandatory in the future.- Since:
- 10.1
-
severity
NewAdHocRule severity(Severity severity)
Set the severity of the rule.
-
addDefaultImpact
NewAdHocRule addDefaultImpact(SoftwareQuality softwareQuality, Severity severity)
Add new default impact to the rule. It is only possible to define a default impact for a givenSoftwareQuality- Since:
- 10.1
-
save
void save()
Save the rule. There is almost no validation, except that no duplicated ad hoc rule keys are permitted.
-
-