I need some help with implementing some violation checking to sonar erlang plugin. Can someone describe me what is the process to add a rule with a parameter, and use the value of the parameter of the rule in a sensor to decide is that a violation or not. (like cyclomatic complexity, I can measure it is 5 but it is only a violation over 10)
I created a rules.xml
and used with
And created a default profile, and parsed it. I can see the profile and the rules in Sonar GUI, but the default value is not filled... What did I miss?
I copied the profile, and defined a default value to this rule in the GUI. It worked fine. But in the code, when I got the active profile with:
it contains the rule, but the:
returns with a param without default value... what did I wrong here (on the GUI I can see the value 10, and the profile variable refers to the newly created erlang profile...
Thank you for your help,
I suppose that you mixed rules and active_rules. The parameter of the active rule should correctly contain the value displayed in quality profile. Do you confirm that the variable rule.getParam("maximum");
in your email is about the rule repository but not about the profile ?
On 22 June 2012 16:02, Tamás Kende <[hidden email]> wrote:
thank you for your answer... now it is solved, but you are right, I have mixed the profile -- rule repo stuff... I have to refactor+rewrite that part.
One more question. When I create the rule for the violation, what is the best way to get the repository key for the given rule? Can I get it from the profile?
Is it good or bad if I use the same repo key (Erlang) for the dialyzer (analyser tool 1) and refactorerl (analyser tool2) rules?
On Fri, Jun 29, 2012 at 10:32 AM, Simon Brandhof <[hidden email]> wrote:
Yes you can get it from profile -> active rules -> rules. It's also possible to use the component RuleFinder :
It's recommended to use two different repositories to prevent from conflicts of rule keys.
|Free forum by Nabble||Edit this page|