Class ExternalRuleLoader


  • public class ExternalRuleLoader
    extends Object
    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")
    • Constructor Detail

      • ExternalRuleLoader

        public ExternalRuleLoader​(String linterKey,
                                  String linterName,
                                  String pathToMetadata,
                                  String languageKey)
    • Method Detail

      • createExternalRuleRepository

        public void createExternalRuleRepository​(org.sonar.api.server.rule.RulesDefinition.Context context)
      • ruleType

        public org.sonar.api.rules.RuleType ruleType​(String ruleKey)
      • ruleSeverity

        public org.sonar.api.batch.rule.Severity ruleSeverity​(String ruleKey)
      • ruleConstantDebtMinutes

        public Long ruleConstantDebtMinutes​(String ruleKey)