Problem with excluding code from analysis in C# projects

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with excluding code from analysis in C# projects

johan esbjorner

Hi,

 

I have encountered problems with excluding code in C# solutions from being analyzed by SonarQube. After searching and reading both wiki pages and several other mail regarding this issue I have still not come to any conclusion regarding what I´m doing wrong.

 

Project structure:

 

sonar-project.properties:

sonar.exclusions=file:**/Kapsch.AppTeam*/**/*.*,file:**/Kapsch.Hobit.Device/**/*.*,file:**/Kapsch.Security.SmartCard/**/*.*

 

Log file:

19:05:21 19:05:06.842 INFO  - Excluded sources:

19:05:21 19:05:06.842 INFO  -   file:**/Kapsch.AppTeam*/**/*.*

19:05:21 19:05:06.842 INFO  -   file:**/Kapsch.Hobit.Device/**/*.*

19:05:21 19:05:06.842 INFO  -   file:**/Kapsch.Security.SmartCard/**/*.*

 

SonarQube:

The excluded code is not reported in the Lines of code, duplicated code or in the complexity widgets:

But Issues are still reported on the excluded code:

When drilling down to the see any of the issues that belong to the excluded projects the source code is missing. SO it seems as the sonar.exclusions had effect for everything except the issue widget.

Is this a known issue or have I configured anything

 

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

 

The sonar.skippedModules property I have never got to work for any of our C# projects. All the “skipped” modules is never skipped by the analysis.

 

sonar-project.properties:

sonar.skippedModules=Kapsch.Hobit.Device,Kapsch.Security.SmartCard,Kapsch.AppTeam.Security,Kapsch.AppTeam.Core,Kapsch.AppTeam.Security.Web

 

Solution file:

Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kapsch.Hobit.Device", "Kapsch.Hobit.Device\Kapsch.Hobit.Device.csproj", "{53206ACC-94A7-4B13-A414-CBDED8C2ED75}"

EndProject

 

Is there any log entry in the that I should look for, similar to “INFO  - Excluded sources:” for the sonar.exclusions?

What is the difference between sonar.skippedModules and sonar.exclussions?

 

Regards

Johan Esbjörner




The information contained in this e-mail message is privileged and confidential and is for the exclusive use of the addressee. The person who receives this message and who is not the addressee, one of his employees or an agent entitled to hand it over to the addressee, is informed that he may not use, disclose or reproduce the contents thereof, and is kindly asked to notify the sender and delete the e-mail immediately.

Reply | Threaded
Open this post in threaded view
|

RE: Problem with excluding code from analysis in C# projects

johan esbjorner

Hi, I forgot to mention that we are using SonarQube 3.7.1, C# plugin 2.1

 

Regards

Johan

 

From: Esbjörner Johan [mailto:[hidden email]]
Sent: den 24 september 2013 20:11
To: [hidden email]
Subject: [sonar-user] Problem with excluding code from analysis in C# projects

 

Hi,

 

I have encountered problems with excluding code in C# solutions from being analyzed by SonarQube. After searching and reading both wiki pages and several other mail regarding this issue I have still not come to any conclusion regarding what I´m doing wrong.

 

Project structure:

 

sonar-project.properties:

sonar.exclusions=file:**/Kapsch.AppTeam*/**/*.*,file:**/Kapsch.Hobit.Device/**/*.*,file:**/Kapsch.Security.SmartCard/**/*.*

 

Log file:

19:05:21 19:05:06.842 INFO  - Excluded sources:

19:05:21 19:05:06.842 INFO  -   file:**/Kapsch.AppTeam*/**/*.*

19:05:21 19:05:06.842 INFO  -   file:**/Kapsch.Hobit.Device/**/*.*

19:05:21 19:05:06.842 INFO  -   file:**/Kapsch.Security.SmartCard/**/*.*

 

SonarQube:

The excluded code is not reported in the Lines of code, duplicated code or in the complexity widgets:

But Issues are still reported on the excluded code:

When drilling down to the see any of the issues that belong to the excluded projects the source code is missing. SO it seems as the sonar.exclusions had effect for everything except the issue widget.

