Questions tagged [sonarlint-intellij]

SonarLint for IntelliJ is an extension that provides on-the-fly feedback to developers on new bugs and quality issues injected into their code.

SonarLint for IntelliJ is an module that provides on-the-fly feedback to developers on new bugs and quality issues injected into their code.

More can be found at http://www.sonarlint.org/intellij/index.html

© 2008-2015, SonarSource S.A, Switzerland

61 questions
76
votes
2 answers

How to suppress warning for a specific method with Intellij SonarLint plugin

I want to suppress the Sonar lint plugin warning for some methods. This question is not what I want Intellij SonarLint 2.3 - ignore rule. Currently I have to annotate the method with @SuppressWarnings("all"),which suppresses all warnings.
aristotll
  • 8,694
  • 6
  • 33
  • 53
44
votes
4 answers

How to turn off SonarLint automatic triggering on IntelliJ IDEA

Is there some way of turning-off automatic SonarLint analysis in Intellij IDEA? I have some 10,000 to 20,000 lines-of-code classes (don't ask, not my fault, trying to refactor). Every time I edit even a single character in the class, the SonarLint…
Derek Bennett
  • 807
  • 1
  • 7
  • 14
8
votes
1 answer

How does one mark issues as false positives in SonarLint?

I'm experimenting with SonarLint for IntelliJ, but I'm a bit wary of it. It doesn't seem to be offering anything more than IntelliJ already does, and there's no way to even look at what rules it is offering, let alone change them. Now, maybe it does…
7
votes
1 answer

Sonarlint complains about license header in my source file

Here is my license header in the source code: package org.osgl.ut; /*- * #%L * Java Unit Test Tool * %% * Copyright (C) 2017 OSGL (Open Source General Library) * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may…
Gelin Luo
  • 14,035
  • 27
  • 86
  • 139
7
votes
1 answer

Intellij SonarLint 2.3 - ignore rule

I've just updated SonarLint plugin for Intellij Idea to version 2.3.2. Changelog says that since version 2.3 rule exclusion in connected mode should be available. Below is my configuration, seems to be corrected, yet, ignored rule still pops up.
Piotr
  • 671
  • 6
  • 17
6
votes
0 answers

How to solve provide parameterized type for this generic in SonarLint

I am trying to refactor my code using the IntelliJ idea extension called sonarLint. In there, sonarLint suggests further modification like this picture below(I have marked the issue in red) SonarLint error alert here is my code public class…
hansika
  • 79
  • 1
  • 6
6
votes
2 answers

How to disable todo warnings in sonarlint plugin for IntelliJ?

The SonarLint plugin for Intellij gives warnings for TODOs as well. By default Intellij highlights TODOs and displays them in a Commit Dialog as well. SonarLint highlighting it again is redundant. Also, it suppresses one useful feature of Intellij -…
5
votes
2 answers

how to handle Sonarlint java:S2259 (Null pointers should not be dereferenced)

if (res.getBody() == null || res.getBody().getServiceResult() == null) { return; // } in above code, sonarlint complains that SonarLint: A "NullPointerException" could be thrown; "getBody()" can return null. (from res.getBody().getServiceResult()…
DKWoo
  • 327
  • 5
  • 17
5
votes
0 answers

Using == instead of equals in String comparison not getting caught by Sonar

I have below code : String s1 = "a"; String s2 = "a"; if (s1 == s2) { System.out.println("string not equal"); } When I analyze this code using SonarLint it doesnt get caught by it. I expect this should get caught by below Rule…
Rips
  • 1,964
  • 1
  • 23
  • 45
5
votes
0 answers

How to analyse Testcases from src/test/java folder using sonarlint in intellij

How to use sonarlint for analyzing testcases? I have found similar thing in sonar cube sonar.test.inclusions as property but couldn't find anything similar in sonarlint > intellij. Folder I need to analyse: src/test/java Work around: Renaming test…
Diptman
  • 374
  • 3
  • 14
5
votes
0 answers

sonar doesn't take into account annotation @Contract

if we have code: @Contract("null, _, _ -> fail") static void ifNull(Object object, ErrorType errorType, Object... args) throws ServiceException { if (object == null) { ExceptionFactory.throwServiceException(errorType, args); } } and…
4
votes
2 answers

Sonarlint not processing files due to analysis errors

I am getting the following error when trying to process files in SonarLint "File won't be refreshed because there were errors during analysis:" Unfortunately SonarLint does not report which errors it is encountering. I set sonar.log.level to…
4
votes
1 answer

How to integrate SonarLint with Intellij

I am trying to run Solar Lint with Intellij, when I configure the SonarQube server in the plug-in and "Test Connection" I keep getting the following error message: The following plugins do not meet the required minimum versions, please upgrade…
Nick Div
  • 5,338
  • 12
  • 65
  • 127
4
votes
1 answer

How do I analyze Groovy code with Sonarlint for IntelliJ?

The Sonarlint plugin for IntelliJ does analysis on our Java code, but it won't analyze Groovy code in the same project. We have a Grails project which works with sonar-runner on the command line. When I install the IntelliJ IDEA Sonarlint plugin,…
RMorrisey
  • 7,637
  • 9
  • 53
  • 71
4
votes
0 answers

SonarLint sonar.issue.ignore.multicriteria does not work

I configured our project in SonarQube to ignore the rule squid:S00103. It works fine, but the SonarLint 2.0 for IntelliJ, configured with our server does not use this exclusion. So i wanted to add the exclusion manually in the plugin properties, but…
1
2 3 4 5