1

I want to use only custom rules on my code with SonarQube. I have just dll's of custom rules.

How Can I do that? As per document I understood that I need to create a new rule but not sure how to create it.

Ram
  • 11,404
  • 15
  • 62
  • 93

1 Answers1

2

You must create new rules in the SonarQube UI based on the existing "Template for custom FxCop rules" (key: CustomRuleTemplate) rule template. Everything you need to know is explained in the description of that rule template.

Dinesh Bolkensteyn
  • 2,971
  • 1
  • 17
  • 20
  • Hi Dinesh, Yes I got that screen but now sure what shall I enter for Name, Key and Description? I tried setting following Name = title of custom fx cop rule (e.g. "AvoidUsingThreadAbort") Key = key of custom FxCop rule (e.g. CT0003) Description = Description of rule (e.g. "AvoidUsingThreadAbort ") However if I add this rule to any profile, it fails. Can you help? – Ram Dec 12 '14 at 06:49
  • Enter whatever you want for Name, Key and Description. This is internal to SonarQube. What kind of failure do you get? Don't forget to properly place your FxCop custom rule assembly as instructed. – Dinesh Bolkensteyn Dec 17 '14 at 15:03
  • I placed the custom assemblies in Rules folder of FxCop10 in Program files. I also have FxCop10 in WinSDK folder but I am not putting the custom rules there. I do not get any error but while adding the custom rule in profile, it fails. – Ram Dec 19 '14 at 11:10