Rules severities in SonarLint connected mode are not well synchronized

Please provide

  • Operating system: Apple MAC M1
  • SonarLint plugin version: Eclipse Version 2024-06 (4.32.0) with Sonarlint 10.2
  • Programming language you’re coding in: Java
  • Is connected mode used:
    • Connected to SonarCloud or SonarQube (and which version): 9.9.5 Community

Dear all,
I have been experimenting two issues with Sonarlint using the connected mode.
The first problem is that severities of the rules are not correctly synchronized. In the log I observe that the binding is correct, rules are retrieved from the profile and everything seems ok, but when I check an issue, the severity is different than the configured in the profile, and when I try to open a rule description, the same situation occurs, the rule description shows the default severity nor the one from the profile.
An issue detected in SonarQube (Critical)


An issue detected in SonarLint (Major)

The rule shown in Eclipse in the Sonarlint tab (Major)

Find next some logs about rule synchronization:

GET 200 http://XXXXXXXX:9000/sonar/api/qualityprofiles/search.protobuf?project=YYYYY l | response time=117ms
Downloaded project quality profiles in 123ms
[SYNC] Active rules for 'css' are up-to-date
[SYNC] Active rules for 'java' are up-to-date
...
  * java: 528 active rules
Rule java:S2077 is enabled on the server, but not available in SonarLint
Rule java:S2092 is enabled on the server, but not available in SonarLint
Rule java:S5122 is enabled on the server, but not available in SonarLint
Rule java:S6263 is enabled on the server, but not available in SonarLint
Rule java:S5247 is enabled on the server, but not available in SonarLint

And the request of a rule
GET 200 http://xxxxxx:9000/sonar/api/rules/show.protobuf?key=java:S1244 | response time=83ms

I have been checking the community for similar posts, and I found one from 2020 that reported the same problem and a ticket was created, that is closed now. Do you know it that was that finally solved or was it discarded? SonarLint connected mode doesn't update rules severity in VSCode [SLVSCODE-36] - Jira
The post is about vscode, and despite I reported the issue with eclipse, I have been able to reproduce the same situation in visual studio code version 4.6.0.

The second problem is also regarding synchronization, but this time about the number of detected issues. As we can see in the previous images, only one issue was detected of the rule S1244, but in SonarQube 3 evidences were found of that issue:

Next the logs regarding issue synchronization

[SYNC] Synchronizing issues for project 'YYYYY' on branch 'master'
GET 200 http://xxxxx:9000/sonar/api/components/tree.protobuf?qualifiers=FIL,UTS&component= YYYYY&ps=500&p=1 | response time=1633ms
Page downloaded in 1655ms
GET 200 http://xxxxx:9000/sonar/api/components/tree.protobuf?qualifiers=FIL,UTS&component= YYYYY&ps=500&p=2 | response time=1948ms
Page downloaded in 1959ms
GET 200 http://xxxxx:9000/sonar/api/components/tree.protobuf?qualifiers=FIL,UTS&component= YYYYY&ps=500&p=3 | response time=2078ms
Page downloaded in 2083ms
GET 200 http://xxxxx:9000/sonar/api/components/tree.protobuf?qualifiers=FIL,UTS&component= YYYYY&ps=500&p=4 | response time=2254ms
Page downloaded in 2259ms
....
GET 200 http://xxxxx:9000/sonar/api/components/tree.protobuf?qualifiers=FIL,UTS&component= YYYYY&ps=500&p=13 | response time=932ms
Page downloaded in 935ms

1 source file to be analyzed
1/1 source file has been analyzed
Analysis detected 58 issues and 0 Security Hotspots in 6991ms
Found 58 issue(s)

Thank you in advanced, and sorry for the large post :frowning:

1 Like

Hi @mvillanueva ,

Thank you for reporting the issue and providing a detailed description.

I’m able to reproduce the issue with Eclipse and with other IDEs supporting SonarLint as well.

I’ve created a ticket (SLCORE-879) on our side, and we aim to have it fixed in the next release.

Cheers,

Vojech

PS: a new version of SonarLint for Eclipse (10.3.0.82013) was released 5 days ago