Is this a known issue or have I configured anything

 

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

 

The sonar.skippedModules property I have never got to work for any of our C# projects. All the “skipped” modules is never skipped by the analysis.

 

sonar-project.properties:

sonar.skippedModules=Kapsch.Hobit.Device,Kapsch.Security.SmartCard,Kapsch.AppTeam.Security,Kapsch.AppTeam.Core,Kapsch.AppTeam.Security.Web

 

Solution file:

Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kapsch.Hobit.Device", "Kapsch.Hobit.Device\Kapsch.Hobit.Device.csproj", "{53206ACC-94A7-4B13-A414-CBDED8C2ED75}"

EndProject

 

Is there any log entry in the that I should look for, similar to “INFO  - Excluded sources:” for the sonar.exclusions?

What is the difference between sonar.skippedModules and sonar.exclussions?

 

Regards

Johan Esbjörner




The information contained in this e-mail message is privileged and confidential and is for the exclusive use of the addressee. The person who receives this message and who is not the addressee, one of his employees or an agent entitled to hand it over to the addressee, is informed that he may not use, disclose or reproduce the contents thereof, and is kindly asked to notify the sender and delete the e-mail immediately.




The information contained in this e-mail message is privileged and confidential and is for the exclusive use of the addressee. The person who receives this message and who is not the addressee, one of his employees or an agent entitled to hand it over to the addressee, is informed that he may not use, disclose or reproduce the contents thereof, and is kindly asked to notify the sender and delete the e-mail immediately.

Reply | Threaded
Open this post in threaded view
|

Re: Problem with excluding code from analysis in C# projects

David Racodon-2
In reply to this post by johan esbjorner
Hi Johan,

The sonar.skippedModules property I have never got to work for any of our C# projects. All the “skipped” modules is never skipped by the analysis.

This is a known issue when you set the "sonar.dotnet.key.generation.strategy" property to "safe". See http://jira.codehaus.org/browse/SONARDOTNT-10.


When drilling down to the see any of the issues that belong to the excluded projects the source code is missing. SO it seems as the sonar.exclusions had effect for everything except the issue widget.
Is this a known issue or have I configured anything

Use fully qualified names instead of absolute path and it will work.

Regards,

David RACODON | SonarSource
Senior Consultant

---------------------------------------------
  Sign up to our newsletter here!
---------------------------------------------


On Tue, Sep 24, 2013 at 8:10 PM, Esbjörner Johan <[hidden email]> wrote:

Hi,

 

I have encountered problems with excluding code in C# solutions from being analyzed by SonarQube. After searching and reading both wiki pages and several other mail regarding this issue I have still not come to any conclusion regarding what I´m doing wrong.

 

Project structure:

 

sonar-project.properties:

sonar.exclusions=file:**/Kapsch.AppTeam*/**/*.*,file:**/Kapsch.Hobit.Device/**/*.*,file:**/Kapsch.Security.SmartCard/**/*.*

 

Log file:

19:05:21 19:05:06.842 INFO  - Excluded sources:

19:05:21 19:05:06.842 INFO  -   file:**/Kapsch.AppTeam*/**/*.*

19:05:21 19:05:06.842 INFO  -   file:**/Kapsch.Hobit.Device/**/*.*

19:05:21 19:05:06.842 INFO  -   file:**/Kapsch.Security.SmartCard/**/*.*

 

SonarQube:

The excluded code is not reported in the Lines of code, duplicated code or in the complexity widgets:

But Issues are still reported on the excluded code:

When drilling down to the see any of the issues that belong to the excluded projects the source code is missing. SO it seems as the sonar.exclusions had effect for everything except the issue widget.

Is this a known issue or have I configured anything

 

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

 

The sonar.skippedModules property I have never got to work for any of our C# projects. All the “skipped” modules is never skipped by the analysis.

 

sonar-project.properties:

sonar.skippedModules=Kapsch.Hobit.Device,Kapsch.Security.SmartCard,Kapsch.AppTeam.Security,Kapsch.AppTeam.Core,Kapsch.AppTeam.Security.Web

 

Solution file:

Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kapsch.Hobit.Device", "Kapsch.Hobit.Device\Kapsch.Hobit.Device.csproj", "{53206ACC-94A7-4B13-A414-CBDED8C2ED75}"

EndProject

 

Is there any log entry in the that I should look for, similar to “INFO  - Excluded sources:” for the sonar.exclusions?

What is the difference between sonar.skippedModules and sonar.exclussions?

 

Regards

Johan Esbjörner




The information contained in this e-mail message is privileged and confidential and is for the exclusive use of the addressee. The person who receives this message and who is not the addressee, one of his employees or an agent entitled to hand it over to the addressee, is informed that he may not use, disclose or reproduce the contents thereof, and is kindly asked to notify the sender and delete the e-mail immediately.


Reply | Threaded
Open this post in threaded view
|

RE: Problem with excluding code from analysis in C# projects

johan esbjorner

Hi,

 

Project structure:

-          Kapsch.AppTeam.Core

o   Stateless

o  

-          Kapsch…

 

I´m able to exclude the code beneath the stateless directory by using sonar.exclusions=Stateless/**/*.*

But when I try to exclude all the code beneath the sonar.exclusions=Kapsch.AppTeam*/**/*.* nothing gets excluded.

 

Is it not possible to exclude entire projects (Kapsch.AppTeam.Core) by using sonar.exclussions? do I need to use the sonar.skippedModules instead?

 

Regards

Johan

 

From: David Racodon [mailto:[hidden email]]
Sent: den 25 september 2013 21:07
To: [hidden email]
Subject: Re: [sonar-user] Problem with excluding code from analysis in C# projects

 

Hi Johan,

 

The sonar.skippedModules property I have never got to work for any of our C# projects. All the “skipped” modules is never skipped by the analysis.

This is a known issue when you set the "sonar.dotnet.key.generation.strategy" property to "safe". See http://jira.codehaus.org/browse/SONARDOTNT-10.

 

 

When drilling down to the see any of the issues that belong to the excluded projects the source code is missing. SO it seems as the sonar.exclusions had effect for everything except the issue widget.
Is this a known issue or have I configured anything

 

Use fully qualified names instead of absolute path and it will work.

See <a href="http://docs.codehaus.org/display/SONAR/Project&#43;Administration#ProjectAdministration-ExcludingFiles">http://docs.codehaus.org/display/SONAR/Project+Administration#ProjectAdministration-ExcludingFiles.

 

Regards,

 

David RACODON | SonarSource
Senior Consultant

 

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

  Sign up to our newsletter here!

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

 

On Tue, Sep 24, 2013 at 8:10 PM, Esbjörner Johan <[hidden email]> wrote:

Hi,

 

I have encountered problems with excluding code in C# solutions from being analyzed by SonarQube. After searching and reading both wiki pages and several other mail regarding this issue I have still not come to any conclusion regarding what I´m doing wrong.

 

Project structure:

 

sonar-project.properties:

sonar.exclusions=file:**/Kapsch.AppTeam*/**/*.*,file:**/Kapsch.Hobit.Device/**/*.*,file:**/Kapsch.Security.SmartCard/**/*.*

 

Log file:

19:05:21 19:05:06.842 INFO  - Excluded sources:

19:05:21 19:05:06.842 INFO  -   file:**/Kapsch.AppTeam*/**/*.*

19:05:21 19:05:06.842 INFO  -   file:**/Kapsch.Hobit.Device/**/*.*

19:05:21 19:05:06.842 INFO  -   file:**/Kapsch.Security.SmartCard/**/*.*

 

SonarQube:

The excluded code is not reported in the Lines of code, duplicated code or in the complexity widgets:

But Issues are still reported on the excluded code:

When drilling down to the see any of the issues that belong to the excluded projects the source code is missing. SO it seems as the sonar.exclusions had effect for everything except the issue widget.

Is this a known issue or have I configured anything

 

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

 

The sonar.skippedModules property I have never got to work for any of our C# projects. All the “skipped” modules is never skipped by the analysis.

 

sonar-project.properties:

sonar.skippedModules=Kapsch.Hobit.Device,Kapsch.Security.SmartCard,Kapsch.AppTeam.Security,Kapsch.AppTeam.Core,Kapsch.AppTeam.Security.Web

 

Solution file:

Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kapsch.Hobit.Device", "Kapsch.Hobit.Device\Kapsch.Hobit.Device.csproj", "{53206ACC-94A7-4B13-A414-CBDED8C2ED75}"

EndProject

 

Is there any log entry in the that I should look for, similar to “INFO  - Excluded sources:” for the sonar.exclusions?

What is the difference between sonar.skippedModules and sonar.exclussions?

 

Regards

Johan Esbjörner




The information contained in this e-mail message is privileged and confidential and is for the exclusive use of the addressee. The person who receives this message and who is not the addressee, one of his employees or an agent entitled to hand it over to the addressee, is informed that he may not use, disclose or reproduce the contents thereof, and is kindly asked to notify the sender and delete the e-mail immediately.

 




The information contained in this e-mail message is privileged and confidential and is for the exclusive use of the addressee. The person who receives this message and who is not the addressee, one of his employees or an agent entitled to hand it over to the addressee, is informed that he may not use, disclose or reproduce the contents thereof, and is kindly asked to notify the sender and delete the e-mail immediately.

Reply | Threaded
Open this post in threaded view
|

Re: Problem with excluding code from analysis in C# projects

David Racodon-2
Hi Johan,

Paths are relative to the root projects (Kapsch.AppTeam.Core, Kapsch...). Check the fully qualified names of files included in Stateless for example. You'll see that the Component Viewer doesn't display "Kapsch.AppTeam.Core/Stateless/myFile.cs" but "Stateless/myFile.cs".

I´m able to exclude the code beneath the stateless directory by using sonar.exclusions=Stateless/**/*.*

That's why this is working. 


But when I try to exclude all the code beneath the sonar.exclusions=Kapsch.AppTeam*/**/*.* nothing gets excluded.

That's why this is not working. 

Is it not possible to exclude entire projects (Kapsch.AppTeam.Core) by using sonar.exclussions? do I need to use the sonar.skippedModules instead?

It is what the "sonar.skippedModules" property is there for.

Regards,



David RACODON | SonarSource
Senior Consultant

---------------------------------------------
  Sign up to our newsletter here!
---------------------------------------------


On Thu, Sep 26, 2013 at 12:57 PM, Esbjörner Johan <[hidden email]> wrote:

Hi,

 

Project structure:

-          Kapsch.AppTeam.Core

o   Stateless

o  

-          Kapsch…

 

I´m able to exclude the code beneath the stateless directory by using sonar.exclusions=Stateless/**/*.*

But when I try to exclude all the code beneath the sonar.exclusions=Kapsch.AppTeam*/**/*.* nothing gets excluded.

 

Is it not possible to exclude entire projects (Kapsch.AppTeam.Core) by using sonar.exclussions? do I need to use the sonar.skippedModules instead?

 

Regards

Johan

 

From: David Racodon [mailto:[hidden email]]
Sent: den 25 september 2013 21:07
To: [hidden email]
Subject: Re: [sonar-user] Problem with excluding code from analysis in C# projects

 

Hi Johan,

 

The sonar.skippedModules property I have never got to work for any of our C# projects. All the “skipped” modules is never skipped by the analysis.

This is a known issue when you set the "sonar.dotnet.key.generation.strategy" property to "safe". See http://jira.codehaus.org/browse/SONARDOTNT-10.

 

 

When drilling down to the see any of the issues that belong to the excluded projects the source code is missing. SO it seems as the sonar.exclusions had effect for everything except the issue widget.
Is this a known issue or have I configured anything

 

Use fully qualified names instead of absolute path and it will work.

 

Regards,

 

David RACODON | SonarSource
Senior Consultant

 

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

  Sign up to our newsletter here!

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

 

