Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate with SonarQube #1

Open
erik-am opened this issue Aug 15, 2016 · 1 comment
Open

Integrate with SonarQube #1

erik-am opened this issue Aug 15, 2016 · 1 comment

Comments

@erik-am
Copy link

erik-am commented Aug 15, 2016

First of all, great work on this analyser!

We're actively using SonarQube and SonarLint but I missed the possibility there to check on unit size. It can't check class length or method length, but it can only check file length (lines), without even filtering out whitespace or comment blocks.
I think this is a very nice extension that focuses on the core rules. Especially useful for a large code base where you want to focus on the most critical issues.

Have you considered writing a SonarQube extension? Using the SonarQube Roslyn SDK it should be relatively straightforward to transform your Roslyn Analyzer to a SonarQube extension. Then one could also actively monitor on these rules.

@p3pijn
Copy link
Owner

p3pijn commented Aug 15, 2016

Hi erik-am,

Thank you for your feedback. :)

I actually managed to successfully generate a SonarQube plug-in for this analyzer using the SonarQube Roslyn SDK some time ago. I also know about some teams that use this analyzer specifically for that reason.

The steps to do this were the following if I remember correctly:

  • Download and compile the SDK
  • Generate the plug-in by referring to the nuget package of this analyzer by running: RoslynSonarQubePluginGenerator /a:SIGGuidelines.Analyzers
  • Add the generated jar file of the plug-in to the SonarQube plug-in folder
  • Restart SonarQube and enable the newly added rules (they are disabled by default)
  • Run an analysis on a C# code-base to see the results

With SonarQube you could then indeed monitor these rules and do trend analysis.
Please let me know if you managed to get the plug-in running in SonarQube!

Best,
Pepijn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants