View all connectors

SonarQube Server

By integrating SonarQube with DX, you can analyze security issues and metrics on code coverage, code smells, and vulnerabilities. Please refer to the API documentation below and our schema explorer to see what data DX imports.

Prerequisites

To connect SonarQube to DX, you need:

  • a SonarQube account with admin access
  • allowlist DX IP addresses if your SonarQube instance is behind a firewall or has IP restrictions

Setup instructions

Follow the steps below to connect SonarQube to DX.

Step 1

Log in to your SonarQube account and navigate to Account > Security.

Step 2

Generate a token of type User and copy the token. Please note that this token grants DX access to all API endpoints, although DX only makes requests to endpoints that are listed below. Further restriction of API endpoints can be achieved by setting up a proxy, if desired.

Step 3

  • Navigate to the connections page in DX and select “+ Connection” in the top right.
  • Enter the credentials you have generated in the previous steps—refer to the information below for errors and troubleshooting.

API reference

The table below lists the specific API endpoints that are used by DX.

Endpoint Documentation
/projects/search link
/issues/search link
/hotspots/search link
/measures/searchHistory link
/measures/component link
/metrics/search link

Errors

The table below lists potential error codes when adding a connection in DX.

Error Description
invalid_credentials Your API credentials entered are not valid.
invalid_permissions Your API token does not have the permissions required by DX.

Troubleshooting

I’m seeing “internal_server_error” error from API response

This indicates that DX can’t access server. Please verify API access using the following curl request:

curl --location 'https://{BASE_URL}/projects/search' \ --header 'Authorization: Bearer ****'