alec
alec

Reputation: 151

StyleCop Integration With SonarQube

I am attempting to get Stylecop to work with Sonar so I can analyze my ASP.NET application. I am currently running Sonar 4.3 and using the C# 3.0 plugin for Stylecop integration. I am assuming that the C# plugin has made the dedicated StyleCop plugin from the SonarQube Ecosystem plugins obsolete, correct?

I am triggering the sonar analysis through Jenkins.

In the StyleCop subcategory within the C# plugin I have pointed to Both MSBuild.exe and StyleCop.dll When I restart my Sonar server, I am seeing the message "All Stylecop rules are disabled, skipping its execution." in my Sonar logs.

When I go to the Quality Profiles menu, the C# rules I have available are the default "Sonar Way" ones.

I have tried looking through the documentation, but it is hard to follow because the documentation isn't kept up to date with the Sonar Updates.

Any help in getting this to work is greatly appreciated. Thanks so much.

Upvotes: 0

Views: 4363

Answers (2)

Dinesh Bolkensteyn
Dinesh Bolkensteyn

Reputation: 3011

Once you have installed the StyleCop SonarQube plugin, you need indeed to go to the Quality Profiles menu, then pick the default quality profile (which by default is "Sonar way").

From there, you can search for all "StyleCop" rules by using the filters "Repository: StyleCop", and "Activation: Inactive".

You then can enable specific StyleCop rules by hitting the checkboxes, or all of them using "Bulk Change" on the right.

Upvotes: 3

Chathuranga Wijeratna
Chathuranga Wijeratna

Reputation: 901

in SonarQube go to

Quality Profiles -> C# -> Sonar way

from the top filters, select "Activation" -> "Inactive" then click "Search" Then you can click check-box to activate the rules that are the currently inactive, or you can use the "Bulk Change" feature to activate all.

Upvotes: 0

Related Questions