Hey guys. It is my first time using SonarQube and I am running it from prompt and Azure DevOps (VSTS Build). Both works fine and the results are great. Our project is based on C# .Net Framework. Our front-end project, which is an asp.net mvc project, we have a following structure for javascript files:
- Content
- js
- jquery (some js files inside this folder)
- jquery.validation (some js files inside this folder)
- kendo.ui (some js files inside this folder)
- jquery (some js files inside this folder)
- … (other components folders here)
- widgets (some js files inside this folder)
- site.js
- app.js
- main.js
- js
And for css we have a similar structure.
I want to analysis with SonarQube just the folder widgets and root files on the js folder (the bold ones). We want to ignore these components folders (jquery, kendo, etc…) and evaluate just our code. To do this, I know we have sonar.exclusions
and sonar.inclusions
arguments we can use but I don’t know how configure them.
sonar.exclusions=**\bin\**,**\OurProject.Web\Reports\**,**\Content\js\**
sonar.inclusions=**\Content\js\*.js,**\Content\js\widgets\*.js
But it does not work. It just ignore all files inside js
folder. How can I ignore the components and how can I scan the bold ones? I was thinking to add folder by folder on the sonar.exclusions but is there any easy way to do this?
I have the same structure for css files and the same solution here will be applied to the css
files as well.
Versions:
- SonarQube 7.5 Community Edition
- SonarC# Plugin 7.10.0.7896
- Scanner for MSBuild 4.5.0.1761-net46