Open GHGHGHKO opened 1 year ago
Hi,
Welcome to the community!
It looks like SonarLint 6.8 has some age on it at this point. Could you upgrade to the current version, 7.2.1.58118, and see if this is replicable?
Thx, Ann
Hi, G Ann Campbell!
Thank you for your reply
Updated from version 6.8 to version 7.2.1.58118
See this issue is replicated
Is it because didn’t return a variable?
Hi,
Thanks for trying with the updated version. Unfortunately, I can’t answer your question, so I’ve flagged this for more expert eyes.
Ann
Hi, Thanks for trying with the updated version. Unfortunately, I can’t answer your question, so I’ve flagged this for more expert eyes. Ann
Margarita Nedzelska SonarSourcer 6d Hello @GHGHGHKO,
Thanks for your report. I was able to reproduce this issue when analyzing the single file. However, when I analyze the whole project, this issue disappears. This means that the problem is that SonarLint wasn’t able to locate the .class files of your project correctly. And without semantics, the analyzer is not able to resolve variables, types, and bindings correctly, which leads to the incorrect result.
For now, I can suggest you build your project with Gradle (either from the IDE or command line), make sure that the build folder is generated, and then run the analysis. The issue should disappear.
Meanwhile, I created a ticket to not report FPs in case of incomplete semantics:
https://sonarsource.atlassian.net/browse/SONARKT-269 2
Kind regards, Margarita
user variable is
Unused local variables should be removed
https://community.sonarsource.com/t/unused-local-variables-should-be-removed-is-broken/78750