简体   繁体   中英

SonarLint 2.2.1 Eclipse not catching a majority of issues (unlike examples online)

I want to use the SonarLint plugin for Eclipse. I installed it, but it doesn't seem to be catching everything it should. After installing it, I tried to write code that should trigger SonarLint issues. For example, the picture on the site http://www.sonarlint.org/eclipse/ , indicates that SonarLint should complain when I use == to compare floats because "Equality Tests should not be made with floating point numbers". However, on my side, I do not get this message. Normally I would think that SonarLint wasn't installed correctly, but it does complain about the class, saying to "Add some tests to this class." so it seems to exist. This is the only message the SonarLint gives me.

Here is a picture of what my Eclipse looks like. I have included multiple issues that should trigger a SonarLint message but almost all of them do not. Is there some setting or issue that needs to be changed that I haven't set yet?

Picture of my Eclipse

I have Eclipse Neon running Java 8 and I installed SonarLint version 2.2. I am planning on using SonarLint in the "Standalone" mode rather than the "Connected" mode which I believe means that I do not need to set up anything after installing the plugin on Eclipse.

Thanks in advance for your help

Figured it out. For some reason, because I named my Java Project "Test", I think it assumed that the project was filled with Unit Tests based on JUnit class naming conventions. When I made a project with a different name, SonarLint worked as expected.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM