The demand for rapid and reliable code delivery is higher than ever. Developers face constant pressure to write, debug, and deploy code efficiently, while engineering leaders seek tools that enhance productivity, reduce time-to-market, and maintain high code quality. To meet these demands, we are excited to introduce Sonar AI CodeFix, designed to streamline the way developers address code issues.
What is Sonar AI CodeFix?
Sonar AI CodeFix is a powerful capability that suggests code fixes for issues discovered by our code analysis solutions SonarQube and SonarCloud. By automating the resolution of common coding problems, AI CodeFix significantly boosts developer speed and productivity. With just one click in the existing UI, millions of developers on the Sonar platform can receive suggestions on how to resolve a range of issues, streamlining the debugging process.
How Sonar AI CodeFix Works
Sonar’s static code analysis in SonarQube and SonarCloud scans repositories to detect bugs, security vulnerabilities, and code quality issues across popular languages and frameworks. Code analysis is triggered during events such as pushing to a branch or opening a pull request. When a problem is identified, it is presented to the user as a bug, vulnerability, or code quality issue. Building on top of this detection, Sonar AI CodeFix can go a step further by utilizing a large language model (LLM) to generate an AI-driven code fix for issues discovered by the static code analysis. The basic principle behind AI CodeFix is straightforward: when you request a code fix for a problem, it sends the affected code snippet along with a description of the issue to an LLM. The proposed code edits generated by the LLM are designed to resolve the problem without altering the existing functionality of the code.
Key Features of Sonar AI CodeFix
Instant Code Fixes
AI CodeFix automatically generates code fix suggestions with a click, minimizing manual debugging efforts and allowing developers to focus on more critical tasks.
Contextual Understanding of Sonar Findings
By leveraging LLMs, AI CodeFix understands the context of your code and provides relevant fixes, ensuring that the suggested solutions are accurate and tailored to your codebase.
Seamless Workflow
AI CodeFix allows developers to fix issues directly within their integrated development environment (IDE) using SonarLint connected mode, ensuring a smooth workflow.
Continuous Learning
AI CodeFix continuously improves its suggestions based on user feedback, new data, and LLM improvements, ensuring that the tool remains up-to-date with the latest coding practices and trends.
Multi-Language Support
- Broad Compatibility: Supports flagship programming languages including Java, JavaScript, TypeScript, C#, Python, C, and C++, ensuring that a wide range of development projects can leverage Sonar AI CodeFix’s capabilities.
- Versatile Application: Whether you're working on frontend, backend, or full-stack projects, Sonar AI CodeFix has you covered.
Getting Started with Sonar AI CodeFix
For a limited time, AI CodeFix is available for free in Early Access on SonarQube and SonarCloud. AI CodeFix can easily be enabled in the Administration UI for any organization by going to the Organization settings.
AI CodeFix targets issues detected in pull requests and code branches, ranging from simple bugs and security vulnerabilities to areas where code quality can be enhanced. Next to each detected issue that it can resolve, you'll find a “Generate AI Fix” button. Clicking this button triggers AI CodeFix to analyze the problem and generate a suggested solution. This suggestion appears right on the pull request page, allowing you to see the fix in context. This allows developers to review, commit, dismiss, or edit the suggestion. The suggested fix can be copied for manual implementation or directly applied by opening the file in IDE that has SonarLint configured in connected-mode.
Experience Sonar AI CodeFix
AI CodeFix is now available in early access to all SonarQube 10.7 and SonarCloud customers. It is included in the Team and Enterprise plans of SonarCloud and in the Enterprise Edition and Data Center Edition of SonarQube. During the Early Access period, we are gathering feedback using an in-app survey. Your input will help us fix minor issues and monitor metrics to ensure our suggestions effectively address bugs and security vulnerabilities. In parallel, we are working on expanding AI CodeFix to more languages, and continuously improving the user experience.
We invite you to explore AI CodeFix by signing up for a SonarCloud Team plan trial or requesting a trial for SonarQube Enterprise Edition. By integrating Sonar AI CodeFix into your development process today, you can experience enhanced productivity, improved code quality, and faster time to market.
Learn more about AI CodeFix