MSBuild sonar scanner is not considering all rules present in quality profile

137 views
Skip to first unread message

shilpam...@gmail.com

unread,
Apr 3, 2018, 12:53:59 AM4/3/18
to SonarQube


Hi ,


I am trying to migrate from sonar runner to MSBuild sonar scanner for C# projects.

  • MSBuild sonar scanner version used : 3.0.0.629
  • SonarQube version : 5.6
  • MSBuild version : 14
  • Sonar C# Plugin : 5.3.1

The execution is getting completed successfully and the results are posted in the sonarQube server. But some issues which was reporting before with sonar runner are not reported now.

For eg : Issues are not reported against the rule-CA1709: Identifiers should be cased correctly. The rule is present in the quality profile used, But couldn't find it in the generated '.sonarqube\conf\SonarQubeFxCop-cs.ruleset' file.

Can anyone please help me to solve this issue?


Thanks ,

Shilpa

valeri....@sonarsource.com

unread,
Apr 3, 2018, 8:09:06 AM4/3/18
to SonarQube
Hi Shilpa,

SonarScanner for MSBuild will disable all analyzers that don't have a corresponding SonarQube plugin, including FxCop. In the older versions of the scanner there was a hack that allowed FxCop to run, but we recently removed that (I can dig up the version if you are interested) because most of the high value FxCop rules were implemented in SonarC#. We did not implement all of the rules because we think there are many low value rules that are not worth the time. If you would like to see a rule from FxCop that's not implemented yet, you could create a ticket in the SonarC# repository and we will consider it:

If you still want to run FxCop, you could install a 3rd party SonarQube plugin:

Regards,
Valeri

 

shilpam...@gmail.com

unread,
Apr 4, 2018, 2:17:05 AM4/4/18
to SonarQube
Hi valery ,

Thank you so much for your help.

I could find that the support for execution of FxCop is removed from Sonar scanner MSBuild V4.0.0.821.
The version which i am currently using is 3.0.0.629, with this version I assume the fxcop analysis should work.
I even tried with Sonar scanner MSBuild V2.2.0.24, But the issue still exists.

 

Thanks ,

Shilpa

valeri....@sonarsource.com

unread,
Apr 4, 2018, 5:56:13 AM4/4/18
to SonarQube
Did you enable the CA1709 on SonarQube? The ruleset files are generated on SonarQube based on the enabled/disabled status of the rules registered on the server. If you don't see the FxCop rules on SonarQube you will have to install the FxCop plugin on SonarQube.

shilpam...@gmail.com

unread,
Apr 5, 2018, 12:51:10 AM4/5/18
to SonarQube

The FxCop rules are enabled on SonarQube server, and a few of them are reporting issues as well.
But i could find that CA1709 is an exception, there can be more such rules.

Amaury Leve

unread,
Apr 10, 2018, 11:10:26 AM4/10/18
to shilpam...@gmail.com, SonarQube
Hi Shilpa,

You might be able to find more help on the GitHub repository of the FxCop plugin (https://github.com/DanielHWe/sonar-fxcop) or directly on StackOverflow as this plugin is not supported by us.

Cheers,
Amaury

On Thu, Apr 5, 2018 at 6:51 AM <shilpam...@gmail.com> wrote:

The FxCop rules are enabled on SonarQube server, and a few of them are reporting issues as well.
But i could find that CA1709 is an exception, there can be more such rules.

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/db94f72b-e0e0-4aac-b076-2a6abed70423%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Amaury Levé | SonarSource

Software Developer - .Net Team

http://sonarsource.com


Are you using SonarLint in your IDE? 

shilpam...@gmail.com

unread,
Apr 12, 2018, 7:11:49 AM4/12/18
to SonarQube

I analyzed further and found that only one FxCop rule - CA1709 is missed and all other FxCop rules are reporting issues as expected.
The fxcop plugin is currently not installed in our SonarQube server.

Regards ,

Shilpa
Reply all
Reply to author
Forward
0 new messages