Search code examples
sonarqubefxcopfxcopcmd

FxCop with SonarQube when assemblies are built from different directory


I'm using SonarQube 4.0 and C# plugin 3.1 with FxCop 10. I have assemblies provided to me by an upstream build. I use the sonar-runner plugin in Gradle.

When the sonar-runner reaches the FxCop analysis, I get log output like this:

16:43:16.660 INFO  - Skipping the FxCop issue at line 9 which has no associated file.
16:43:16.660 INFO  - Skipping the FxCop issue at line 12 which has no associated file.
16:43:16.660 INFO  - Skipping the FxCop issue at line 15 which has no associated file.
16:43:16.660 INFO  - Skipping the FxCop issue at line 24 which has no associated file.
16:43:16.660 INFO  - Skipping the FxCop issue at line 31 whose file "e:\9394\Sources\[path removed]\CallbackWebService.cs" is not in SonarQube.
16:43:16.660 INFO  - Skipping the FxCop issue at line 38 whose file "e:\9394\Sources\[path removed]\CallbackWebService.cs" is not in SonarQube.
16:43:16.660 INFO  - Skipping the FxCop issue at line 45 whose file "e:\9394\Sources\[path removed]\CallbackWebService.cs" is not in SonarQube.
16:43:16.660 INFO  - Sensor org.sonar.plugins.csharp.core.CSharpFxCopProvider$CSharpFxCopSensor@18db7c1 done: 3344 ms

This seems to occur because the TFS workspace for my SonarQube analysis is in a different location to the workspace where the assemblies were built. If I was using FxCop standalone, it looks like I'd be able to use /applyoutxsl to transform the paths, but SonarQube doesn't give me access to the FxCop command-line to enable this as far as I can tell.

So, my question: is there a way to fix this? It's not realistic to build the assemblies from this workspace, and it's not reasonable to try to synchronize the two workspace paths.


Solution

  • That's not possible for the moment. And it looks like it won't be made possible, see SONARFXCOP-8.

    Feel free to comment this ticket.