user1403505
user1403505

Reputation: 1005

How to create a new rule in sonar

I am new to SONAR. Planning to create a new rule

//ifStatement/statement[not(block)] ->rule 

this is the test rule I want to create but when i navigate to quality profile as administrator I get this screen shot and there is no new rule link. Can any one help me in getting started on how to create a new rule. Thanks for your help.

enter image description here

Upvotes: 2

Views: 18510

Answers (1)

You want to create an XPath-based rule for the C# language, so here's how to proceed:

  1. Log in as Administrator in your SonarQube instance.
  2. Go in your quality profile and look for the "XPath" rule.
  3. Click on "Copy" link on this rule.
  4. Fill all the required information to create your new XPath-based rule.
  5. Once you save it, you'll be redirected to this new rule in your quality profile: just activate it by checking the box.

Upvotes: 3

Related Questions