Learn

Home

Developer Guide

Enabling Anthropic Claude 3.5 Sonnet for AI CodeFix

We'll walk through how to configure Claude Sonnet 3.5 for your organization, and provide feedback to continuously improve the process.

Table of Contents

  • Chevron right iconIntroduction
  • Chevron right iconConfiguring Claude Sonnet 3.5 on SonarQube Cloud


Introduction


The pace of innovation in software development is relentless, and keeping up with the latest tools and techniques is a constant challenge. So, when AI CodeFix started to gain traction, promising to automate debugging tasks we face every day, it felt like a genuine leap forward. The potential to augment AI CodeFix abilities and accelerate developer workflows was immediately apparent.


Today, we're not just talking about generic AI assistance. We're diving into something more specific: the power of choice. SonarQube Cloud now allows us  to switch between different Large Language Models (LLMs) as our AI CodeFix engine. And that's a game-changer.


Why? Because every LLM has its strengths and weaknesses. Some excel at certain types of code or tasks more than others. SonarQube Cloud gives you the flexibility to leverage different LLMs like GPT-4o and Claude Sonnet 3.5. Each model brings a unique set of strengths to the table, potentially excelling in different areas of code analysis and fix generation. This allows you to experiment and determine which engine works best for your specific needs.


But it's not just about having access to these models; it's about understanding how to use them effectively. This article explores the practicalities of using AI CodeFix with SonarQube Cloud, demonstrating how to select the LLM engine. We'll walk through how to configure Claude Sonnet 3.5 for your organization, and provide feedback to continuously improve the process. Let's see how this multi-LLM approach can transform our development workflow.


Configuring Claude Sonnet 3.5 on SonarQube Cloud 


Prerequisites:


Before you begin, ensure you have the following in place:


Your SonarQube Cloud Account: You need a SonarQube Cloud account to set up AI CodeFix.


Step-by-Step Guide: Enabling Sonnet 3.5 for AI CodeFix

  • Log in to the SonarQube Cloud as an administrator. 
  • Navigate to the Organization’s Settings section. 
  • Click on Administration & select AI CodeFix.
  • Select the check box “Enable AI CodeFix”.
  • From the Provider dropdown, select “Anthropic (Claude 3.5 Sonnet)” as the provider.

  • You can either select “All Projects” or “Only selected projects”. For ease, we are selecting all the projects that will have AI CodeFix feature enabled.

  • Click on “Save”.

Verifying Anthropic for AI CodeFix


To confirm that Anthropic is successfully powering AI CodeFix:

  • Analyze a Project: Run a code analysis on a project that is configured to use AI CodeFix with Anthropic.
  • Identify Code Issues: Review the reported code issues. Focus on issue types that are known to be supported by AI CodeFix.
  • Request AI Fix Suggestions: For a supported issue, trigger the AI CodeFix functionality.
  • Evaluate the Suggestions: Observe the fix suggestions generated by AI CodeFix. With Anthropic enabled, you should see intelligent, context-aware, and potentially more refined fix suggestions compared to less powerful models.


Congratulations! You have successfully enabled Anthropic Claude 3.5 Sonnet for AI CodeFix in your platform.