[sonar-dev] Sonar rule with multiple cardinality

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[sonar-dev] Sonar rule with multiple cardinality

Tamás Kende

I am planning to implement a regex rule for erlang projects and I do not really understand how can I get a multiple cardinality rules from the active profile...Do I have to get all the rules, iterate over them and check are they with the name what I want? Or is there any proper way? 
With this: rulesProfile.getActiveRuleByConfigKey("Erlang", "B001"); I could only get one rule...
Will the copied rule have a different key starting with B001? I have just started the development, so I cannot really try it out at the moment, and I hope someone knows the answer :)

here is my rule definition:
      <![CDATA[ Custom regex which match to a single line of the code. If a match happens, violation will be raised.]]>
      <param key="regex" type="TEXT" default="^$">
<description><![CDATA[Regex pattern of the rule.]]></description>
 <param key="ignoreCase" type="BOOLEAN" default="false">
  <description><![CDATA[Controls whether to ignore case when searching. Default value is false.]]></description>