Package org.sonarsource.analyzer.commons
Class ExternalRuleLoader
java.lang.Object
org.sonarsource.analyzer.commons.ExternalRuleLoader
Creates external rule repository based on json file in the format
[ { "key": "...", "name": "..." }, ... ]
"key" and "name" are required properties. Also could be provided:
- url (link to rule page)
- description (html description of rule)
- constantDebtMinutes (e.g. 30, by default 5)
- tags (array of strings, e.g.
"tags": [ "foo", "bar" ]) - severity (as in SQ API, e.g. "MAJOR")
- type (as in SQ API, e.g. "BUG")
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.sonar.api.utils.Version -
Constructor Summary
ConstructorsConstructorDescriptionExternalRuleLoader(String linterKey, String linterName, String pathToMetadata, String languageKey) Deprecated.Use the constructor that also provide the SonarRuntime argument to determine if you can use the new Clean Code attributes and impacts API.ExternalRuleLoader(String linterKey, String linterName, String pathToMetadata, String languageKey, org.sonar.api.SonarRuntime sonarRuntime) -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateExternalRuleRepository(org.sonar.api.server.rule.RulesDefinition.Context context) booleanruleConstantDebtMinutes(String ruleKey) ruleKeys()org.sonar.api.batch.rule.SeverityruleSeverity(String ruleKey) org.sonar.api.rules.RuleType
-
Field Details
-
API_VERSION_SUPPORTING_CLEAN_CODE_IMPACTS_AND_ATTRIBUTES
public static final org.sonar.api.utils.Version API_VERSION_SUPPORTING_CLEAN_CODE_IMPACTS_AND_ATTRIBUTES
-
-
Constructor Details
-
ExternalRuleLoader
@Deprecated(since="2.6") public ExternalRuleLoader(String linterKey, String linterName, String pathToMetadata, String languageKey) Deprecated.Use the constructor that also provide the SonarRuntime argument to determine if you can use the new Clean Code attributes and impacts API. Then you should test "isCleanCodeImpactsAndAttributesSupported()" before using codeAttribute and codeImpacts. -
ExternalRuleLoader
-
-
Method Details
-
isCleanCodeImpactsAndAttributesSupported
public boolean isCleanCodeImpactsAndAttributesSupported() -
createExternalRuleRepository
public void createExternalRuleRepository(org.sonar.api.server.rule.RulesDefinition.Context context) -
ruleKeys
-
ruleType
-
ruleSeverity
-
ruleConstantDebtMinutes
-