Skip to content

Getting Started Installation

kevin-hinz edited this page Oct 21, 2022 · 12 revisions

Page Item: Installation SLUG: getting-started-installation

Select the tab (collapsable box) below corresponding to your IDE:

collapse

Eclipse

PLACE ECLIPSE CONTENT HERE TO ENTERED INTO THE KONTENT.AI-SPECIFIC ASSET

collapse

IntelliJ

PLACE INTELLIJ CONTENT HERE TO ENTERED INTO THE KONTENT.AI-SPECIFIC ASSET

You can install SonarLint from the JetBrains Plugin Repository, directly available in the IDE preferences.

Node.js >= 8.x is required to perform JavaScript or TypeScript analysis.

Search the marketplace from the IntelliJ IDE.

Go to File > Settings:

File Settings

Then select the Plugins > Marketplace tab:

Install SonarLint

Then click OK and restart the IDE to finalize the installation.

You can now enjoy SonarLint!

First taste of SonarLint

Let's analyze a first source file and see what SonarLint can bring.

Copy paste this Java code snippet in a project. It contains a code smell because of duplicated methods:

package org.mycompany;

class MyClass {
  private static final String CODE = "XXX";

  public String calculateCode() {
    doTheThing();
    return CODE;
  }

  public String getName() {
    doTheThing();
    return CODE;
  }

  private void doTheThing() {
    // do it
  }
}

If you open this Java file within the editor, you should see SonarLint reporting the issue by highlighting the text range.

You can hover on the highlight to get a short description of the issue.

If you want to read a more detailed explanation of the issue, we provide context actions. One of them will open the detailed rule description.

collapse

Visual Studio

PLACE VISUAL STUDIO CONTENT HERE TO ENTERED INTO THE KONTENT.AI-SPECIFIC ASSET

collapse

Visual Studio Code

PLACE VISUAL STUDIO CONTENT HERE TO ENTERED INTO THE KONTENT.AI-SPECIFIC ASSET

Clone this wiki locally