├── cover.pptx
├── doc
├── cover.jpg
├── _img
│ ├── Sonar-Bat.png
│ ├── New-Database.png
│ ├── Analysis-Report.png
│ ├── Automated-Tests.png
│ ├── Build-Restart.png
│ ├── Build-Settings.png
│ ├── Build-Succeeded.png
│ ├── Git-Repository.png
│ ├── Queue-New-Build.png
│ ├── Service-Console.png
│ ├── Team-Explorer.png
│ ├── Unblock-Button.png
│ ├── Update-Center.png
│ ├── Assume-Port-9000.png
│ ├── Build-Fails-Error.png
│ ├── Port-Number-9090.png
│ ├── SonarQube-Portal.png
│ ├── Enable-Code-Coverage.png
│ ├── Install-NT-Service.png
│ ├── New-Database-DB-Name.png
│ ├── New-Database-General.png
│ ├── New-Project-Example.png
│ ├── Remove-local-service.png
│ ├── SonarQube-Download.png
│ ├── SonarQube-Port-9090.png
│ ├── SonarQube-Web-Portal.png
│ ├── SonarQube.Download.png
│ ├── StartNTService-Bat.png
│ ├── sonar.jdbc-sqlserver.png
│ ├── Browser-Prerequisites.png
│ ├── Database-Prerequisites.png
│ ├── Team-Explorer-Git-Repo.png
│ ├── Windows-Security-Alert.png
│ ├── sonar.jdbc-sqlexpress.png
│ ├── sonar.jdbc.url-setting.png
│ ├── JavaSeRuntimeEnvironment.png
│ ├── New-Database-User-Mapping.png
│ ├── Port-Fabikam-Fibre-9000.png
│ ├── Sonar.jdbc.username-entry.png
│ ├── Team-Explorer-Connected.png
│ ├── Unzip-SonarQube-x.x.zip.png
│ ├── Windows-Security-Alert2.png
│ ├── sonarqube-5.1-Properties.png
│ ├── Database-server-properties.png
│ ├── Java-SE-Runtime-Environment.png
│ ├── New-Database-Connect-To-DB.png
│ ├── New-Database-Security-Login.png
│ ├── MSBuild.SonarQube.Runner.PATH.png
│ ├── MSBuild.SonarQube.Runner.Settings
│ ├── New-Database-Default-Language.png
│ ├── New-Database-accent-sensitive.png
│ ├── SQL_Latin1_General_CP1_CI_AS.png
│ ├── SonarQube-Service-Dependency.png
│ ├── Test-Connection-01-ContextMenu.png
│ ├── sonar.jdbc-delete-leading-hash.png
│ ├── New-Database-SQLServer-As-Source.png
│ ├── Validate-And-Save-Build-Settings.png
│ ├── MSBuild.SonarQube.Runner.Settings.png
│ ├── New-Database-Test-Connection-Worked.png
│ ├── SQL-Server-Windows-Authentication.png
│ ├── Team-Explorer-Edit-Build-Definition.png
│ ├── sc-config-sonarqube-dpend-sqlbrowser.png
│ ├── Build-vNext-example-definition-with-cmds.png
│ └── SonarQube-Portal-MSBuild-TestProjectPattern.png
├── book.json
├── SUMMARY.md
├── license.md
├── conclusion.md
├── analyze-from-the-command-line.md
├── prerequisites.md
├── README.md
├── appendix-1.md
├── appendix-3.md
├── additional-configurations.md
├── appendix-2.md
├── analyze-from-tfs.md
└── installation-and-configuration.md
├── README.md
└── License.txt
/cover.pptx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/cover.pptx
--------------------------------------------------------------------------------
/doc/cover.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/cover.jpg
--------------------------------------------------------------------------------
/doc/_img/Sonar-Bat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Sonar-Bat.png
--------------------------------------------------------------------------------
/doc/_img/New-Database.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/New-Database.png
--------------------------------------------------------------------------------
/doc/_img/Analysis-Report.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Analysis-Report.png
--------------------------------------------------------------------------------
/doc/_img/Automated-Tests.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Automated-Tests.png
--------------------------------------------------------------------------------
/doc/_img/Build-Restart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Build-Restart.png
--------------------------------------------------------------------------------
/doc/_img/Build-Settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Build-Settings.png
--------------------------------------------------------------------------------
/doc/_img/Build-Succeeded.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Build-Succeeded.png
--------------------------------------------------------------------------------
/doc/_img/Git-Repository.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Git-Repository.png
--------------------------------------------------------------------------------
/doc/_img/Queue-New-Build.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Queue-New-Build.png
--------------------------------------------------------------------------------
/doc/_img/Service-Console.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Service-Console.png
--------------------------------------------------------------------------------
/doc/_img/Team-Explorer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Team-Explorer.png
--------------------------------------------------------------------------------
/doc/_img/Unblock-Button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Unblock-Button.png
--------------------------------------------------------------------------------
/doc/_img/Update-Center.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Update-Center.png
--------------------------------------------------------------------------------
/doc/_img/Assume-Port-9000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Assume-Port-9000.png
--------------------------------------------------------------------------------
/doc/_img/Build-Fails-Error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Build-Fails-Error.png
--------------------------------------------------------------------------------
/doc/_img/Port-Number-9090.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Port-Number-9090.png
--------------------------------------------------------------------------------
/doc/_img/SonarQube-Portal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/SonarQube-Portal.png
--------------------------------------------------------------------------------
/doc/_img/Enable-Code-Coverage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Enable-Code-Coverage.png
--------------------------------------------------------------------------------
/doc/_img/Install-NT-Service.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Install-NT-Service.png
--------------------------------------------------------------------------------
/doc/_img/New-Database-DB-Name.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/New-Database-DB-Name.png
--------------------------------------------------------------------------------
/doc/_img/New-Database-General.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/New-Database-General.png
--------------------------------------------------------------------------------
/doc/_img/New-Project-Example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/New-Project-Example.png
--------------------------------------------------------------------------------
/doc/_img/Remove-local-service.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Remove-local-service.png
--------------------------------------------------------------------------------
/doc/_img/SonarQube-Download.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/SonarQube-Download.png
--------------------------------------------------------------------------------
/doc/_img/SonarQube-Port-9090.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/SonarQube-Port-9090.png
--------------------------------------------------------------------------------
/doc/_img/SonarQube-Web-Portal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/SonarQube-Web-Portal.png
--------------------------------------------------------------------------------
/doc/_img/SonarQube.Download.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/SonarQube.Download.png
--------------------------------------------------------------------------------
/doc/_img/StartNTService-Bat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/StartNTService-Bat.png
--------------------------------------------------------------------------------
/doc/_img/sonar.jdbc-sqlserver.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/sonar.jdbc-sqlserver.png
--------------------------------------------------------------------------------
/doc/_img/Browser-Prerequisites.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Browser-Prerequisites.png
--------------------------------------------------------------------------------
/doc/_img/Database-Prerequisites.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Database-Prerequisites.png
--------------------------------------------------------------------------------
/doc/_img/Team-Explorer-Git-Repo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Team-Explorer-Git-Repo.png
--------------------------------------------------------------------------------
/doc/_img/Windows-Security-Alert.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Windows-Security-Alert.png
--------------------------------------------------------------------------------
/doc/_img/sonar.jdbc-sqlexpress.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/sonar.jdbc-sqlexpress.png
--------------------------------------------------------------------------------
/doc/_img/sonar.jdbc.url-setting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/sonar.jdbc.url-setting.png
--------------------------------------------------------------------------------
/doc/_img/JavaSeRuntimeEnvironment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/JavaSeRuntimeEnvironment.png
--------------------------------------------------------------------------------
/doc/_img/New-Database-User-Mapping.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/New-Database-User-Mapping.png
--------------------------------------------------------------------------------
/doc/_img/Port-Fabikam-Fibre-9000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Port-Fabikam-Fibre-9000.png
--------------------------------------------------------------------------------
/doc/_img/Sonar.jdbc.username-entry.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Sonar.jdbc.username-entry.png
--------------------------------------------------------------------------------
/doc/_img/Team-Explorer-Connected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Team-Explorer-Connected.png
--------------------------------------------------------------------------------
/doc/_img/Unzip-SonarQube-x.x.zip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Unzip-SonarQube-x.x.zip.png
--------------------------------------------------------------------------------
/doc/_img/Windows-Security-Alert2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Windows-Security-Alert2.png
--------------------------------------------------------------------------------
/doc/_img/sonarqube-5.1-Properties.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/sonarqube-5.1-Properties.png
--------------------------------------------------------------------------------
/doc/_img/Database-server-properties.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Database-server-properties.png
--------------------------------------------------------------------------------
/doc/_img/Java-SE-Runtime-Environment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Java-SE-Runtime-Environment.png
--------------------------------------------------------------------------------
/doc/_img/New-Database-Connect-To-DB.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/New-Database-Connect-To-DB.png
--------------------------------------------------------------------------------
/doc/_img/New-Database-Security-Login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/New-Database-Security-Login.png
--------------------------------------------------------------------------------
/doc/_img/MSBuild.SonarQube.Runner.PATH.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/MSBuild.SonarQube.Runner.PATH.png
--------------------------------------------------------------------------------
/doc/_img/MSBuild.SonarQube.Runner.Settings:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/MSBuild.SonarQube.Runner.Settings
--------------------------------------------------------------------------------
/doc/_img/New-Database-Default-Language.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/New-Database-Default-Language.png
--------------------------------------------------------------------------------
/doc/_img/New-Database-accent-sensitive.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/New-Database-accent-sensitive.png
--------------------------------------------------------------------------------
/doc/_img/SQL_Latin1_General_CP1_CI_AS.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/SQL_Latin1_General_CP1_CI_AS.png
--------------------------------------------------------------------------------
/doc/_img/SonarQube-Service-Dependency.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/SonarQube-Service-Dependency.png
--------------------------------------------------------------------------------
/doc/_img/Test-Connection-01-ContextMenu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Test-Connection-01-ContextMenu.png
--------------------------------------------------------------------------------
/doc/_img/sonar.jdbc-delete-leading-hash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/sonar.jdbc-delete-leading-hash.png
--------------------------------------------------------------------------------
/doc/_img/New-Database-SQLServer-As-Source.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/New-Database-SQLServer-As-Source.png
--------------------------------------------------------------------------------
/doc/_img/Validate-And-Save-Build-Settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Validate-And-Save-Build-Settings.png
--------------------------------------------------------------------------------
/doc/_img/MSBuild.SonarQube.Runner.Settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/MSBuild.SonarQube.Runner.Settings.png
--------------------------------------------------------------------------------
/doc/_img/New-Database-Test-Connection-Worked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/New-Database-Test-Connection-Worked.png
--------------------------------------------------------------------------------
/doc/_img/SQL-Server-Windows-Authentication.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/SQL-Server-Windows-Authentication.png
--------------------------------------------------------------------------------
/doc/_img/Team-Explorer-Edit-Build-Definition.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Team-Explorer-Edit-Build-Definition.png
--------------------------------------------------------------------------------
/doc/_img/sc-config-sonarqube-dpend-sqlbrowser.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/sc-config-sonarqube-dpend-sqlbrowser.png
--------------------------------------------------------------------------------
/doc/_img/Build-vNext-example-definition-with-cmds.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/Build-vNext-example-definition-with-cmds.png
--------------------------------------------------------------------------------
/doc/book.json:
--------------------------------------------------------------------------------
1 | {
2 | "gitbook": ">=2.0.0",
3 | "title": "SonarQube Setup Guide for .NET users",
4 | "language": "en",
5 | "pdf": {
6 | "fontSize": 10
7 | }
8 | }
--------------------------------------------------------------------------------
/doc/_img/SonarQube-Portal-MSBuild-TestProjectPattern.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-.net-documentation/HEAD/doc/_img/SonarQube-Portal-MSBuild-TestProjectPattern.png
--------------------------------------------------------------------------------
/doc/SUMMARY.md:
--------------------------------------------------------------------------------
1 | * [Introduction](README.md)
2 | * [The MIT License](license.md)
3 | * [Prequisites](prerequisites.md)
4 | * [Installation and Configuration](installation-and-configuration.md)
5 | * [Analyze .NET Projects From The Command Line](analyze-from-the-command-line.md)
6 | * [Analyze .NET Projects From Team Foundation Server 2013 and 2015](analyze-from-tfs.md)
7 | * [Additional Configurations](additional-configurations.md)
8 | * [Appendix 1: Upgrading from v0.9 of the SonarQube MSBuild Runner](appendix-1.md)
9 | * [Appendix 2: Configuring the SonarQube Scanner for MSBuild](appendix-2.md)
10 | * [Appendix 3: Advanced SonarQube Scanner for MSBuild configuration](appendix-3.md)
11 | * [Conclusion](conclusion.md)
--------------------------------------------------------------------------------
/doc/license.md:
--------------------------------------------------------------------------------
1 | # The MIT License (MIT)
2 |
3 | Copyright (c) 2015 SonarSource SA and Microsoft Corporation
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/doc/conclusion.md:
--------------------------------------------------------------------------------
1 | ## Conclusion
2 |
3 | During our adventure of setting up SonarQube with an existing deployment of Team Foundation Server, we introduced you to Technical Debt; we gave you the prerequisites and installation configurations, and covered the topologies. We hope we have achieved our goals for the guidance, get you up and running quickly with SonarQube and Team Foundation Server so you can start your analysis of your technical debt and begin your debt reduction strategy.
4 |
5 | ***Sincerely***
6 |
7 | **The Microsoft Visual Studio ALM Rangers**
8 |
9 | The Visual Studio ALM Rangers includes members from the Visual Studio Product group, Microsoft Services, Microsoft Most Valuable Professionals (MVP) and Visual Studio Community Leads. Their mission is to provide out-of-band solutions to missing features and guidance. A growing Rangers Index is available online.
10 | - [Home](http://aka.ms/vsarunderstand)
11 | - [Solutions](http://aka.ms/vsarsolutions)
12 | - [Membership](http://aka.ms/vsarindex)
13 |
14 | **- Contributors:** Anil Chandra Lingam, Baruch Frei, Brian Blackman, Cesar Solis Brito, Clementino de Mendonca, Darren Rich, Duncan Pocklington, Hosam Kamel, Jean-Marc Prieur, Jeff Bramwell, Marcelo Silva, Mathew Aniyan, Michael Wiley
15 |
16 | **- Special thanks to:** Colin Dembovsky
17 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Introduction
2 |
3 | The goal of this documentation is to explain to any member of the .Net community how to install, configure and use the SonarQube ecosystem to analyze .Net projects.
4 |
5 | # PDF version of the documentation
6 | The pdf for the latest release is available [here](https://github.com/SonarSource-VisualStudio/sonar-.net-documentation/releases/download/1.3/SonarQube-Setup-Guide-For-Net-Users-v-1-3.pdf).
7 |
8 |
9 | # GitBook
10 |
11 | The structure of this documentation has been designed to ease the generation of a global PDF file with help of http://www.gitbook.com each time this documentation is released.
12 |
13 | ## Installation Instructions
14 |
15 | 0. Install NPM (See npmjs.com)
16 | 0. Install GitBook with help of the following command line `npm install gitbook-cli -g`
17 | 0. Install Calibre (See http://calibre-ebook.com/download). The `ebook-convert` command line must be available in the `%PATH%` (or `$PATH`). For Mac OS X users, this might be done with help of the following command line `sudo ln -s ~/Applications/calibre.app/Contents/MacOS/ebook-convert /usr/bin`
18 |
19 | ## Manual actions required when doing a release
20 |
21 | 0. Edit the 'cover.pptx' file to update the release date and the version
22 | 0. Generate a 'cover.jpg' image from 'cover.pptx' and update 'doc/cover.jpg'
23 | 0. Execute the following command line from the root directory of the GitHub Repository: `gitbook pdf ./doc ./SonarQube-Setup-Guide-For-Net-Users-V-X-Y-Z.pdf`
24 |
--------------------------------------------------------------------------------
/doc/analyze-from-the-command-line.md:
--------------------------------------------------------------------------------
1 | # Analyze .NET Projects From The Command Line
2 |
3 | The following assumes that `MSBuild.SonarQube.Runner.exe` has been added to the `%PATH%`.
4 | If that is not your case, simply specify the absolute path to it in both the *begin* and *end* phase commands.
5 |
6 | 1. **Run the MSBuild.SonarQube.Runner.exe begin phase**
7 |
8 | ```
9 | MSBuild.SonarQube.Runner.exe begin /key:{SonarQube project key} /name:{SQ project name} /version:{SQ project version}
10 | ```
11 |
12 | The begin phase takes four arguments:
13 |
14 | - begin
15 | - /key:{the **project key** of the SonarQube project to which the build relates}
16 | - /name:{the **project name** of the SonarQube project}
17 | - /version:{the **project version** of the SonarQube project}
18 |
19 | *The aliases /k:, /n: and /v: can also be used.*
20 |
21 | **>>NOTE >>** If any of the arguments contain spaces then that argument needs to be surrounded by double-quotes e.g. **/name:”My Project Name”**.
22 |
23 | See [Configuring the SonarQube Scanner for MSBuild](appendix-2.md) below for more information on passing additional settings.
24 |
25 | 2. **Launch your normal project build**
26 |
27 | Basic example:
28 |
29 | ```
30 | msbuild
31 | ```
32 |
33 | Example, with nuget:
34 |
35 | ```
36 | nuget restore
37 | msbuild
38 | ```
39 |
40 | **>>NOTE >>** make sure to run *MSBuild.SonarQube.Runner.exe* in a "MSBuild console", or a "VS Developer Command Prompt" otherwise you will not be able to access MSBuild command and you may get an error similar to "'msbuild' is not recognized as an internal or external command,operable program or batch file."
41 | 3. **Run the MSBuild.SonarQube.Runner.exe end phase**
42 |
43 | ```
44 | MSBuild.SonarQube.Runner.exe end
45 | ```
--------------------------------------------------------------------------------
/doc/prerequisites.md:
--------------------------------------------------------------------------------
1 | # Prerequisites
2 |
3 | At the time of this writing, the current version of SonarQube, v5.1, had the following requirements.
4 |
5 | ## Java
6 | A Java runtime is required for SonarQube to run. Supported JVMs:
7 | - Java (Oracle JRE 7 or greater or OpenJDK 7 or greater).
8 |
9 | ## Database
10 |
11 | Regardless of which database solution you choose, it must be set to **UTF-**8, language set to **English**, and collation to CS (case sensitive) and AS (accent sensitive).
12 |
13 | 
14 |
15 | Figure – Database prerequisites
16 |
17 | ## Web Browser
18 |
19 | For the best SonarQube experience ensure to enable JavaScript in your web browser. Supported web browsers:
20 |
21 | 
22 |
23 | Figure – Web browser prerequisites
24 |
25 | ## Hardware
26 |
27 | - At least 1GB RAM
28 | - Disk space requirements vary dependent upon the size and number of projects you wish to analyze using SonarQube. As a point of reference, [Nemo](http://nemo.sonarqube.org/), the public instance of SonarQube, currently analyzes over 15 million lines of source code, which includes four years of history. Nemo is currently using about 10GB of disk space.
29 | - SonarQube relies on intensive hard drive I/O for indexing purposes. You should install SonarQube on the most performant hard drive you have at your disposal for best results.
30 |
31 | ## File Encoding
32 |
33 | SonarQube assumes that all of the source files have the same file encoding. Currently, the *SonarQube Scanner for MSBuild* expects this to be UTF-8. Non-compliance will result in incorrect analysis and display when viewed in the SonarQube portal (for example when drilling down to view the source associated with an issue).
34 |
35 | **>> NOTE >>** For the most up to date information on SonarQube requirements, check out the [requirements](http://docs.sonarqube.org/display/SONAR/Requirements).
--------------------------------------------------------------------------------
/doc/README.md:
--------------------------------------------------------------------------------
1 | # Introduction
2 |
3 | “*SonarSource products generate process-level benefits, such as decreasing software development risk, raising software quality and improving team productivity*” .
4 |
5 | This guide aims to provide insightful and practical guidance around installing and configuring the **SonarQube™** (previously known as “**Sonar**”) platform for the analysis of C# and VB.NET projects.
6 |
7 | [Technical Debt](http://en.wikipedia.org/wiki/Technical_debt) has many causes: business pressures to release early with uncompleted features, software architecture does not allow for adaptation to changing business needs, inadequate testing and documentation, isolation of changes requiring future merging of the changes, and lack of scheduling for refactoring. Paying down on the debt is the only debt reduction strategy.
8 |
9 | As we continue ongoing development, the cost of paying down on the technical debt will increase, as does the cost of fixing a bug later in the development cycle. In theory, paying down technical debt is easy if you simply complete the uncompleted work. However, knowing what technical debt exists or what to track can be challenging. Enter **SonarQube** and **Team Foundation Server**.
10 |
11 | SonarQube is an open source platform providing continuous inspection of your code quality. Through integration with Team Foundation Server and SonarQube you will be empowered to continuously inspect the technical debt, manage the debt, and pay down on the debt.
12 |
13 | The following are the details of getting the analysis of a .NET project in place either integrated in an existing deployment of Team Foundation Server or in a standalone command line way using the *SonarQube Scanner for MSBuild*.
14 |
15 | **>> NOTE >>** For more information on SonarQube, please refer to [Technical Debt](http://docs.sonarqube.org/display/SONAR/Technical+Debt) and [Evaluate your technical debt with Sonar](http://www.sonarqube.org/evaluate-your-technical-debt-with-sonar/).
16 |
--------------------------------------------------------------------------------
/doc/appendix-1.md:
--------------------------------------------------------------------------------
1 | # Appendix 1: Upgrading from v0.9 of the SonarQube MSBuild Runner
2 |
3 | ## Overview of the differences between v0.9 and v1.0
4 | The integration pieces changed significantly from the v0.9 preview version. The main changes in the v1.0 release are as follows:
5 |
6 | 1. Added support for all of the scenarios supported by the *Visual Studio Bootstrapper* plugin so that the Visual Studio Bootstrapper plugin could be deprecated, and
7 | 2. Simplified the installation process.
8 |
9 | The v0.9 release of the SonarQube MSBuild Runner did not support a number of analysis plugins (e.g. the VB.Net plugin, Resharper and StyleCop) because it did not provide any way to pass additional settings to those plugins.
10 | In version 1.0, global settings can be specified in the new SonarQube.Analysis.xml file or passed on the command line. Settings specific to a particular MSBuild project can be specified in the MSBuild project file.
11 |
12 | The v0.9 release required the user to manually set up and configure the sonar-runner. This is no longer required in v1.0 (although it is still necessary for Java to be pre-installed on the machine).
13 | Previously the user had to manually install the *SonarQube.Integration.ImportBefore.targets* file. This file is now automatically installed to the appropriate per-user location for MSBuild v4.0, v12.0 and v14.0.
14 |
15 | A number of bugs were fixed and a series of improvements made to simplify running an analysis from the command line as well as through Team Build.
16 | Finally, the name of the exe changed from *SonarQube.MSBuild.Runner.exe* in the preview to *MSBuild.SonarQube.Runner.exe* in version 1.0 to comply with the plugin naming convention used by SonarSource.
17 |
18 | ## Required upgrade steps
19 |
20 | Perform the following steps to upgrade from version 0.9 of the SonarQube MSBuild Runner:
21 |
22 | 1. Install the new version of the C# plugin on the SonarQube server as described [above](#installLatestPluginAnchor).
23 | 2. Install the new version of the MSBuild.SonarQube.Runner on the agent machine as described [above](#setup-of-the-msbuild-sonarqube-runner-on-the-build-agent-machine).
24 | 3. (Optional) Migrate any additional settings from the old **sonar-runner.properties** file to the **SonarQube.Analysis.xml** file.
25 | - If you had added any additional settings in the **sonar-runner.properties** file then these settings will need to be moved to the new **SonarQube.Analysis.xml** file.
26 | 4. Delete *SonarQube.Integration.ImportBefore.targets* from *%ProgramFiles(x86)%\MSBuild\12.0\Microsoft.Common.Targets\ImportBefore*.
27 | 5. Upgrade any existing build definitions.
28 | - The name of the executable in the **Pre-build script path** and the **Post-test script path** fields should be changed from *SonarQube.MSBuild.Runner.exe* to *MSBuild.SonarQube.Runner.exe*.
29 | - Add *begin* to the **Pre-build script arguments**
30 | - Add *end* to the **Post-test script arguments**.
31 |
32 | ## Optional upgrade steps - remove the sonar-runner
33 | It is not necessary to uninstall the manually-installed version of the sonar-runner that was required by the v0.9 version. However, if you do wish to do so then perform the following steps:
34 |
35 | 1. Delete the sonar-runner files from disc.
36 | 2. Remove the sonar-runner *bin* directory from the `%PATH%`.
37 | 3. Delete the SONAR_RUNNER_HOME environment variable.
38 | 4. Delete the SONAR_RUNNER_OPTS enviornment variable.
39 | 5. Restart the TFS Build Service.
40 | - If you have amended the environment variables then you will need to restart the Build Service so it uses the modified set of variables.
--------------------------------------------------------------------------------
/doc/appendix-3.md:
--------------------------------------------------------------------------------
1 | # Appendix 3: Advanced SonarQube Scanner for MSBuild configuration
2 |
3 | This appendix contains additional information on how the *SonarQube Scanner for MSBuild* can be configured to work effectively in more complex real-world scenarios.
4 |
5 | ## Conditionally excluding projects from analysis
6 |
7 | Setting *SonarQubeExclude* at project level is a simple way to ensure that a project is always included or excluded.
8 | However, because *SonarQubeExclude* is an MSBuild property it can be set conditionally like any other MSBuild property.
9 | This allows considerable flexibility in deciding whether a project should be excluded or not which can be useful in a number of scenarios.
10 |
11 | The following examples show how standard MSBuild features can be used to customise the projects that are analysed.
12 |
13 |
14 | For example, the same MSBuild project may be included in multiple different solutions.
15 | In this situation it is generally desirable that the MSBuild project should only be analysed once e.g.
16 | ```
17 | Solution1 contains projects 'A', 'B' and 'X'.
18 | All of the projects should be analysed as part of SonarQube project 'example.sqproject1'
19 |
20 | Solution2 contains projects 'C', 'D' and 'X'.
21 | Only projects 'C' and 'D' should be analysed as part of SonarQube project 'example.sqproject2'
22 | ```
23 |
24 | Two possible methods of handling this scenario using a small amount of customisation and configuration are shown below.
25 | Both methods conditionally set the *SonarQubeExclude* property based on additional data supplied during the build phase.
26 |
27 | ### Explicitly associating an MSBuild project with a SonarQube project
28 |
29 | One approach is to add a property to the MSBuild project to specify which SonarQube project it belongs to, and to create a custom [targets file](https://msdn.microsoft.com/en-us/library/ms164312.aspx) that filters out projects that do not match the project key that is supplied at build time.
30 |
31 | The detailed steps are as follows:
32 |
33 | - add a property to MSBuild project *X* specifying the SonarQube project key to which the MSBuild project belongs:
34 |
35 | ```xml
36 |
37 | example.sqproject2
38 |
39 | ```
40 |
41 | - create a [targets file](https://msdn.microsoft.com/en-us/library/ms164312.aspx) with the following content:
42 |
43 | ```xml
44 |
45 |
48 |
49 |
50 | true
51 |
52 |
53 | ```
54 |
55 | - import the custom targets file using one of the standard MSBuild mechanisms e.g. either explicitly import it into the relevant projects,
56 | or drop it in a location in which it will be automatically imported such as *%ProgramFiles(x86)%\MSBuild\**[MSBuild version]**\Microsoft.Common.Targets\ImportBefore\*.
57 |
58 | - at build time, pass the relevant SonarQube project key to MSBuild.
59 | - For a TeamBuild XAML build, this would be done by editing the build definition and setting the "MSBuild arguments" appropriately e.g. */p:SQProjectKey=example.sqproject1*.
60 | - On the command line this could done as follows:
61 |
62 | ```
63 | msbuild Solution1.sln /p:SQProjectKey=example.sqproject1
64 |
65 | msbuild Solution2.sln /p:SQProjectKey=example.sqproject2
66 | ```
67 |
68 | This would have the desired effect of ensuring MSBuild project *X* is only analysed once.
69 |
70 |
71 | ### Excluding projects based on the file path
72 | Depending on the layout of the projects on disk, it might be possible to specify the projects to analyse based on the file paths.
73 |
74 | For example, suppose the projects above are laid out on disk as follows:
75 |
76 | ```
77 | c:\Web\ProjectA
78 | c:\Web\ProjectB
79 | c:\Framework\ProjectC
80 | c:\Framework\ProjectD
81 | c:\Framework\ProjectX
82 | ```
83 |
84 | The following custom targets file selects the projects to analyse based on the file path:
85 |
86 | ```xml
87 |
88 |
92 |
93 | true
94 | true
95 |
96 |
97 | ```
98 |
99 | This targets file would allow the projects to be filtered as follows:
100 |
101 | ```
102 | REM Only analyse the web projects, regardless of which projects are included in the solution
103 | REM Note: the backslash in the supplied path is escaped
104 | msbuild Solution1.sln /p:SQPathFilter=c:\\web
105 |
106 | REM Only analyse the framework projects
107 | msbuild Solution2.sln /p:SQPathFilter=c:\\framework
108 | ```
109 |
110 | ## Specifying additional ItemGroups to be analysed
111 |
112 | An MSBuild project refers to files using named *Item* elements inside [ItemGroups](https://msdn.microsoft.com/en-us/library/646dk05y.aspx).
113 | By default, the *SonarQube Scanner for MSBuild* will analyse the item types normally used for source files (e.g. *Compile*, *Content*, *Page* etc).
114 |
115 | You can change the list of item types to analyse by setting the MSBuild property *$(SQAnalysisFileItemTypes)* to a semi-colon separated list of the names of the item types e.g.
116 |
117 | ```xml
118 |
119 | MyFirstType;MySecondType
120 |
121 | ```
122 |
123 | In the above example only files in the *MyFirstType* and *MySecondType* will be analysed. If you want to add to the existing list of item types you can do so as follows:
124 |
125 | ```xml
126 |
127 |
130 | $(SQAnalysisFileItemTypes);MyFirstType
131 |
132 | ```
133 |
--------------------------------------------------------------------------------
/doc/additional-configurations.md:
--------------------------------------------------------------------------------
1 | # Additional Configurations
2 |
3 | ### Running SonarQube as a Service on Windows
4 |
5 | 1. **Uninstall**
6 | - To **uninstall** the NT services, run the following batch file using Run As Administrator.
7 |
8 | Example:
9 |
10 | ```
11 | \bin\windows-x86-64\UninstallNTService.bat
12 | ```
13 |
14 | 2. **Install**
15 | - To **install** the NT services, run the following batch file using Run As Administrator.
16 |
17 | Example:
18 |
19 | ```
20 | \bin\windows-x86-64\InstallNTService.bat
21 | ```
22 |
23 | 
24 | 3. **Service Account**
25 | - Remove the local system account usage and replace it with an administrative account.
26 |
27 | 
28 |
29 | 4. **Start service**
30 | - Make sure you have closed all running non-service instances of **SonarQube Server.**
31 | - To **start** the service use the Services Console or run the following batch file using Run As Administrator.
32 |
33 | Example:
34 |
35 | ```
36 | \bin\windows-x86-64\StartNTService.bat
37 | ```
38 |
39 | 
40 |
41 | 5. **Validate**
42 | - From Services Console make sure the service is running correctly.
43 |
44 | 
45 | - Validate that you are able to browse **SonarQube portal**.
46 | 6. **Inter-service dependency**
47 | - If **SonarQube server** is installed on the same machine as SQL Server with the SonarQube database, you need to make sure that SQL Server is started before the SonarQube service. In addition, the default jdbc driver install with SonarQube requires the SQL Brower Service to be running.
48 | - Assuming you’re using the default SQL Server instance **MSSQLSERVER**, open the command prompt in administrative mode and run the following command to ensure both the SQL Server and SQL Browser Service are started before the SonarQube service.
49 |
50 | ```
51 | Example: sc config SonarQube depend=MSSQLSERVER/SQLBrowser
52 | ```
53 |
54 | 
55 |
56 | **>> NOTE >>** If you are using a named SQL instance, you can check the name of the service by locating it in the Services Console and viewing its properties. The **Service name** to use if given on the **General** tab
57 | - Validate that the inter-service dependency has been added successfully by navigating to the **SonarQube service** and check the **Dependencies** tab.
58 |
59 | 
60 |
61 | ## Configure SonarQube to use Microsoft SQL Database
62 |
63 | **>> NOTE >>** For the purposes of this section, we will assume that you have already installed supported version of Microsoft SQL Server (SQL Server 2012) as part of Team Foundation Server installation.
64 | - As mentioned in the database requirements above, SQL Server must be set to **UTF-8** and the language set to **English**. The collation must be set to **case-sensitive** (CS) and **accent-sensitive** (AS).
65 | - To enable TCP connection for SQL, you must open the SQL Server Configuration Manager and enable TCP/IP within SQL Server Network Configuration and set it to use static port 1433.
66 | - Once a database has been created, you must create a new database user with permissions to create, update, and delete objects within this database.
67 |
68 | ### Preparations
69 |
70 | Before you get to the task of creating a new database for SonarQube, you need to complete a few preparations.
71 |
72 | 1. **Launch SSMS**
73 | - Launch **SQL Server Management Studio** (SSMS).
74 | - Connect to the SQL Server instance on which you plan to create the database.
75 |
76 | ```
77 | Example: .\\SQLExpress
78 | ```
79 |
80 | 2. **Check collation**
81 | - Right-click on the **database server** node and select **Properties**.
82 |
83 | 
84 | - This will display the Server Properties dialog.
85 | - Click on the **General** node and make a note of the current Server Collation setting.
86 | - For example, in the screenshot below, the collation setting is currently set to **SQL\_Latin1\_General\_CP1\_CI\_AS**.
87 |
88 | 
89 | - You need the collation to be both **case sensitive** (CS) and **accent sensitive** (AS).
90 | - If either is different, you will need to be sure to select the case-sensitive version when you set the collation for the database you will be create.
91 | 3. **Check authentication**
92 | - Click on the **Security** node.
93 | - Since, by default, SonarQube utilizes SQL Authentication we need to ensure that Server Authentication is set to **SQL Server** and **Windows Authentication** mode as shown in the screenshot below.
94 |
95 | 
96 |
97 | ### Walkthrough
98 |
99 | 1. **Create database for use by SonarQube**
100 | - Within SSMS right-click on the **Databases** node (just under the Server\\Instance node).
101 | - Select New Database…
102 |
103 | 
104 | - In the **General** node, set the Database **Name** to **Sonar**.
105 |
106 | 
107 |
108 | - In the **Options** node, click on the **Collation** drop-down list and look for the **case-sensitive** (CS) and **accent-sensitive** (AS) variant of the server collation you made note of above.
109 |
110 | 
111 | - Click **OK** to create the initial database.
112 | 2. **Create database user for SonarQube**
113 | - Within SSMS right-click on the **SecurityLogins** node (just under the Server\\Instance node).
114 | - Select
115 |
116 | 
117 | - Select the **General** node.
118 | - Set the Login Name – e.g. SonarUser
119 | - Select SQL Server Authentication and provide a Password.
120 | - Uncheck Enforce password expiration.
121 | - Set the Default Database to the Sonar database you created.
122 | - Set the **Default Language** to **English**
123 |
124 | 
125 | - In the **User Mapping** node, ensure the **SonarUser** has been mapped to the **Sonar dat**abase and check the **db\_owner database role membership**
126 |
127 | 
128 | - Click **OK** to complete the new user setup.
129 |
130 | 3. **Test connection**
131 | - Launch Visual Studio and select **Tools**, **Connect to Database...**
132 |
133 | 
134 | - Select **Microsoft SQL Server** as the Data Source.
135 |
136 | 
137 | - On the **Add Connection** dialog.
138 | - Set the Server Name to your SQL Server instance (e.g. **.\\SQLExpress**)
139 | - Select Use SQL Server Authentication and provide the **User Name** and **Password** you created.
140 | - Enter the name of the database you created, for example Sonar.
141 |
142 | 
143 | - Click on Test Connection.
144 | - You should see the following dialog.
145 |
146 | 
147 |
148 | ## Secure the SonarQube Portal
149 |
150 | By default, the SonarQube portal allows anonymous access, although SonarQube does provide a complete authentication and authorization mechanism to manage security. As users of the portal will be able to view the analyzed source code, it is recommended that the anonymous access to the site not be permitted.
151 |
152 | See [Security](http://docs.sonarqube.org/display/SONAR/Security) section on the SonarQube site for more information.
153 |
--------------------------------------------------------------------------------
/doc/appendix-2.md:
--------------------------------------------------------------------------------
1 | # Appendix 2: Configuring the SonarQube Scanner for MSBuild
2 |
3 | ## Contents
4 |
5 | - [Supplying additional analysis settings](#supplying-additional-analysis-settings)
6 | - [Classifying projects as test projects](#classifying-projects-as-test-projects)
7 | - [Excluding artefacts from analysis](#excluding-artefacts-from-analysis)
8 | - [Using Roslyn analyzers with the SonarQube Scanner for MSBuild](#using-roslyn-analyzers-with-the-sonarqube-scanner-for-msbuild)
9 |
10 | ## Supplying additional analysis settings
11 |
12 | The analysis process can be configured by passing additional analysis settings to the *SonarQube Scanner for MSBuild*.
13 | Global settings can either be passed on the command line or in a settings file.
14 | Project-level settings can be set in the MSBuild project file.
15 |
16 | ### Passing additional global settings on the command line
17 |
18 | Individual global settings can be supplied on the command using the */d* switch:
19 |
20 | ```
21 | MSBuild.SonarQube.Runner.exe /v:1.0 /n:"My project" /k:my.project /d:sonar.host.url=http://myServer:9001
22 | ```
23 |
24 | ### Passing additional global settings in a settings file
25 |
26 | Additional settings can also be supplied in a settings file. The location of the settings file can be specified on the command line using the */s* switch:
27 |
28 | ```
29 | MSBuild.SonarQube.Runner.exe /v:1.0 /n:"My project" /k:my.project /s:C:\SharedSettings\SonarQube.Analysis.xml
30 | ```
31 |
32 | If the */s* command-line switch is not supplied then the *SonarQube Scanner for MSBuild* will look for a default settings file called *SonarQube.Analysis.xml* in the same directory as the MSBuild.SonarQube.Runner executable file.
33 | The default settings file shipped with the *SonarQube Scanner for MSBuild* contains placeholders for the most commonly-required settings and can be used as a template for custom settings files.
34 |
35 | ### Passing additional non-global settings in a project file
36 |
37 | Non-global (i.e. settings specific to a particular MSBuild project) can be specified in the MSBuild project file for the project.
38 | For example, the *MSBuild.SonarQube.Integration.targets* file sets the *sonar.stylecop.projectFilePath* property as follows:
39 |
40 | ```xml
41 |
42 |
43 | $(MSBuildProjectFullPath)
44 |
45 |
46 | ```
47 |
48 | It should only be necessary to use this mechanism in cases were a plugin requires different values for each project that is being analysed, as is the case with the *StyleCop* plugin.
49 |
50 |
51 | ### Order of precedence of analysis settings
52 | If the same setting is supplied in multiple places then the value that is used is determined using the following order of precedence (highest to lowest):
53 |
54 | - command line settings specified using /d
55 | - settings in a SonarQube.Analysis.xml file (either the default settings file or one specified using the */s* command-line switch)
56 | - settings specified in an MSBuild project file
57 | - settings fetched from the SonarQube server
58 |
59 | ## Importing Code Coverage reports
60 |
61 | See http://docs.sonarqube.org/x/CoBh for details on how to import Code Coverage reports into SonarQube.
62 |
63 | ## Importing Unit Test Execution reports
64 |
65 | See http://docs.sonarqube.org/x/DIBh for details on how to import Unit Test Execution reports into SonarQube.
66 |
67 | ## Importing ReSharper Command Line Tools reports
68 |
69 | See http://docs.sonarqube.org/x/lwAW for details on how to import ReSharper Command Line Tools reports into SonarQube.
70 |
71 | ## Classifying projects as test projects
72 |
73 | SonarQube analyses test projects and product projects differently so it is important that projects are correctly classified as being either test or product projects.
74 |
75 | The *SonarQube Scanner for MSBuild* will automatically recognise MSTest unit test projects as being test projects (because of the presence of a well-known guid in the project file).
76 |
77 | Other test projects are recognised by applying a regular expression to the full path of the project file. The regular expression can configured in the SonarQube portal on the settings page for the C# plugin:
78 |
79 | 
80 |
81 | Figure – MSBuild settings tab of the C# plugin
82 |
83 | The regular expression uses [.Net regular expression syntax][1].
84 |
85 | [1]: https://msdn.microsoft.com/en-us/library/az24scfc(v=vs.110).aspx
86 |
87 | In version 1.0.1 onwards, the default regular expression treats projects that contain the word "test" in the project file name as test projects (in version 1.0, projects that contained "test" anywhere in the path were treated as test projects, but user feedback indicated that this regular expression was not specific enough and incorrectly classified to many projects).
88 |
89 | Finally, it is possible to manually classify a project by setting the MSBuild property *SonarQubeTestProject*, e.g.
90 |
91 | ```xml
92 |
93 |
94 | true
95 |
96 | ```
97 |
98 |
99 | ## Excluding artefacts from analysis
100 |
101 | ### Excluding projects from analysis
102 |
103 | Certain types of project will automatically be excluded from analysis. For example, [Microsoft Fakes](https://msdn.microsoft.com/en-us/library/hh549175.aspx) generates additional projects during build. These auto-generated projects will not be analysed.
104 |
105 | Individual projects can be excluded from analysis by setting the MSBuild property *SonarQubeExclude* to *true* as follows:
106 |
107 | ```xml
108 |
109 |
110 | true
111 |
112 | ```
113 |
114 | See [Appendix 3: Advanced SonarQube Scanner for MSBuild configuration](appendix-3.md) for more information on how *SonarQubeExclude* can be set conditionally at build time.
115 |
116 |
117 | ### Excluding individual files from analysis
118 |
119 | Files that are generated by custom tools within Visual Studio are automatically excluded from analysis, such as the *xxx.Designer.cs* file generated from a .resx file:
120 |
121 | ```xml
122 |
123 | True
124 | True
125 | Resources.resx
126 |
127 | ```
128 |
129 | These files are excluded because they are marked as generated by Visual Studio.
130 | It is possible to manually exclude a specific file from analysis by setting the MSBuild metadata item *SonarQubeExclude* to *true* as follows:
131 |
132 | ```xml
133 |
134 |
135 |
136 | true
137 |
138 |
139 | ```
140 |
141 | ## Using Roslyn analyzers with the SonarQube Scanner for MSBuild
142 |
143 | Microsoft .Net provides a rich code analysis framework referred to as "Roslyn" that makes it easy to write custom code analyzers for C# and VB code.
144 | There are many articles that describe how to write such an analyzer (see for example [this article](https://msdn.microsoft.com/en-us/magazine/dn879356.aspx) on MSDN).
145 |
146 | Starting with *SonarQube Scanner for MSBuild* v2.0 and the C# plugin v4.5, it is possible to upload issues found by such custom Roslyn analyzers to *SonarQube*.
147 | No special configuration of the MSBuild projects, the scanner or the C# plugin is required, and it is not necessary for the Roslyn analyzers to be manually installed on the machine performing the analysis. However, it is necessary for there to be a custom *SonarQube* plugin that wraps the custom analyzer to make *SonarQube* and the C# plugin aware of the Roslyn analyzer and the rules that it provides.
148 |
149 | If you are using a custom analyzer provided by a third-party, check with them to see if they also provide the *SonarQube* plugin for their analyzer.
150 | If not, or if you are the analyzer author and want to create a *SonarQube* plugin for your analyzers, you can use the [SDK for SonarQube Roslyn Analyzer Plugins](https://github.com/SonarSource-VisualStudio/sonarqube-roslyn-sdk) to generate one. See the documentation in the SDK project for more information.
151 |
--------------------------------------------------------------------------------
/doc/analyze-from-tfs.md:
--------------------------------------------------------------------------------
1 | # Analyze .Net Projects From Team Foundation Server 2013 and 2015
2 |
3 | ## Overview
4 | The [build system](https://msdn.microsoft.com/en-us/library/ms181709%28v=vs.120%29.aspx) in Team Foundation Server 2013 ("TFS 2013") is based on Windows Workflow.
5 | Builds are defined and customised using XAML.
6 | TFS 2015 introduced a [new build system](https://msdn.microsoft.com/en-us/Library/vs/alm/Build/overview) but also supports the legacy "XAML build" system from TFS 2013.
7 |
8 | This document describes how to set up to configure a XAML build in TFS 2013 or TFS 2015 to include code analysis. It also gives an outline of how to set up analysis using the new build system.
9 |
10 |
11 | ### Mapping Build Definitions to SonarQube projects
12 |
13 | SonarQube uses *Projects* to organize analysis results by logical application, where an application can consist of a number of *modules* (assemblies). It is not currently possible to upload partial analysis results for a SonarQube Project. For example, if SonarQube project *X* consists of assemblies *A*, *B* and *C*, it is not possible to build, analyze and upload data for *A* and *B*, and later to build, analyze and upload data for *C*.
14 |
15 | This means that a Build Definition must build and analyze all of the assemblies that are in that SonarQube Project.
16 |
17 |
18 | ## Analyzing projects in XAML Builds in TFS 2013 and TFS 2015
19 |
20 | ### Additional considerations when using a TFS 2015 XAML build agent
21 | The settings required to configure a XAML build to perform code analysis are the same for TFS 2013 and TFS 2015.
22 | However, if you are using the TFS 2015 XAML build agent then there are additional considerations:
23 | * when analysing data stored in an on-premise TFS installation, the build agent must also have the TFS 2013 Object Model installed
24 | * a TFS 2015 build agent cannot currently be used to analyse code stored in Visual Studio Online ("VSO").
25 | See the following sub-sections for more information.
26 |
27 | #### Installing the TFS 2013 Object Model on a TFS 2015 Build Agent
28 | Installing Visual Studio 2013 will install the necessary assemblies on the build agent.
29 | Alternatively, Microsoft provide a separate installer for the object model that can be downloaded and installed as follows:
30 | * Browse to the [Visual Studio Gallery](https://visualstudiogallery.msdn.microsoft.com/)
31 | * Search for "Team Foundation Server Object Model"
32 | * Choose the appropriate version of the 2013 object model for the updates you have applied to your TFS installation
33 | * Download and run the installer
34 |
35 |
36 | #### Analyzing code stored in Visual Studio Online ("VSO") requires a TFS 2013 build agent
37 | If you are analysing code stored in VSO using a XAML build then at present you must use TFS 2013 build agent.
38 | This is a known issue that is being tracked here [http://jira.sonarsource.com/browse/SONARMSBRU-73].
39 |
40 |
41 | ### Updating an existing XAML build definition
42 |
43 | **>> NOTE >> Assumptions**:
44 | - One of the standard Team Build workflow templates for TFS2013 (GitTemplate.12.xaml or TfvcTemplate.12.xaml) and that the standard Microsoft build targets are used. Users who have customized either the build targets or workflow templates may need to modify the following steps to take account of their customizations.
45 | - You have permissions to create or modify a Build Definition. If you do not, contact your Team Foundation Service administrator.
46 |
47 | 1. **Edit build definition**
48 | - Open the Team Explorer in Visual Studio.
49 | - Check that you are connected to the correct Team Foundation Server.
50 |
51 | 
52 | - Click on the **Builds** tab.
53 | - The displayed **Builds** page will show information about recent builds and any build definitions that exist.
54 | - Right-click on the build definition you want to modify and select **Edit Build Definition…**
55 | - This will display the Build Definition in a document window.
56 |
57 | 
58 |
59 | 2. **Edit advanced build settings**
60 |
61 | - Click on the Process section, then, within the **2. Build** section, expand the **5. Advanced** section.
62 | - This will display the advanced build settings.
63 |
64 | 
65 | - Set the following properties in the Advanced section:
66 | - Set the **Pre-build script path** to the full path to MSBuild.SonarQube.Runner.exe.
67 | - Set the **Pre-build script arguments** to contain the following four arguments:
68 | - begin
69 | - /key:{the **project key** of the SonarQube project to which the build definition relates}
70 | - /name:{the **project name** of the SonarQube project}
71 | - /version:{the **project version** of the SonarQube project}
72 |
73 | *The aliases /k:, /n: and /v: can also be used.*
74 |
75 | **>>NOTE >>** If any of the arguments contain spaces then that argument needs to be surrounded by double-quotes e.g. **/name:”My Project Name”**.
76 |
77 | - Click on the expander for the **2. Advanced** section under **3. Test** to display the advanced test settings.
78 | - Set the **Post-test script path** to the full path to MSBuild.SonarQube.Runner.exe
79 |
80 | **>> NOTE >>** The pre and post script paths refer to the same executable.
81 |
82 | - Set the **Post-test script arguments** to contain the following argument:
83 | - end
84 |
85 | 3. **OPTIONAL - Configure code coverage**
86 |
87 | - Carry out the following actions if you want to collect code coverage data for tests:
88 | - Click on the expander **3. Test**
89 | - Select the **1. Automated tests** line
90 | - Click on the ellipsis to bring up the **Automated Tests** dialogue.
91 |
92 | 
93 | - Click on **Edit** to bring up the **Add/Edit Test Run** dialog
94 | - Select **Enable Code Coverage** from **Options** drop-down.
95 |
96 | 
97 |
98 | - Click OK to close the dialogs.
99 |
100 | **>>WARNING >>** It is possible to drill down through the **1. Automated tests** sections to locate a drop-down for **Type of run settings** in which one of the options is **CodeCoverageEnabled**. However, at the time of writing choosing **CodeCoverageEnabled** from the drop-down does not generate coverage results, due to a bug. See [TFS 2013 - No Code Coverage Results](http://stackoverflow.com/questions/24016217/tfs-2013-no-code-coverage-results) on StackOverflow for more info.
101 |
102 | 4. **Validate and save build settings**
103 | - The following screenshot shows how the build definition should look at this point.
104 |
105 | 
106 |
107 | - **Save** the build definition.
108 |
109 | ### Test the modified build definition
110 |
111 | **>>NOTE >> Assumptions**
112 | - If you have not already created a SonarQube Project with Project Key specified in the Build Definition, a new SonarQube Project will be created automatically, when analysis results are uploaded to SonarQube.
113 | - In this case, the initial analysis will use the default SonarQube Quality Profile.
114 | - If you want the initial analysis to be performed using a different Quality Profile, you will need to create and configure the SonarQube project before running the first analysis.
115 | - See the SonarQube documentation on [Provisioning Projects](http://docs.sonarqube.org/display/SONAR/Provisioning+Projects) for more information.
116 |
117 | 1. **Test the build**
118 | - Right-click on the build definition in the Team Explorer window.
119 | - Select **Queue new build…** from the menu.
120 |
121 | 
122 | - A dialogue box will appear presenting various build options.
123 | - Click on **Queue** to accept the default options and start the build.
124 |
125 | **>> NOTE >>** The build may take some time to complete, depending on the complexity of your application.
126 |
127 | - When the build is complete, the build summary Page will indicate whether the build was successfully or not.
128 | - If the build completed successfully there will be a section entitled **SonarQube Analysis Summary**.
129 |
130 | 
131 | - The section contains a link to the SonarQube portal for relevant SonarQube Project.
132 |
133 | 
134 |
135 | ### Troubleshooting
136 |
137 | #### Build did not complete successfully and build summary contains one or more errors.
138 |
139 | Try modifying the build definition to remove the *SonarQube.MSBuild.Runner.exe* entries in the pre- and post- script sections. If the build completes successfully, then the errors are related to analysis.
140 |
141 | Most analysis-related configuration or execution errors will cause the build to fail and will be appear on the Build Summary. Additional information can be found by viewing the logs or diagnostic information (i.e. by clicking on **View Log**, or **Diagnostics** at the top of the Build Summary page).
142 |
143 | #### During a XAML build, the analysis fails with a "System.ArgumentNullException ... Parameter name: tfsUri"
144 |
145 | Make sure you are using at least TFS 2013 Update 2 agent software.
146 |
147 | ## Analyzing projects using the new TFS 2015 build system
148 | The intention is to provide custom tasks to make the process of performing SonarQube analysis in the TFS build system straightfoward.
149 | The proposed custom build tasks will also make it possible to run SonarQube analysis on hosted build agents.
150 |
151 | However, it is currently possible to perform SonarQube analysis in the new build system on an on-premise build agent by using the general-purpose "Command Line" task to call *MSBuild.SonarQube.Runner.exe* (i.e. to do the same job as the "Pre-Build script"/"Post-Build script" steps in a XAML build).
152 | The following steps provide an outline of how to set this up:
153 |
154 | * Create an on-premise VSO 2015 build agent using the instructions [here](https://msdn.microsoft.com/Library/vs/alm/Build/agents/windows)
155 | * Install the *SonarQube Scanner for MSBuild* on the build agent
156 | * Create a new build definition that includes the *MSBuild* and (optionally) *Visual Studio Test* steps
157 | * Add *Command Line* build step before the *MSBuild* step and after the *Visual Studio Test* step
158 | * In the pre-build command line:
159 | * set the *Tool* field to point to *MSBuild.SonarQube.Runner.exe*
160 | * supply the necessary arguments in the *Arguments* field e.g. *begin /key:my.project /name:"My Project" /version:1.0*
161 | * supply the the SonarQube server URL and credentials either in the *Arguments* field or in a settings file e.g. */d:sonar.host.url=http://mySonarQube:9000*
162 |
163 | * In the post-build command:
164 | * set the *Tool* field to point to the *MSBuild.SonarQube.Runner.exe*
165 | * set the *Arguments* field to *end*
166 | * Save the build definition
167 |
168 | By default a new build definition will run both *debug* and *release* builds. SonarQube can only analyse one type of build at a time so you will need to pick one or the other (*Variables* tab, *BuildConfiguration* property).
169 |
170 | The following screenshot gives an example of how the build definition would look.
171 | 
172 |
--------------------------------------------------------------------------------
/doc/installation-and-configuration.md:
--------------------------------------------------------------------------------
1 | # Installation and Configuration
2 | ## Installation Topologies
3 | ### Minimum Deployment
4 |
5 | - All TFS Services, SQL Server and SonarQube, including Sonar Runner and Build Controller) hosted on a single computer.
6 | - Suitable for research, dogfooding and demonstration of entire end-to-end workflow on one machine.
7 |
8 | **>> NOTE >>** In this guide, we will demonstrate the installation and configurations using [Brian Keller's VM](http://aka.ms/ALMVMs), with all components installed on one box.
9 |
10 | ### Medium Deployment
11 |
12 | - TFS Services and SQL Server are hosted on a single computer and SonarQube (all components) on a separate machine.
13 | - Suitable for evaluation in production or near-production environments.
14 |
15 | ## Recommended platform configurations
16 |
17 | Refer to [System requirements for Team Foundation Server](https://msdn.microsoft.com/en-us/library/dd578592.aspx) and the [TFS Planning, Disaster Avoidance and Recovery, and TFS on Azure IaaS Guide](http://vsarplanningguide.codeplex.com/) for information on hardware and capacity planning recommendations for your Team Foundation Server environment.
18 |
19 | ## Running SonarQube on Hyper-V and Azure IaaS
20 |
21 | While preparing a Virtual Machine that will host SonarQube database, portal and/or Runner workloads take into account the following guidance:
22 |
23 | - [For production servers it is recommended to use Fixed Sized disks](https://technet.microsoft.com/en-us/magazine/ff458359.aspx) (instead of dynamic ones); you must estimate accordingly to set apart the right amount of disk space as required.
24 | - For production servers it is recommended NOT to use dynamic assigned memory as this may decrease overall performance in a production setup; a realistic estimate should be made, monitor and adjusted accordingly.
25 | - Follow [SQL Server best practices](http://blogs.msdn.com/b/cindygross/archive/2009/11/20/compilation-of-sql-server-tempdb-io-best-practices.aspx) while setting the SonarQube database, especially in respect of [*tempdb*](https://msdn.microsoft.com/en-us/library/ms175527.aspx) as per the usage expected by SonarQube:
26 | - Prefer fast disk for *tempdb* file storage.
27 | - Distribute storage in equally sized data files (starting at 1/2 file per physical processor and up to 8 files).
28 | - Monitor and size *tempdb* file storage accordingly.
29 | - Plan for a big size of *tempdb*; approximately 10-12 times SonarQube database size.
30 | - Prefer usage of Windows Server 64 bits, preferably Windows Server 2012 R2.
31 | - Java JRE (or Java SDK) that supports Server mode and configure SonarQube to support it: editing **sonar.properties** file for sonar.web.javaOpts=**-server** and uncommenting the line by removing the \# at the start of the line.** **More details on [Installing the Web Server Tuning the Web Server](http://docs.sonarqube.org/display/SONAR/Installing#Installing-installingWebServerInstallingtheWebServer)
32 | - Prefer to configure Sonar Portal as Windows Service. More details on how to achieve this on [Running SonarQube as a Service on Windows](http://docs.sonarqube.org/display/SONAR/Running+SonarQube+as+a+Service+on+Windows)
33 | - Configure rules for opening ports used by SonarQube, with the Windows firewall and Azure endpoints, if applicable.
34 | - You may use general guidance for Performance Tuning Windows Server in your particular environment/scenario. Please refer to [Performance Tuning Guidelines for Windows Server 2012 R2](https://msdn.microsoft.com/en-us/library/windows/hardware/dn529133).
35 | - Review and plan for [best practices for Physical Servers hosting Hyper-V roles](https://technet.microsoft.com/en-us/magazine/dd744830.aspx):
36 | - Avoid Overloading the Server
37 | - Ensure High-Speed Access to Storage
38 | - Install Multiple Network Interface Cards
39 | - Configure Antivirus Software to Bypass Hyper-V Processes and Directories
40 | - Avoid Storing System Files on Drives Used for Hyper-V Storage
41 | - Monitor Performance to Optimize and Manage Server Loading
42 |
43 | ## Setup SonarQube Server
44 |
45 | 1. **Download**
46 | - Download **SonarQube 5.1** from the SonarQube [downloads](http://www.sonarqube.org/downloads/).
47 |
48 | 
49 | - As mentioned in the Prerequisites section, a Java virtual machine (JVM) is required.
50 | - If the installed JVM meets the version requirements listed, you can skip this section. Otherwise, follow the steps below to install Java.
51 | - Download [Java SE Runtime Environment](http://www.oracle.com/technetwork/java) and make sure you select the one corresponding to your current operation system.
52 |
53 | 
54 |
55 | **>> NOTE >>** SonarQube does not require the full Java JDK (Java SE Development Kit) to run- you only need the JRE (Java SE Runtime Environment).
56 | 2. **Install**
57 | - Copy **sonarqube-5.1.zip** and **jre-8u45-windows-xXX.exe** to your Team Foundation Server.
58 | - Install **Java SE Runtime Environment** on the destination server.
59 |
60 | 
61 | 3. **Extract**
62 |
63 | **>> NOTE >>** Before installing and configuring SonarQube install and configure SQL Server according to the instructions in the section [Additional Configurations](additional-configurations.md).
64 |
65 | - Right-click on **sonarqube-5.1.zip**, select Properties and then click on the **Unblock** button
66 | 
67 | - Unzip **SonarQube-x.x.zip** on to a drive, for example use **C:\\SonarQube\\SonarQube-5.1**.
68 |
69 | 
70 | - At this point, the installation is complete. **Yes, it is that easy**.
71 | - Proceed to the next section to complete the configuration of SonarQube.
72 | 4. **Configure SonarQube**
73 |
74 | - **>> NOTE >>** This walkthrough assumes the use of the BK VM. If, for example, you are using **SQLExpress** instead, you have to update the connection string. Example:
75 |
76 | ```
77 | sonar.jdbc.url=jdbc:jtds:sqlserver://localhost/Sonar;instance=SQLEXPRESS;SelectMethod=Cursor
78 | ```
79 |
80 | - Basic configuration of SonarQube consists of making a few updates to the **sonar.properties** file.
81 | - This file is located in the conf folder located under the SonarQube installation folder.
82 | Example: **C:\\SonarQube\\SonarQube-5.1\\conf**.
83 | - You may not want to do this step if you prefer to go with the default SonarQube port **9000**, if available.
84 | - In the extracted folder navigate to Conf folder, edit **sonar.properties** file to change the default web port or you may need available port. By default SonarQube uses port **9000**.
85 | - Make sure to assign an available port for SonarQube, you may need to use the **netstat** command to check the currently in use ports.
86 | - For the purpose of this walkthrough, we assume port **9000** for the FabrikamFiber demo web site.
87 |
88 | 
89 | - Search for the **\# Web Server** section.
90 | - Uncomment **\#sonar.web.port** and change the port number to any available port, for example **9090**
91 |
92 | 
93 |
94 | **>>NOTE >>** Before proceeding with the below configuration steps make sure you have configured SonarQube to use SQL Server database instead of embedded database.
95 |
96 | - Search for and locate the entry for **sonar.jdbc.username**.
97 |
98 | 
99 | - Uncomment (i.e. delete the leading ‘\#’) the two **sonar.jdbc** settings circled in the screenshot above and replace **sonar** in each setting with the database login name and password, respectively.
100 |
101 | 
102 | - Search for and locate the entry for sonar.jdbc.url. There are several copies of this setting based on database type. Make sure you select the entry for Microsoft SQL Server.
103 |
104 | 
105 | - Uncomment (i.e. delete the leading ‘\#’) the sonar.jdbc.url setting circled in the screenshot above and replace the connection string to match the server\\instance and database name for your machine. Example: **sqlserver://.\\SQLExpress/Sonar;SelectMethod=Cursor**
106 |
107 | 
108 |
109 | **>> NOTE >>** The jdbc driver installed with SonarQube requires the SQL Server Browser to be running. Check that it is running using the Services Console.
110 |
111 | - Save and close the file.
112 |
113 | 5. **Download and install latest SonarQube C# plugin**
114 |
115 | - Download the latest sonar-csharp-plugin-X.Y.jar. At the time of writing, all versions of the C\# plugin are available from the [C\# Plugin](http://redirect.sonarsource.com/plugins/csharp.html) page, on the SonarQube site.
116 | - Use version 4.1 or higher of the plugin.
117 | - Locate the directory into which the SonarQube was installed e.g. **C:\\SonarQube\\SonarQube-5.1\\**. This directory will have an **extensions\\plugins\\** subdirectory.
118 | - Copy **sonar-csharp-plugin-X.Y.jar** to this directory from the downloaded package above.
119 | - Right-click the sonar sonar-csharp-plugin-X.Y.jar and select **properties**.
120 | - Click the **Unblock** button to ensure the file is unblocked.
121 |
122 | 6. **Run**
123 |
124 | - Open Command Prompt and change directory (`cd`) to the extracted folder.
125 |
126 | Example:
127 | ```
128 | cd C:\SonarQube\SonarQube-5.1\bin\windows-x86-64
129 | ```
130 |
131 | - **>> NOTE >>** You need to run the file corresponding to your operating system.
132 | - Run **StartSonar.bat**
133 | - **>> NOTE>>** If you are prompted with a Windows Security Alert asking for network access, click on the Allow access button
134 |
135 | 
136 | 
137 | - Browse SonarQube web portal using [http://YOUR\_SERVER\_NAME:SONAR\_PORT](http://YOUR_SERVER_NAME:9090). Example: [**http://vsalm:9090**](http://vsalm:9090)
138 |
139 | 
140 | - You should see the default SonarQube web page as shown above. If not, re-validate settings as shown in the previous sections.
141 | - If the web server does not start, consult the logs in **C:\\SonarQube\\SonarQube-5.1\\logs** to determine possible issues.
142 | 7. **Verify the installed SonarQube C# plugin version**
143 | - Login to SonarQube using admin credentials.
144 | - If this is the first time you are using SonarQube, the default admin credentials are:
145 |
146 | `- Username: admin`
147 |
148 | `- Password: admin`
149 |
150 | - If you log in using the default credentials, it is recommended that you change the password.
151 | - Verify that the C\# X.Y plugin has been correctly deployed, Navigate to **Settings \>System \> Update Center**.
152 |
153 | 
154 |
155 | **>> NOTE >>** The screenshot above is based version 3.5. You should see version 4.1 or later.
156 |
157 | **>> NOTE >>** Please refer to section **[Additional Configurations](additional-configurations.md)** for more details on how-to configure additional SonarQube configurations that are required for enterprise level deployment.
158 |
159 | ## Setup of the *SonarQube Scanner for MSBuild* on the Build Agent Machine
160 |
161 | - You should install it on any machine that will launch SonarQube analysis (example: development machine and build agent).
162 | - In case of installing *SonarQube Scanner for MSBuild* on a development machine or build agent, you need to make sure that Java SE Runtime Environment installed on that machine.
163 | - Java SE Runtime Environment installation is not required if Visual Studio 2015 with Android tooling/Cross platform tools are installed since JDK is being installed part of Visual Studio installation.
164 |
165 | 1. **Extract**
166 | - Download the latest *SonarQube Scanner for MSBuild* from the SonarQube [downloads](http://www.sonarqube.org/downloads/).
167 | - Right-click on the downloaded .zip file and click on the **Unblock** button.
168 |
169 | 
170 | - Unzip **MSBuild.SonarQube.Runner-[version]** on to a drive.
171 | Example: **C:\\SonarQube\\bin**
172 |
173 | 2. **Configure**
174 | - Edit **C:\\SonarQube\\bin\\SonarQube.Analysis.xml** by specifying the following parameters to run against the SonarQube Server we set up earlier.
175 | - If you are running SonarQube 5.1.x or less, uncomment and set the following properties:
176 | - `sonar.jdbc.url`
177 | - `sonar.jdbc.username`
178 | - `sonar.jdbc.password`
179 |
180 | 
181 |
182 | 3. **OPTIONAL - Update the `%PATH%` environment variable**
183 |
184 | - Add the directory containing *MSBuild.SonarQube.Runner.exe* to the `%PATH%` if you intend to use it from the command line:
185 |
186 | 
187 |
188 | ### Settings File Permissions
189 |
190 | - Storing passwords in clear text in unsecured settings files is **not** recommended.
191 | - Restrict access to the **C:\\SonarQube\\bin\\SonarQube.Analysis.xml** file by setting appropriate file permissions.
192 |
--------------------------------------------------------------------------------
/License.txt:
--------------------------------------------------------------------------------
1 | Code snippets in the documentation are licensed under:
2 | The MIT License (MIT)
3 |
4 | Copyright (c) SonarSource SA and Microsoft Corporation
5 |
6 | All rights reserved.
7 |
8 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11 |
12 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13 |
14 | =============================================================================
15 |
16 | Documentation is licensed under:
17 |
18 |
19 | Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible.
20 |
21 |
22 | Using Creative Commons Public Licenses
23 |
24 | Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses.
25 |
26 | Considerations for licensors: Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. More considerations for licensors.
27 |
28 | Considerations for the public: By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. More considerations for the public.
29 |
30 | Creative Commons Attribution-ShareAlike 4.0 International Public License
31 |
32 | By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-ShareAlike 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.
33 |
34 | Section 1 – Definitions.
35 | a.Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
36 | b.Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.
37 | c.BY-SA Compatible License means a license listed at creativecommons.org/compatiblelicenses, approved by Creative Commons as essentially the equivalent of this Public License.
38 | d.Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
39 | e.Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.
40 | f.Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.
41 | g.License Elements means the license attributes listed in the name of a Creative Commons Public License. The License Elements of this Public License are Attribution and ShareAlike.
42 | h.Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License.
43 | i.Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.
44 | j.Licensor means the individual(s) or entity(ies) granting rights under this Public License.
45 | k.Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.
46 | l.Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
47 | m.You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning.
48 |
49 | Section 2 – Scope.
50 | a.License grant. 1.Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to: A.reproduce and Share the Licensed Material, in whole or in part; and
51 | B.produce, reproduce, and Share Adapted Material.
52 |
53 | 2.Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.
54 | 3.Term. The term of this Public License is specified in Section 6(a).
55 | 4.Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material.
56 | 5.Downstream recipients.
57 | A.Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.
58 | B.Additional offer from the Licensor – Adapted Material. Every recipient of Adapted Material from You automatically receives an offer from the Licensor to exercise the Licensed Rights in the Adapted Material under the conditions of the Adapter’s License You apply.
59 | C.No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.
60 |
61 | 6.No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).
62 |
63 |
64 | b.Other rights.
65 | 1.Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.
66 | 2.Patent and trademark rights are not licensed under this Public License.
67 | 3.To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties.
68 |
69 |
70 | Section 3 – License Conditions.
71 |
72 | Your exercise of the Licensed Rights is expressly made subject to the following conditions.
73 |
74 | a.Attribution.
75 |
76 | 1.If You Share the Licensed Material (including in modified form), You must:
77 | A.retain the following if it is supplied by the Licensor with the Licensed Material: i.identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);
78 | ii.a copyright notice;
79 | iii.a notice that refers to this Public License;
80 | iv.a notice that refers to the disclaimer of warranties;
81 | v.a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
82 |
83 | B.indicate if You modified the Licensed Material and retain an indication of any previous modifications; and
84 | C.indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License.
85 |
86 | 2.You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
87 | 3.If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable.
88 |
89 | b.ShareAlike.
90 | In addition to the conditions in Section 3(a), if You Share Adapted Material You produce, the following conditions also apply.
91 | 1.The Adapter’s License You apply must be a Creative Commons license with the same License Elements, this version or later, or a BY-SA Compatible License.
92 | 2.You must include the text of, or the URI or hyperlink to, the Adapter's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Share Adapted Material.
93 | 3.You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, Adapted Material that restrict exercise of the rights granted under the Adapter's License You apply.
94 |
95 |
96 | Section 4 – Sui Generis Database Rights.
97 |
98 | Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:
99 | a.for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database;
100 | b.if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material, including for purposes of Section 3(b); and
101 | c.You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
102 | For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
103 | Section 5 – Disclaimer of Warranties and Limitation of Liability.
104 | a.Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.
105 | b.To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.
106 | c.The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
107 |
108 | Section 6 – Term and Termination.
109 | a.This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.
110 |
111 | b.Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:
112 | 1.automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
113 | 2.upon express reinstatement by the Licensor.
114 | For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.
115 | c.For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.
116 | d.Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
117 |
118 | Section 7 – Other Terms and Conditions.
119 | a.The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
120 | b.Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.
121 |
122 | Section 8 – Interpretation.
123 | a.For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.
124 | b.To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.
125 | c.No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.
126 | d.Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.
127 |
128 | Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” The text of the Creative Commons public licenses is dedicated to the public domain under the CC0 Public Domain Dedication. Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses.
129 |
130 | Creative Commons may be contacted at creativecommons.org.
131 |
--------------------------------------------------------------------------------