Package org.sonar.api.batch.sensor.rule
Interface NewAdHocRule
-
public interface NewAdHocRule
Builder 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 NewAdHocRule
addDefaultImpact(SoftwareQuality softwareQuality, Severity severity)
Add new default impact to the rule.NewAdHocRule
cleanCodeAttribute(CleanCodeAttribute attribute)
Clean Code Attribute of the rule.NewAdHocRule
description(java.lang.String description)
The description of the rule.NewAdHocRule
engineId(java.lang.String engineId)
Unique identifier of the external analyzer (e.g.NewAdHocRule
name(java.lang.String name)
The name of the rule.NewAdHocRule
ruleId(java.lang.String ruleId)
Unique rule identifier for a givenengineId(String)
void
save()
Save the rule.NewAdHocRule
severity(Severity severity)
Set the severity of the rule.NewAdHocRule
type(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.
-
-