Issue in using FxCop with SonarQube

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Issue in using FxCop with SonarQube

kshitizc
Hi,
I am using SonarQube 4.5.2.
I need to analyse my .NET (C#) application.

I have set up the sonar-project.properties like this:

# must be unique in a given SonarQube instance
sonar.projectKey=MathService-Demo
sonar.projectName=MathService-Demo
sonar.projectVersion=1.0

sonar.sources=.
sonar.language=cs

#Core C# Settings
sonar.dotnet.visualstudio.solution.file=MathService.sln
sonar.silverlight.4.mscorlib.location=C:/Program Files (x86)/Reference Assemblies/Microsoft/Framework/Silverlight/v4.0
sonar.dotnet.excludeGeneratedCode=true
sonar.dotnet.4.0.sdk.directory=C:/Windows/Microsoft.NET/Framework/v4.0.30319
sonar.dotnet.version=4.0
sonar.visualstudio.enable=true
sonar.fxcop.installDirector=C:/Program Files (x86)/Microsoft Visual Studio 11.0/Team Tools/Static Analysis Tools/FxCop
sonar.cs.fxcop.fxCopCmdPath=C:/Program Files (x86)/Microsoft Visual Studio 11.0/Team Tools/Static Analysis Tools/FxCop/FxCopCmd.exe

----------------

But I was getting error during analysis. My applicaiton is a WCF service. So I searched on net and found that SonarQube is adding "/aspnet" switch while invoking FxCopCmd.exe  So I develop a small wrapper exe and remove /aspnet switch.  Then I changed "sonar.cs.fxcop.fxCopCmdPath"  property to point to my FxCopCmd exe.

I was able to get successful execution, but the analysis report also included messages from C# auto-generated code. Tried appending /ignoregeneratedcode switch in my new FxCopCmd but it didn-t worked.

Am I configuring it correctly. Please help.

Thanks and Regards,
Kshitiz
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue in using FxCop with SonarQube

Dinesh Bolkensteyn-2
Hi,

You can use SonarQube's exclusion mechanism to exclude generated files.


Kind regards,


On Thu, May 21, 2015 at 7:17 PM, kshitizc <[hidden email]> wrote:
Hi,
I am using SonarQube 4.5.2.
I need to analyse my .NET (C#) application.

I have set up the sonar-project.properties like this:

# must be unique in a given SonarQube instance
sonar.projectKey=MathService-Demo
sonar.projectName=MathService-Demo
sonar.projectVersion=1.0

sonar.sources=.
sonar.language=cs

#Core C# Settings
sonar.dotnet.visualstudio.solution.file=MathService.sln
sonar.silverlight.4.mscorlib.location=C:/Program Files (x86)/Reference
Assemblies/Microsoft/Framework/Silverlight/v4.0
sonar.dotnet.excludeGeneratedCode=true
sonar.dotnet.4.0.sdk.directory=C:/Windows/Microsoft.NET/Framework/v4.0.30319
sonar.dotnet.version=4.0
sonar.visualstudio.enable=true
sonar.fxcop.installDirector=C:/Program Files (x86)/Microsoft Visual Studio
11.0/Team Tools/Static Analysis Tools/FxCop
sonar.cs.fxcop.fxCopCmdPath=C:/Program Files (x86)/Microsoft Visual Studio
11.0/Team Tools/Static Analysis Tools/FxCop/FxCopCmd.exe

----------------

But I was getting error during analysis. My applicaiton is a WCF service. So
I searched on net and found that SonarQube is adding "/aspnet" switch while
invoking FxCopCmd.exe  So I develop a small wrapper exe and remove /aspnet
switch.  Then I changed "sonar.cs.fxcop.fxCopCmdPath"  property to point to
my FxCopCmd exe.

I was able to get successful execution, but the analysis report also
included messages from C# auto-generated code. Tried appending
/ignoregeneratedcode switch in my new FxCopCmd but it didn-t worked.

Am I configuring it correctly. Please help.

Thanks and Regards,
Kshitiz



--
View this message in context: http://sonarqube.15.x6.nabble.com/Issue-in-using-FxCop-with-SonarQube-tp5035598.html
Sent from the SonarQube Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue in using FxCop with SonarQube

kshitizc
Hi Dinesh,

Thanks for your response.
Can I not use any switch or sonar property which specify that all automatic generated code will get ignored instead of specifying exclusion list manually? There can be multiple generated class in an application for e.g. designer, reference, etc.

Regards,
Kshitiz
Loading...