Installation
The steps you need to install SonarQube for IntelliJ in your IDE.
For the most part, SonarQube for IDE can be installed directly from your IDE’s Marketplace. Offline installations are also possible and previous versions are available if needed.
Instructions
Installation is usually completed via the IDE, directly from the JetBrains Marketplace. In IntelliJ, go to Settings > Plugins; search for SonarQube for IDE
in the Marketplace tab. Select Install. When complete, you must select Restart IDE and confirm the Restart to activate the new plugin.
If SonarQube for IDE does not appear in the Marketplace when searching from within the IDE, it means that your IDE is not supported.
First taste of SonarQube for IDE
Now that you have SonarQube for IDE installed, open or create a new project containing source files in a programming language SonarQube for IDE can analyze out of the box. See the Rules and languages page for languages that work with your IDE.
Then check out the Investigating issues page for details about how to recognize issues found in your code.
JetBrains flavor: IntelliJ IDEA
Language: Java
import java.util.ArrayList;
import java.util.List;
public class Main {
public static void main(String[] args) {
List<String> texts = new ArrayList<String>();
if (texts != null) {
texts.add("Hello World!");
}
}
}
This code sample should raise two issues:
Remove this expression which always evaluates to "true"
It has three secondary locations explaining the flows
Replace the type specification in this constructor call with the diamond operator ("<>")
It has a quick fix
Rider
There are specific requirements for Rider which are documented inside the SonarQube for IDE in Rider expandable on the Scan my project page.
Last updated
Was this helpful?