Table of Contents |
---|
Configuration Checklist
Verify your SonarQube™ server settings in global settings of Bitbucket
Run SonarQube™ source code analysis for main branch
Configure the source code analysis
Analysis results must be visible in SonarQube™
Configure corresponding SonarQube™ project in repo settings of Bitbucket
Go to source code view and see the existing issues/stats
You should see the SonarQube™ statistics and issue annotation
Statistics and annotations are missing? Verify your Bitbucket repository configuration:
Did you configure the correct analysis directory?
Does the SonarQube™ project key match with the configuration in Bitbucket?
Create a pull request with issues in the code.
Run SonarQube™ source code analysis for source branch of your pull request.
Go to the pull request view and check if the analysis results are visible. You should see a quality gate status overview, and issue annotations in the pull request diff.
An error
hints at a wrong analysis configuration or a wrong analysis directory setting
No issue annotations:
Verify that you can see the issues that should be shown in SonarQube™
Do the issue annotations appear after clicking “Refreshing Sonar™ analysis” in the pull request overview? Then check your Webhook configuration
...
Go to
Repository settings
→Sonar
Check your configured projects under
SonarQube Projects
: the files in your pull request have to start with one of the configuredmodule directory
paths of your projects. E.g.
Example:
if your pull request touches files undersrc/main/java/com/mycompany/ui
, make sure you either have
a) an emptymodule directory
(if you have just one SonarQube™ project in a repository).
b) a SonarQube™ project withmodule directory
src/main/java
that maps to the SonarQube™ project for that analysis directory (multiple SonarQube™ projects in repository) .
The app shows the issues & statistics of any SonarQube™ project that has a matchingmodule directory
. Note that an emptymodule directory
always matches any path, so if you only have a single SonarQube™ project in your repository, just use an empty emptymodule directory
.Add a SonarQube™ project or fix the existing ones.
Go back to your pull request, and you should not get this warning anymore, but instead see the SonarQube™ statistics for the configured project(s).
...