sonar-openedge icon indicating copy to clipboard operation
sonar-openedge copied to clipboard

Sonarlint shows different issues based on scroll position.

Open movedoa opened this issue 2 years ago • 5 comments

This is a 13k lines class.

When im at the beginning of the file, sonarlint reports 7 issues. grafik

Then i scroll to the end of the file and save again, now sonarlint shows 17 issues. grafik

Server side analysis shows 19 bugs and 18 code smells for this file.

movedoa avatar Sep 30 '22 11:09 movedoa

SonarLint version and PDSOE version ?

gquerret avatar Oct 01 '22 12:10 gquerret

SonarLint version and PDSOE version ?

Latest SonarLint with OE 12.2.10...

...did the update to OE HF 10 maybe overwrite the plugin with an older version?

movedoa avatar Oct 01 '22 16:10 movedoa

Plugin is current but i missed exceptions in the log the other day. The exception only shows up in the eclipse console when i have "Analysis Log" checked, not sure if that is expected.

Edit: No exceptions in the server analysis, this only happens in SonarLint

OpenEdge plugin version: 2.17.0-853027c5
...
Injecting type info 'Type info Doc.DocUtils - Parent Progress.Lang.Object'
Error during rule execution for [uri=file:/C:/Entwicklung/OE12/Workspace122/B5310/App/Prog/Src/Doc/DocUtils.cls]
java.lang.NullPointerException
	at eu.rssw.antlr.proparse.checks.VariableOverflow.execute(SourceFile:2073)
	at org.sonar.plugins.openedge.api.checks.OpenEdgeProparseCheck.sensorExecute(OpenEdgeProparseCheck.java:57)
	at org.sonar.plugins.openedge.sensor.OpenEdgeProparseSensor.parseMainFile(OpenEdgeProparseSensor.java:401)
	at org.sonar.plugins.openedge.sensor.OpenEdgeProparseSensor.execute(OpenEdgeProparseSensor.java:176)
	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:133)
	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:77)
	at org.sonarsource.sonarlint.core.container.storage.StorageContainerHandler.analyze(StorageContainerHandler.java:80)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.lambda$analyze$0(ConnectedSonarLintEngineImpl.java:159)
	at org.sonarsource.sonarlint.core.AbstractSonarLintEngine.withModule(AbstractSonarLintEngine.java:87)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.lambda$analyze$1(ConnectedSonarLintEngineImpl.java:157)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:371)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:361)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.analyze(ConnectedSonarLintEngineImpl.java:155)
	at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.lambda$15(ConnectedEngineFacade.java:392)
	at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.withEngine(ConnectedEngineFacade.java:185)
	at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.runAnalysis(ConnectedEngineFacade.java:391)
	at org.sonarlint.eclipse.core.internal.jobs.AnalyzeConnectedProjectJob.runAnalysis(AnalyzeConnectedProjectJob.java:70)
	at org.sonarlint.eclipse.core.internal.jobs.AnalyzeConnectedProjectJob.runAnalysis(AnalyzeConnectedProjectJob.java:1)
	at org.sonarlint.eclipse.core.internal.jobs.AbstractAnalyzeProjectJob.run(AbstractAnalyzeProjectJob.java:404)
	at org.sonarlint.eclipse.core.internal.jobs.AbstractAnalyzeProjectJob.runAnalysisAndUpdateMarkers(AbstractAnalyzeProjectJob.java:208)
	at org.sonarlint.eclipse.core.internal.jobs.AbstractAnalyzeProjectJob.doRun(AbstractAnalyzeProjectJob.java:162)
	at org.sonarlint.eclipse.core.internal.jobs.AbstractSonarProjectJob.run(AbstractSonarProjectJob.java:45)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

movedoa avatar Oct 03 '22 10:10 movedoa

...did the update to OE HF 10 maybe overwrite the plugin with an older version?

No, that shouldn't.

Edit: No exceptions in the server analysis, this only happens in SonarLint

NPE in rules are always unexpected ; I will have a look

gquerret avatar Oct 03 '22 18:10 gquerret

Just to be clear, what i mean by unexpected is that the exception doesnt show up by default in the console.

movedoa avatar Oct 04 '22 17:10 movedoa

FYI this is still reproducible in SonarLint with plugin version 2.18.1 and OpenEdge 12.2.11. Exception only shows up in the console when "Analysis logs" is enabled.

movedoa avatar Nov 23 '22 11:11 movedoa

Unfortunately, the stack trace is not very useful in this case, but I think I've found the potential NullPointerException in this rule. Could you try this hotfix ? No need to update the main plugin on the server side, and make sure you refresh the bindings in SonarLint after server restart.

gquerret avatar Nov 24 '22 06:11 gquerret

Exception is gone with the Hotfix and i see most of the issues now. The only ones missing are ones with "No TypeInfo found" but thats a different issue. Thx for the fix

movedoa avatar Nov 25 '22 10:11 movedoa

Hotfix will be backported in the develop branch. You can continue using the JAR file without any issue.

gquerret avatar Nov 25 '22 11:11 gquerret