SonarQube version 8.5 analyzing Java with SonarWay quality profile
Spring Tool Suite 3.9.5.RELEASE based on Eclipse Photon 4.8.0
SonarLint for Eclipse 22.214.171.12452
I have noticed some discrepancies between SonarLint and SonarQube. Sometimes an issue shows up in SonarLint and not in SonarQube. SonarLint gets its rules from our SonarQube server.
An example is
final HashMap<BankAccountType, AccountType> map = new HashMap<>(); where
BankAccountType is an
enum. SonarLint invokes rule S1640, Maps with keys that are enum values should be replaced with EnumMap. But SonarQube does not point it out. The rule is active in SonarQube’s SonarWay rule set.
SonarLint shows many-many issues that SonarQube does not, from Critical down to Info.
None of the code is using
@SuppressWarnings to cancel a rule. Some issues (but certainly not all) have been resolved as “false positive” or “won’t fix” in SQ, and this info has not made it into SonarLint.
Does anyone have suggestions for where I should look? Is there some SQ setting that I don’t know about? Is this an “old code” vs. “new code” issue? The project is legacy code that’s been around since before we started using SonarQube.