On Tue, Sep 24, 2013 at 8:10 PM, Esbjörner Johan <[hidden email]> wrote:

Hi,

 

I have encountered problems with excluding code in C# solutions from being analyzed by SonarQube. After searching and reading both wiki pages and several other mail regarding this issue I have still not come to any conclusion regarding what I´m doing wrong.

 

Project structure:

 

sonar-project.properties:

sonar.exclusions=file:**/Kapsch.AppTeam*/**/*.*,file:**/Kapsch.Hobit.Device/**/*.*,file:**/Kapsch.Security.SmartCard/**/*.*

 

Log file:

19:05:21 19:05:06.842 INFO  - Excluded sources:

19:05:21 19:05:06.842 INFO  -   file:**/Kapsch.AppTeam*/**/*.*

19:05:21 19:05:06.842 INFO  -   file:**/Kapsch.Hobit.Device/**/*.*

19:05:21 19:05:06.842 INFO  -   file:**/Kapsch.Security.SmartCard/**/*.*

 

SonarQube:

The excluded code is not reported in the Lines of code, duplicated code or in the complexity widgets:

But Issues are still reported on the excluded code:

When drilling down to the see any of the issues that belong to the excluded projects the source code is missing. SO it seems as the sonar.exclusions had effect for everything except the issue widget.

Is this a known issue or have I configured anything

 

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

 

The sonar.skippedModules property I have never got to work for any of our C# projects. All the “skipped” modules is never skipped by the analysis.

 

sonar-project.properties:

sonar.skippedModules=Kapsch.Hobit.Device,Kapsch.Security.SmartCard,Kapsch.AppTeam.Security,Kapsch.AppTeam.Core,Kapsch.AppTeam.Security.Web

 

Solution file:

Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kapsch.Hobit.Device", "Kapsch.Hobit.Device\Kapsch.Hobit.Device.csproj", "{53206ACC-94A7-4B13-A414-CBDED8C2ED75}"

EndProject

 

Is there any log entry in the that I should look for, similar to “INFO  - Excluded sources:” for the sonar.exclusions?

What is the difference between sonar.skippedModules and sonar.exclussions?

 

Regards

Johan Esbjörner




The information contained in this e-mail message is privileged and confidential and is for the exclusive use of the addressee. The person who receives this message and who is not the addressee, one of his employees or an agent entitled to hand it over to the addressee, is informed that he may not use, disclose or reproduce the contents thereof, and is kindly asked to notify the sender and delete the e-mail immediately.

 




The information contained in this e-mail message is privileged and confidential and is for the exclusive use of the addressee. The person who receives this message and who is not the addressee, one of his employees or an agent entitled to hand it over to the addressee, is informed that he may not use, disclose or reproduce the contents thereof, and is kindly asked to notify the sender and delete the e-mail immediately.


Reply | Threaded
Open this post in threaded view
|

RE: Problem with excluding code from analysis in C# projects

johan esbjorner

Thanks David, now I get it J

 

I have now solved our exclude problems…

 

Regards

Johan

 

From: David Racodon [mailto:[hidden email]]
Sent: den 26 september 2013 13:32
To: [hidden email]
Subject: Re: [sonar-user] Problem with excluding code from analysis in C# projects

 

Hi Johan,

 

Paths are relative to the root projects (Kapsch.AppTeam.Core, Kapsch...). Check the fully qualified names of files included in Stateless for example. You'll see that the Component Viewer doesn't display "Kapsch.AppTeam.Core/Stateless/myFile.cs" but "Stateless/myFile.cs".

 

I´m able to exclude the code beneath the stateless directory by using sonar.exclusions=Stateless/**/*.*

 

That's why this is working. 

 

But when I try to exclude all the code beneath the sonar.exclusions=Kapsch.AppTeam*/**/*.* nothing gets excluded.

 

That's why this is not working. 

 

Is it not possible to exclude entire projects (Kapsch.AppTeam.Core) by using sonar.exclussions? do I need to use the sonar.skippedModules instead?

 

It is what the "sonar.skippedModules" property is there for.

 

Regards,

 


 

