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 Deprecated 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)
Deprecated.since 10.1, use impacts withaddDefaultImpact(SoftwareQuality, org.sonar.api.issue.impact.Severity)
insteadNewAdHocRule
type(RuleType type)
Deprecated.since 10.1, use impacts withaddDefaultImpact(SoftwareQuality, org.sonar.api.issue.impact.Severity)
instead
-
-
-
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
@Deprecated(since="10.1") NewAdHocRule type(RuleType type)
Deprecated.since 10.1, use impacts withaddDefaultImpact(SoftwareQuality, org.sonar.api.issue.impact.Severity)
insteadType 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
@Deprecated(since="10.1") NewAdHocRule severity(Severity severity)
Deprecated.since 10.1, use impacts withaddDefaultImpact(SoftwareQuality, org.sonar.api.issue.impact.Severity)
insteadSet 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.
-
-