0

The Resharper plugin 2.0 for sonar is marked as deprecated, but untill something new pops up, I would like to use it. Or at least testdrive it.

The plugin is still available on the GitHub page https://github.com/SonarQubeCommunity/sonar-resharper and I downloaded the JAR and dropped it into the extensions\plugins folder, where it is picked up as a valid plugin.

But my resharper.xml rules result is never picked up. What am I doing wrong? Is it not supported to just "xcopy" deploy the JAR plugins?

I get everything else in my solutions analyzed and imported into Sonar, including code coverage. I am using the Resharper console tool, to generate the report, and the solution file and the report, that I tell Sonar to use, are there, at the correct location.

I can see from my sonar-project.properties that is generated by the MSBuild Sonar runner knows that the resharper files are known.

sonar.verbose=true
sonar.cs.vscoveragexml.reportsPaths=d:\\Builds\\1\\TSV.NET\\MsmqMonitor\\TestResults\\VisualStudio.coveragexml
sonar.resharper.cs.reportPath=d:\\Builds\\1\\TSV.NET\\MsmqMonitor\\TestResults\\resharper.xml
sonar.resharper.solutionFile=D:\\Builds\\1\\TSV.NET\\MsmqMonitor\\Sources\\MsmqMonitor.sln
sonar.host.url=http://tfs03te:9000
sonar.visualstudio.enable=false

And the SonarQubeAnalysisConfig.xml that I am guessing MSBuild Sonar runner is also using contains this:

<LocalSettings>
<Property Name="sonar.verbose">true</Property>
<Property Name="sonar.cs.vscoveragexml.reportsPaths">d:\Builds\1\TSV.NET\MsmqMonitor\TestResults\VisualStudio.coveragexml</Property>
<Property Name="sonar.resharper.cs.reportPath">d:\Builds\1\TSV.NET\MsmqMonitor\TestResults\resharper.xml</Property>
<Property Name="sonar.resharper.solutionFile">D:\Builds\1\TSV.NET\MsmqMonitor\Sources\MsmqMonitor.sln</Property>
</LocalSettings>

<AnalyzerSettings>

<RuleSetFilePath>D:\Builds\1\TSV.NET\MsmqMonitor\.sonarqube\conf\SonarQubeRoslyn-cs.ruleset</RuleSetFilePath>

<AnalyzerAssemblyPaths>
<Path>C:\Users\LRNX\AppData\Local\Temp\2\.sonarqube\.static\csharp_1.13.0\SonarAnalyzer.zip\SonarAnalyzer.CSharp.dll</Path>
<Path>C:\Users\LRNX\AppData\Local\Temp\2\.sonarqube\.static\csharp_1.13.0\SonarAnalyzer.zip\SonarAnalyzer.dll</Path>
<Path>C:\Users\LRNX\AppData\Local\Temp\2\.sonarqube\.static\csharp_1.13.0\SonarAnalyzer.zip\SonarAnalyzer.zip</Path>
</AnalyzerAssemblyPaths>

<AdditionalFilePaths>
<Path>D:\Builds\1\TSV.NET\MsmqMonitor\.sonarqube\conf\SonarLint.xml</Path>
</AdditionalFilePaths>

</AnalyzerSettings>

EDIT: Checked the Quality Profile settings, and Resharper rules were not detected (I also only deployed the JAR file thus far). enter image description here

LarsWA
  • 571
  • 5
  • 15

1 Answers1

0

You need to configure your Quality Profile to include the ReSharper rules you want to use.

G. Ann - SonarSource Team
  • 22,346
  • 4
  • 40
  • 76
  • Hi and thanks for the answer. Missed checking the quality profile. But no R# rules appeared, which is understandable as I only copied the JAR file in the plugins folder. (The plugin is now unavailable to install from the Sonar plugin page). https://github.com/SonarQubeCommunity/sonar-resharper/tree/master/src/main/resources/org/sonar/plugins/resharper I can see two files in the R# GitHub rep - Do you know how I hook them up to the R# plugin and get rules in my Quality Profile? Also - what happens if newer rules are applied by the R# console app? – LarsWA Jul 20 '16 at 07:55
  • So. Is there anyone who can help me get the plugin configured manually, so I can setup a quality profile with r# rules? – LarsWA Jul 26 '16 at 22:01
  • @G. Ann - any alternative to resharper plugin? Why it is just deprecated as the Resharper is widely used product for dev C# ruleset – codebased Oct 25 '16 at 06:56
  • @codebased: http://www.sonarqube.org/sonaranalyzer-for-c-the-rule-engine-you-want-to-use/ – G. Ann - SonarSource Team Oct 26 '16 at 13:24