Integrating Sonarling Plugin with Intellij

Hi,
I’m trying to use your Sonarlint Plugin on my intellij IDE
Versions:
Intellij: 2020.2.1
Sonarlint Plugin: 4.9.0

After setting up the configurations, when pressing Analyze With Sonarlint I’m constantly getting the response of “No issues found”
although I can assure that the code contains frames which is incompatible with my pre-configured rules.

Hello Shira,

Thanks for joining the community and for raising this issue!

Do you use the connected mode ?

Could you please provide here the logs displayed by SonarLint ? You need to open the SonarLint tool window at the bottom, open the Log tab, and check the ‘Analysis logs’ and ‘Verbose output’ options as described in the FAQ in the IntelliJ section.

We will be able to answer more precisely with those logs.
Thanks
Damien

I’m not sure the meaning of connected mode but I did find a disturbing input on the Sonarlint log window:

Java Main Files AST scan
5 source files to be analyzed
Unable to create symbol table for : C:\dev\git\...\...\...\....nessStructureServiceImpl.java

Java Main Files AST scan (done) | time=3ms
Java Test Files AST scan
0 source files to be analyzed
2/2 source files have been analyzed
0/0 source files have been analyzed
Java Test Files AST scan (done) | time=3ms
Execute Sensor: SonarJavaXmlFileSensor
Done in 103ms

Processed 0 issues in 3 ms
Found 0 issues

Hello Shira,

In your first message I missed the fact that you use a pretty old version of the SonarLint plugin (we are now at 4.12.1). Could you try to update the plugin through the marketplace and see if this fixes the issue ? If not could you please provide the logs again ? Don’t hesitate to provide them all.

FYI connected mode is when you configure your local project to be bound to a project on SonarQube/SonarCloud. That would let SonarLint re-use the analyzers and rules configured on the server-side.

Looking forward to get your feedback,
Damien

Hi,
So I did updated my Sonarlint and its current version is 4.12.1.22375
The issue isn’t solved and log response is identical to the one before.
Attaching again

 Trigger: ACTION
[Action] 1 file(s) submitted
Configuring analysis with org.sonarlint.intellij.analysis.JavaAnalysisConfigurator
Using connection 'xxx-sonar' for project 'xxx'
Analysing 'xxxxl.java'...
Starting analysis with configuration:
[
  .......
.....
  ]
]

Start analysis
Index files
Language of file 'xxx' is detected to be 'Java'
1 file indexed
Available languages:
  * Java => "java"
Quality profiles:
  * java: 'xxx' (380 rules)
Execute Sensor: JavaSquidSensor
Configured Java source version (sonar.java.source): 8
JavaClasspath initialization
JavaClasspath initialization (done) | time=6ms
JavaTestClasspath initialization
JavaTestClasspath initialization (done) | time=6ms
----- Classpath analyzed by Squid:
...
....
....

----- Classpath analyzed by Squid:
...
...
...
..
-----
Java Main Files AST scan
1 source files to be analyzed
Unable to create symbol table for :xxx.java
java.lang.IllegalArgumentException
	at org.objectweb.asm.ClassReader.<init>(ClassReader.java:160)
	at org.objectweb.asm.ClassReader.<init>(ClassReader.java:143)
	at org.sonar.java.resolve.BytecodeCompleter.loadClass(BytecodeCompleter.java:204)
	at org.sonar.java.resolve.Symbols.<init>(Symbols.java:176)
	at org.sonar.java.resolve.SemanticModel.createFor(SemanticModel.java:59)
	at org.sonar.java.model.VisitorsBridge.visitFile(VisitorsBridge.java:110)
	at org.sonar.java.ast.JavaAstScanner.simpleScan(JavaAstScanner.java:96)
	at org.sonar.java.ast.JavaAstScanner.scan(JavaAstScanner.java:68)
	at org.sonar.java.JavaSquid.scanSources(JavaSquid.java:120)
	at org.sonar.java.JavaSquid.scan(JavaSquid.java:114)
	at org.sonar.plugins.java.JavaSquidSensor.execute(JavaSquidSensor.java:91)
	at org.sonarsource.sonarlint.core.analyzer.sensor.SensorsExecutor.executeSensor(SensorsExecutor.java:80)
	at org.sonarsource.sonarlint.core.analyzer.sensor.SensorsExecutor.execute(SensorsExecutor.java:71)
	at org.sonarsource.sonarlint.core.container.analysis.AnalysisContainer.doAfterStart(AnalysisContainer.java:132)
	at org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:126)
	at org.sonarsource.sonarlint.core.container.ComponentContainer.execute(ComponentContainer.java:111)
	at org.sonarsource.sonarlint.core.container.storage.StorageAnalyzer.analyze(StorageAnalyzer.java:75)
	at org.sonarsource.sonarlint.core.container.storage.StorageContainerHandler.analyze(StorageContainerHandler.java:85)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.lambda$analyze$0(ConnectedSonarLintEngineImpl.java:152)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:349)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:339)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.analyze(ConnectedSonarLintEngineImpl.java:149)
	at org.sonarlint.intellij.core.ConnectedSonarLintFacade.analyze(ConnectedSonarLintFacade.java:73)
	at org.sonarlint.intellij.core.SonarLintFacade.startAnalysis(SonarLintFacade.java:62)
	at org.sonarlint.intellij.analysis.SonarLintAnalyzer.analyzeModule(SonarLintAnalyzer.java:88)
	at org.sonarlint.intellij.analysis.SonarLintTask.analyze(SonarLintTask.java:187)
	at org.sonarlint.intellij.analysis.SonarLintTask.run(SonarLintTask.java:103)
	at org.sonarlint.intellij.analysis.SonarLintUserTask.run(SonarLintUserTask.java:38)
	at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:935)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsync$5(CoreProgressManager.java:442)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:235)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:170)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:629)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:581)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:157)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:235)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
	at java.base/java.lang.Thread.run(Thread.java:834)

Java Main Files AST scan (done) | time=7ms
Java Test Files AST scan
1/1 source files have been analyzed
0 source files to be analyzed
0/0 source files have been analyzed
Java Test Files AST scan (done) | time=2ms
Execute Sensor: SonarJavaXmlFileSensor
Done in 85ms

Processed 0 issues in 0 ms
Found 0 issues

Hi,

Since you are using connected mode, the Java analyzer used by SonarLint is the one from your SonarQube server.
Please ensure you have updated the binding:

Then look in SonarLint logs tab, click on the “info” button to get the version of the Java analyzer:


(in my example it is 6.8.0.23379)

If the Java analyzer is too old on your SonarQube server, then you’ll have to ask your administration team to upgrade it (which may also require to upgrade SonarQube).