Skip to main content

How to Set Up SonarQube in IntelliJ: A Step-by-Step Guide

SonarQube in IntelliJ:

(Looking for SonarLint then check here: How to install and execute Sonarlint)

Setting up SonarQube in IntelliJ can significantly enhance your code quality by identifying bugs and vulnerabilities. Follow these steps to integrate SonarQube with IntelliJ:

Step 1
  • Install SonarLint PluginOpen IntelliJ and navigate to Settings.
  • Go to Plugins > Marketplace.
  • Search for SonarLint, install it, and restart the IDE.
Step 2: Configure SonarLint


  • Click on SonarLint at the bottom left of IntelliJ.
  • Select Configure SonarLint.
  • In the popup, check the box for Bind project to SonarQube/SonarCloud and click on Configure the connection.


Step 3
  • Set Up the ConnectionIn the new popup, click the + icon to add a new connection.
  • If the + icon is not visible, go to File > Settings > New UI and disable it. Apply changes and restart the IDE.
  • Name your connection and select SonarQube.
  • Enter the SonarQube URL (e.g., https://sonar.prod.company.com) and click Next.



Step 4
  • Authenticate and Create TokenA popup will appear with a Create Token option. Click on it.
  • Authenticate on the redirected page and click Allow.
  • Return to IntelliJ.






Step 5: Finalize Configuration
  • Click Next and then OK.
  • In the popup, select the connection name you created.
  • Search for your project key in the list and add your repository name.
  • Click OK to complete the configuration.

Step 6
  • Analyze Code with SonarLintClick on any file in your repository.
  • Go to SonarLint > Analyze with SonarLint.
  • View the issues in the Report tab.
Step 7: 
  • Re-enable New UI (Optional)Go back to File > Settings > Appearance.
  • Enable New UI and restart the IDE.
By following these steps, you can effectively integrate SonarQube with IntelliJ and maintain high code quality in your projects.

Also check: 


Comments

Popular posts from this blog

How to Implement Lombok in IntelliJ for Java Projects: A Step-by-Step Guide

Lombok in IntelliJ for Java Projects Implementing Lombok in your Java project can streamline your code by reducing boilerplate. Follow these steps to set up Lombok in IntelliJ: Step 1 :  Ensure Java SDK Version. Ensure that your project is using Java 8 or higher.  You can check and set the Java SDK version in pom.xml: XML <properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> </properties> Step 2 : Add Lombok Dependency to pom.xmlOpen the pom.xml file in your project. Add the following Lombok dependency inside the <dependencies> section: XML <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.18.24</version> <scope>provided</scope> </dependency> Step 3 : Download Lombok Plugin for IntelliJ IDEAGo to File > Settings (or press Ctrl+Alt+S). Navigate to Plugins. Search for Lombo...

How to create a GenAI Talking Avatar ChatBot using Streamlit and Anthropic Claude LLM Model

GenAI Talking Avatar ChatBot   using Streamlit and Anthropic Claude LLM Model GenAI-Talking-Avatar-Chatbot is a web application that allows users to interact with an AI-powered talking chatbot with a static avatar. The chatbot uses AWS Bedrock for generating responses and Google Text-to-Speech (gTTS) for voice output. The backend is built with FastAPI, and the frontend uses Streamlit for the user interface. Features API Backend (api.py) Provides an API endpoint to handle chat requests. Uses AWS Bedrock to generate AI responses in a specified JSON format. Ensures the responses include the message, avatar expression, and voice tone. Includes a health check endpoint to verify the API status. Chat UI (chat_frontend.py) Chat Interface: Provides a chat interface where users can input their queries and receive responses from the AI assistant. Avatar Display: Displays an avatar that changes expressions based on the AI assistant's responses and actions (e.g., thinking, speaking). AI Respons...

How to Implement Infinispan Cache in Spring Boot with Java 21: A Step-by-Step Guide for Efficient Caching

Infinispan Cache in Spring Boot with Java 21 : Let’s learn how to integrate Infinispan cache in your Spring Boot project using Java 21. This post covers adding dependencies, enabling caching, configuring Infinispan, and more to enhance your application’s performance. Step 1: Add Infinispan Dependencies Add the necessary Infinispan dependencies to your pom.xml file. XML <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-cache</artifactId> </dependency> <dependency> <groupId>org.springframework.session</groupId> <artifactId>spring-session-core</artifactId> <version>2.5.4</version> </dependency> <dependency> <groupId>org.infinispan</groupId> <artifactId>infinispan-spring-boot-starter-embedded</artifactId> <version>13.0.0.Final</version> </dependency> For Gradle, add the following dependencies to your build.gradle file: im...