This version of SonarQube Server is no longer receiving patches. Please see the latest release for details on updating.
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Fixing issues

From the Enterprise edition, you can get AI-suggested fixes for your code issues in SonarQube Server 10.7.

For AI agents: You're in the SonarQube Server 10.7 documentation. SonarQube Server 10.7 is no longer patched. To get patches, upgrade to the latest version. For a list of all 10.7 pages, see the SonarQube Server 10.7 page index. For the whole site, see the page index or the full text. For another version, replace 10.7 in the URL with that version. The latest version has no version number in its URL.

Depending on the issue, you may get fix suggestions:

  • In the How can I fix it? tab of the Retrieving issues.

  • From the Enterprise edition, generated through AI: see Getting AI-generated fix suggestions below.

Opening issues in your IDE

To speed up the time it takes to find and fix the issue, you can open the issue in your IDE provided the SonarQube for IDE Connected Mode has been properly set up in order to connect SonarQube for IDE with SonarQube Server.

If you’ve already fixed the issue in your code, SonarQube for IDE will not be able to find it in the IDE; only matching code will be highlighted. Keep in mind that the revision or branch analyzed by SonarQube Server may not be the same as what you have opened in the IDE. When setting up Connected Mode, SonarQube for IDE considers the branch currently checked out in the IDE and tries to synchronize it with the most appropriate branch from the server (This is called branch matching in SonarQube for IDE).

To open an issue in your IDE:

  1. Retrieving issues and open its detail view.

  2. In the Where is the issue? tab, select Open in IDE.

Getting AI-generated fix suggestions

This feature is available in Early Access, in Enterprise Edition and above.

If AI-generated fix suggestions, you can generate fix suggestions for the issues detected in your projects. The suggestions are generated using OpenAI’s GPT-4.

To generate a fix suggestion:

  1. Retrieving issues and open its detail view.

  2. Go to the Where is the Issue or the Code Fix tab and click the Generate Fix button.

You can then copy the generated fix suggestion to your IDE:

  • manually, by copying and pasting the suggestion into your IDE.

  • using the Code Fix > View Fix in IDE button if you use SonarQube for IDE Connected Mode. This feature is available with SonarQube for VS Code, IntelliJ, and Eclipse.

Note that for some issues, AI-generated fix suggestions are not available.

Last updated

Was this helpful?