Documentation about the parameters of C# Squid Plugin (freeware by SonarSource) has been put on this page as well, as those 2 plugins are tightly coupled (one can't be used without the other). |
Name | Key | Default value | Description |
|---|---|---|---|
Minimum tokens | sonar.cpd.cs.minimumTokens | 100 | The number of duplicate tokens above which a block is considered as a duplication in a C# program. |
Ignore literals | sonar.cpd.cs.ignoreLiteral | true | if true, CPD ignores literal value differences when evaluating a duplicate block. This means that 'my first text'; and 'my second text'; will be seen as equivalent. |
| Ignore file headers (since 2.3) | sonar.cs.ignoreHeaderComments | true | If set to false, comments that starts at line 0 of a source file (generally license headers) won't be ignored and will be counted as code comments. |
.NET 2.0 SDK directory | sonar.dotnet.2.0.sdk.directory | C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727 | Absolute path of the .NET SDK 2.0 directory. |
.NET 3.5 SDK directory | sonar.dotnet.3.5.sdk.directory | C:/WINDOWS/Microsoft.NET/Framework/v3.5 | Absolute path of the .NET SDK 3.5 directory. |
.NET 4.0 SDK directory | sonar.dotnet.4.0.sdk.directory | C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319 | Absolute path of the .NET SDK 4.0 directory. |
.NET version | sonar.dotnet.version | 4.0 | Default version of the .NET framework that must be used. |
Silverlight 3 assembly directory | sonar.silverlight.3.mscorlib.location | C:/Program Files/Reference Assemblies/Microsoft/Framework/Silverlight/v3.0 | Location of the core assembly for Silverlight 3 framework. |
Silverlight 4 assembly directory | sonar.silverlight.4.mscorlib.location | C:/Program Files/Reference Assemblies/Microsoft/Framework/Silverlight/v4.0 | Location of the core assembly for Silverlight 4 framework. |
Silverlight version | sonar.silverlight.version | 4 | Default version of the Silverlight framework that must be used. |
Test project names | sonar.donet.visualstudio.testProjectPattern | *.Tests | Pattern that check project names to identify unit test projects. Multiple patterns may be specified using semicolon as a delimiter. |
| Integration test project names (since v1.3) | sonar.dotnet.visualstudio.itProjectPattern | Pattern that check project names to identify integration test projects. Multiple patterns may be specified using semicolon as a delimiter. If there is no pattern specified, unit test patterns are used. | |
Solution to analyse | sonar.dotnet.visualstudio.solution.file |
| Relative path to the ".sln" file that represents the solution to analyse. If none provided, a ".sln" file will be searched at the root of the project. |
Exclude generated code | sonar.dotnet.excludeGeneratedCode | true | Set to false to include generated code like 'Reference.cs' files or '*.designer.cs' files. |
| About path patterns Ant style patterns can be used. "*" means any file or any directory. "**" means any directory and subdirectory. For example "**/Foo*.dll" means any dll file prefixed by "Foo" anywhere in a project. IF you need to reference assembly files outside your solution folder, you can use absolute paths or "../". For example "$(SolutionDir)/../lib/**.*dll" can be used to specify all the dll files of a lib folder located at the same level as the root folder of your visual studio solution. |
Advanced parameters
Name | Key | Default value | Description |
|---|---|---|---|
Build configurations | sonar.dotnet.buildConfigurations | Debug | Not needed in most cases. |
Assemblies to scan (since v1.1) | sonar.dotnet.assemblies |
| Not needed in most cases. |
| Other advanced parameters Sonar C# support most parameters described in the Advanced parameters page, at least the non java specific ones. |
| Warning Each time you need to specify a path, or a pattern to locate files, use "/" instead of "\" |
