Scan my project
Scanning your project in SonarQube for Visual Studio is a simple, easy process.
SonarQube for IDE, a core component of the SonarQube solution, is a developer’s first line of defense to find and fix coding issues in real-time. The results of a SonarQube for IDE scan provide rich contextual guidance to help you improve your skills while enhancing productivity to help you resolve issues in code.
SonarQube for IDE scans your project to provide instant feedback against hundreds of language-specific rules. When running in connected mode with SonarQube Server or SonarQube Cloud, you can benefit from additional rules that identify security vulnerabilities and security hotspots as well as take advantage of team features that help your organization achieve high-quality code.
Every organization has custom policies and procedures; the SonarQube for IDE analyzer offers a level of customization to help you achieve those practices.
First steps
By default, SonarQube for Visual Studio will automatically analyze your open files. In addition, scanning your full project or your entire solution is possible for C# and VB; see the C# and VB collapsible below for more details.
For languages other than C# and VB, SonarQube for Visual Studio will only analyze current files when a file is opened or saved. It is not possible to manually trigger an analysis.
Check the Running an analysis page for more information about triggering and refining the analysis process.
Language-specific information
Specify additional analyzer properties
It is possible to specify extra analyzer properties and solution exclusions that will be used in advanced use cases during the analysis of your solutions. Both settings are accessible via the SonarQube for Visual Studio UI as described below.
settings.json file format and location
The properties and solution exclusions are saved in a settings.json file stored in your user’s roaming profile %AppData%\Roaming\SonarLint for Visual Studio\SolutionSettings\<YOUR_SOLUTION>
.
See this example as a format sample of your settings.json file. It changes the parameters on analyzing C# code and excludes, and at the end, excludes any C# files matching the *Class?
wildcard.
{
"sonarlint.analyzerProperties": {
"sonar.cs.analyzeGeneratedCode": "false"
},
"sonarlint.analysisExcludesStandalone": "*Class?.cs"
}
Add analysis properties for your solution
It is possible to specify extra analyzer properties that will be used for analysis in advanced use cases. Navigate to Extensions > SonarQube > Solution Settings > Analysis Properties and select Add.
Defining solution exclusions
Navigate to Extensions > SonarQube > Solution Settings > File Exclusions and select Add to configure the file names and/or wild card patterns you want to exclude from the analysis. Any acceptable wildcard pattern can be used. Note that the values you define here will override the global values defined in your File exclusions. Remember that when running SonarQube for Visual Studio in Connected mode, all locally defined exclusion values will be ignored.
Please see the File exclusions page for more detail about using global exclusions and to learn which Wildcard patterns are accepted.
Last updated
Was this helpful?