David RACODON | SonarSource
Senior Consultant

 

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

  Sign up to our newsletter here!

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

 

On Thu, Sep 26, 2013 at 12:57 PM, Esbjörner Johan <[hidden email]> wrote:

Hi,

 

Project structure:

-          Kapsch.AppTeam.Core

o   Stateless

o  

-          Kapsch…

 

I´m able to exclude the code beneath the stateless directory by using sonar.exclusions=Stateless/**/*.*

But when I try to exclude all the code beneath the sonar.exclusions=Kapsch.AppTeam*/**/*.* nothing gets excluded.

 

Is it not possible to exclude entire projects (Kapsch.AppTeam.Core) by using sonar.exclussions? do I need to use the sonar.skippedModules instead?

 

Regards

Johan

 

From: David Racodon [mailto:[hidden email]]
Sent: den 25 september 2013 21:07
To: [hidden email]
Subject: Re: [sonar-user] Problem with excluding code from analysis in C# projects

 

Hi Johan,

 

The sonar.skippedModules property I have never got to work for any of our C# projects. All the “skipped” modules is never skipped by the analysis.

This is a known issue when you set the "sonar.dotnet.key.generation.strategy" property to "safe". See http://jira.codehaus.org/browse/SONARDOTNT-10.

 

 

When drilling down to the see any of the issues that belong to the excluded projects the source code is missing. SO it seems as the sonar.exclusions had effect for everything except the issue widget.
Is this a known issue or have I configured anything

 

Use fully qualified names instead of absolute path and it will work.

See <a href="http://docs.codehaus.org/display/SONAR/Project&#43;Administration#ProjectAdministration-ExcludingFiles" target="_blank">http://docs.codehaus.org/display/SONAR/Project+Administration#ProjectAdministration-ExcludingFiles.

 

Regards,

 

David RACODON | SonarSource
Senior Consultant

 

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

  Sign up to our newsletter here!

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

 

On Tue, Sep 24, 2013 at 8:10 PM, Esbjörner Johan <[hidden email]> wrote:

Hi,

 

I have encountered problems with excluding code in C# solutions from being analyzed by SonarQube. After searching and reading both wiki pages and several other mail regarding this issue I have still not come to any conclusion regarding what I´m doing wrong.

 

Project structure:

 

sonar-project.properties:

sonar.exclusions=file:**/Kapsch.AppTeam*/**/*.*,file:**/Kapsch.Hobit.Device/**/*.*,file:**/Kapsch.Security.SmartCard/**/*.*

 

Log file:

19:05:21 19:05:06.842 INFO  - Excluded sources:

19:05:21 19:05:06.842 INFO  -   file:**/Kapsch.AppTeam*/**/*.*

19:05:21 19:05:06.842 INFO  -   file:**/Kapsch.Hobit.Device/**/*.*

19:05:21 19:05:06.842 INFO  -   file:**/Kapsch.Security.SmartCard/**/*.*

 

SonarQube:

The excluded code is not reported in the Lines of code, duplicated code or in the complexity widgets:

But Issues are still reported on the excluded code:

When drilling down to the see any of the issues that belong to the excluded projects the source code is missing. SO it seems as the sonar.exclusions had effect for everything except the issue widget.

Is this a known issue or have I configured anything

 

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

 

The sonar.skippedModules property I have never got to work for any of our C# projects. All the “skipped” modules is never skipped by the analysis.

 

sonar-project.properties:

sonar.skippedModules=Kapsch.Hobit.Device,Kapsch.Security.SmartCard,Kapsch.AppTeam.Security,Kapsch.AppTeam.Core,Kapsch.AppTeam.Security.Web

 

Solution file:

Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kapsch.Hobit.Device", "Kapsch.Hobit.Device\Kapsch.Hobit.Device.csproj", "{53206ACC-94A7-4B13-A414-CBDED8C2ED75}"

EndProject

 

Is there any log entry in the that I should look for, similar to “INFO  - Excluded sources:” for the sonar.exclusions?

What is the difference between sonar.skippedModules and sonar.exclussions?

 

Regards

