Start FreeLog in
SonarQube Cloud | Managing your project | Managing code issues | Fixing issues

Fixing your code issues

On this page

Depending on the issue, you may get fix suggestions:

Opening issues in your IDE

To speed up the time it takes to find and fix the issue, use Connected Mode to connect SonarQube Cloud with SonarQube for IDE and use the Open in IDE feature.

To open an issue in your IDE, it's easier if you are already running in connected mode:

  1. Retrieve the issue and open its detail view.
  2. Select the Open in IDE button. 

Getting AI-generated fix suggestions

This feature is available in Early Access, in the Team and Enterprise plans. AI-generated fix suggestions are available for a select list of rules and languages.

When AI-CodeFix is enabled for your organization, you can get an AI-generated fix suggestion for eligible issues. The suggestions are generated using OpenAI's GPT-4o (recommended) or Anthropic's Claude 3.5 or 3.7 Sonnet. 

To generate a fix suggestion in your IDE:

  • Simply open your project in SonarQube for IntelliJ and set up connected mode with SonarQube Cloud. In your IDE, select an issue marked with the $ai-icon-sparkle icon, open the Rule description > $ai-icon-sparkleAI CodeFix tab, and select $ai-icon-sparkleGenerate Fix. A fix will be generated in the code editor and you'll have a chance to Apply or Decline the suggestion.

To generate a fix suggestion in SonarQube Cloud:

  • Select $ai-icon-sparkleGenerate AI Fix. For more details, see the SonarQube for IntelliJ page on AI capabilities.
  • Alternatively, retrieve the issue in SonarQube Cloud and open its detail view. If an AI CodeFix is an option for that particular issue, you will see the Generate AI Fix button.
  • From either the Where is the Issue or the AI CodeFix tabs, select the Generate Fix button.
If an AI CodeFix is available for your issue, SonarQube Cloud will offer a Generate AI Fix button to select.

An AI CodeFix will be generated, and you’ll see a diff view in the AI CodeFix tab. Simply copy and paste the generated fix into your IDE; If you're using SonarQube for IDE and have Connected mode set up, feel free to use the Open in IDE feature to streamline the process.

  • If you are running SonarQube for Visual Studio, selecting Open in IDE will directly paste the fix suggestion into your IDE.

An AI Code Assurance badge is available to any SonarQube Cloud plan to mark your AI projects as reviewed by SonarQube Cloud. Any user with project access can use the badge. For more detailed instructions, see the Marking a project as containing AI-generated code article on the AI settings page.

Note that for some issues, an AI CodeFix suggestion is not available.


Was this page helpful?

© 2008-2025 SonarSource SA. All rights reserved. SONAR, SONARSOURCE, SONARQUBE, and CLEAN AS YOU CODE are trademarks of SonarSource SA.

Creative Commons License