Artur Karbone
Artur Karbone

Reputation: 1658

How to send SonarLint analysis results to the SonarQube server from Visual Studio

Is it possible to send plugin analysis results to the SonarQube server from Visual Studio?

I work in connected mode, click Update from TeamExplorer->SonarQube-Connections. But server itself is not updated with the results. enter image description here

I have to do some CLI stuff I've found here:

https://blogs.msdn.microsoft.com/visualstudioalm/2015/09/28/quickstart-analyzing-net-projects-with-sonarqube-msbuild-or-visual-studio-online-and-third-party-analyzers-stylecop-resharper/

in order to update the server

path=%path%;C:\Sq\MSBuild.SonarQube.Runner-1.0.1

MSBuild.SonarQube.Runner begin /n:Backlogmaps /v:1.0 /k:blm

Msbuild

MSBuild.SonarQube.Runner end

Upvotes: 2

Views: 4101

Answers (1)

Val
Val

Reputation: 2080

SonarLint cannot push analysis results to SonarQube. As you already found, you need to use the command line scanner or setup our Jenkins or TFS extensions on your CI server.

SonarLint for Visual Studio does exactly two things:

  • Transparently enables the SonarC# analyzers for any supported project in Visual Studio, helping you to check your code before committing.
  • Allows the project owner to connect a project to a SonarQube server, which will automatically enforce the same rules for all developers who work on that project. The Update command in the context menu downloads the quality profile from SonarQube and updates the Visual Studio project settings.

I hope this helps.

Upvotes: 8

Related Questions