Johan Esbjörner




The information contained in this e-mail message is privileged and confidential and is for the exclusive use of the addressee. The person who receives this message and who is not the addressee, one of his employees or an agent entitled to hand it over to the addressee, is informed that he may not use, disclose or reproduce the contents thereof, and is kindly asked to notify the sender and delete the e-mail immediately.

 




The information contained in this e-mail message is privileged and confidential and is for the exclusive use of the addressee. The person who receives this message and who is not the addressee, one of his employees or an agent entitled to hand it over to the addressee, is informed that he may not use, disclose or reproduce the contents thereof, and is kindly asked to notify the sender and delete the e-mail immediately.

 




The information contained in this e-mail message is privileged and confidential and is for the exclusive use of the addressee. The person who receives this message and who is not the addressee, one of his employees or an agent entitled to hand it over to the addressee, is informed that he may not use, disclose or reproduce the contents thereof, and is kindly asked to notify the sender and delete the e-mail immediately.

Reply | Threaded
Open this post in threaded view
|

Re: Problem with excluding code from analysis in C# projects

David Racodon-2
Good news! Thanks for the notification.


David RACODON | SonarSource
Senior Consultant

---------------------------------------------
  Sign up to our newsletter here!
---------------------------------------------


On Thu, Sep 26, 2013 at 3:05 PM, Esbjörner Johan <[hidden email]> wrote:

Thanks David, now I get it J

 

I have now solved our exclude problems…

 

Regards

Johan

 

From: David Racodon [mailto:[hidden email]]
Sent: den 26 september 2013 13:32


To: [hidden email]
Subject: Re: [sonar-user] Problem with excluding code from analysis in C# projects

 

Hi Johan,

 

Paths are relative to the root projects (Kapsch.AppTeam.Core, Kapsch...). Check the fully qualified names of files included in Stateless for example. You'll see that the Component Viewer doesn't display "Kapsch.AppTeam.Core/Stateless/myFile.cs" but "Stateless/myFile.cs".

 

I´m able to exclude the code beneath the stateless directory by using sonar.exclusions=Stateless/**/*.*

 

That's why this is working. 

 

But when I try to exclude all the code beneath the sonar.exclusions=Kapsch.AppTeam*/**/*.* nothing gets excluded.

 

That's why this is not working. 

 

Is it not possible to exclude entire projects (Kapsch.AppTeam.Core) by using sonar.exclussions? do I need to use the sonar.skippedModules instead?

 

It is what the "sonar.skippedModules" property is there for.

 

Regards,

 


 

David RACODON | SonarSource
Senior Consultant

 

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

  Sign up to our newsletter here!

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

 

On Thu, Sep 26, 2013 at 12:57 PM, Esbjörner Johan <[hidden email]> wrote:

Hi,

 

Project structure:

-          Kapsch.AppTeam.Core

o   Stateless

o  

-          Kapsch…

 

I´m able to exclude the code beneath the stateless directory by using sonar.exclusions=Stateless/**/*.*

But when I try to exclude all the code beneath the sonar.exclusions=Kapsch.AppTeam*/**/*.* nothing gets excluded.

 

Is it not possible to exclude entire projects (Kapsch.AppTeam.Core) by using sonar.exclussions? do I need to use the sonar.skippedModules instead?

 

Regards

Johan

 

From: David Racodon [mailto:[hidden email]]
Sent: den 25 september 2013 21:07
To: [hidden email]
Subject: Re: [sonar-user] Problem with excluding code from analysis in C# projects

 

Hi Johan,

 

The sonar.skippedModules property I have never got to work for any of our C# projects. All the “skipped” modules is never skipped by the analysis.

This is a known issue when you set the "sonar.dotnet.key.generation.strategy" property to "safe". See http://jira.codehaus.org/browse/SONARDOTNT-10.

 

 

When drilling down to the see any of the issues that belong to the excluded projects the source code is missing. SO it seems as the sonar.exclusions had effect for everything except the issue widget.
Is this a known issue or have I configured anything

 

Use fully qualified names instead of absolute path and it will work.

 

