IntelliJ | Using SonarQube for IDE | AI capabilities

AI capabilities in your IDE

On this page

AI features are only available when running in connected mode with SonarQube Cloud Team and Enterprise plans.

AI CodeFix in your IDE

AI CodeFix is an Early Access feature that generates AI-generated fix suggestions in SonarQube Cloud and SonarQube for IntelliJ. It must be activated by an Organization Admin in SonarQube Cloud. See Enabling AI-generated fix suggestions in the SonarQube Cloud documentation for more details.

About AI CodeFix

Running SonarQube for IntelliJ in connected mode with SonarQube Cloud is required to get AI-generated fix suggestions in your IDE. See the Connected mode setup page for details.

The suggestions are generated using OpenAI's GPT-4o or Anthropic Claude 3.5 Sonnet as it's defined in SonarQube Cloud and enabled for your organization

Getting AI-generated fix suggestions

With AI-CodeFix enabled in SonarQube Cloud, issues eligible for AI Code fix are identifiable by the $ai-icon-sparkle icon in SonarQube for IDE. You may need to restart your IDE if the feature was recently enabled in SonarQube Cloud and the server has not yet synced with SonarQube for IntelliJ.

To generate a fix suggestion:

  • Select an eligible issue in your IDE and open the Rule tab; the $ai-icon-sparkleAI CodeFix tab will be available in the Rule description.
  • Select $ai-icon-sparkleGenerate Fix.
  • An AI CodeFix snippet, or series of snippets if your issue is an injection vulnerability, will be generated, displaying a diff view of the fix suggestion or suggestions.
  • Select Apply to accept the suggestion.
Issues that are eligible for AI-generated fix suggestions (the AI CodeFix feature) are highlighted by the star icon.

It's also possible to use the SonarCloud Open in IDE button to navigate to your issue in the code editor. See the article on Opening issues in the IDE for more information.


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