Regards,

 

David RACODON | SonarSource
Senior Consultant

 

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

  Sign up to our newsletter here!

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

 

On Tue, Sep 24, 2013 at 8:10 PM, Esbjörner Johan <[hidden email]> wrote:

Hi,

 

I have encountered problems with excluding code in C# solutions from being analyzed by SonarQube. After searching and reading both wiki pages and several other mail regarding this issue I have still not come to any conclusion regarding what I´m doing wrong.

 

Project structure:

 

sonar-project.properties:

sonar.exclusions=file:**/Kapsch.AppTeam*/**/*.*,file:**/Kapsch.Hobit.Device/**/*.*,file:**/Kapsch.Security.SmartCard/**/*.*

 

Log file:

19:05:21 19:05:06.842 INFO  - Excluded sources:

19:05:21 19:05:06.842 INFO  -   file:**/Kapsch.AppTeam*/**/*.*

19:05:21 19:05:06.842 INFO  -   file:**/Kapsch.Hobit.Device/**/*.*

19:05:21 19:05:06.842 INFO  -   file:**/Kapsch.Security.SmartCard/**/*.*

 

SonarQube:

The excluded code is not reported in the Lines of code, duplicated code or in the complexity widgets:

But Issues are still reported on the excluded code:

When drilling down to the see any of the issues that belong to the excluded projects the source code is missing. SO it seems as the sonar.exclusions had effect for everything except the issue widget.

Is this a known issue or have I configured anything

 

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

 

The sonar.skippedModules property I have never got to work for any of our C# projects. All the “skipped” modules is never skipped by the analysis.

 

sonar-project.properties:

sonar.skippedModules=Kapsch.Hobit.Device,Kapsch.Security.SmartCard,Kapsch.AppTeam.Security,Kapsch.AppTeam.Core,Kapsch.AppTeam.Security.Web

 

Solution file:

Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kapsch.Hobit.Device", "Kapsch.Hobit.Device\Kapsch.Hobit.Device.csproj", "{53206ACC-94A7-4B13-A414-CBDED8C2ED75}"

EndProject

 

Is there any log entry in the that I should look for, similar to “INFO  - Excluded sources:” for the sonar.exclusions?

What is the difference between sonar.skippedModules and sonar.exclussions?

 

Regards

Johan Esbjörner




The information contained in this e-mail message is privileged and confidential and is for the exclusive use of the addressee. The person who receives this message and who is not the addressee, one of his employees or an agent entitled to hand it over to the addressee, is informed that he may not use, disclose or reproduce the contents thereof, and is kindly asked to notify the sender and delete the e-mail immediately.

 




The information contained in this e-mail message is privileged and confidential and is for the exclusive use of the addressee. The person who receives this message and who is not the addressee, one of his employees or an agent entitled to hand it over to the addressee, is informed that he may not use, disclose or reproduce the contents thereof, and is kindly asked to notify the sender and delete the e-mail immediately.

 




The information contained in this e-mail message is privileged and confidential and is for the exclusive use of the addressee. The person who receives this message and who is not the addressee, one of his employees or an agent entitled to hand it over to the addressee, is informed that he may not use, disclose or reproduce the contents thereof, and is kindly asked to notify the sender and delete the e-mail immediately.


Reply | Threaded
Open this post in threaded view
|

RE: Problem with excluding code from analysis in C# projects

Chethan
This post has NOT been accepted by the mailing list yet.
In reply to this post by johan esbjorner
Hi,
 Please let me know what you have given to exclude all the files inside the project directory, still am facing this issue, please let me know the sonar.exclusions=? what you have given here..

Regards
Chethan
Reply | Threaded
Open this post in threaded view
|

RE: Problem with excluding code from analysis in C# projects

Ashley Lewis
This post has NOT been accepted by the mailing list yet.
Im also still lost,

I put **/*.designer.cs in as the sonar.exclude and files ending with the suffix .designer.cs are still showing up as hotspots for complexity and llines of duplicated code. They are generated. I don't want to analyse them but thanks for the rest of the analysis.

Cheers.