Visual Code - SonarLint - some rules of my sonarqube do not exist on SonarLint

I’m using

Visual Code 1.41.1
SonarLint 1.13.0
sonarqube 6.7.6.38781 (with Sonar PHP 2.15.0.4060)

We verify that some files have more “issues” on sonarqube than on SonarLint, after some tests, seems to me that some rules do not exists on sonarqube.

In my case I already found two PHP rules that only exists on sonarqube

  • Source files should not have any duplicated blocks (/coding_rules#rule_key=common-php%3ADuplicatedBlocks)
  • Track uses of “TODO” tags (/coding_rules#rule_key=php%3AS1135)

Hi @Frederico_Silva_Guim

SonarLint is not computing duplicated code in projects. That’s why rule common-xxx:DuplicatedBlocks is not reported by SonarLint, whatever the language. Computing duplications could be quite expensive on big projects, and requires to analyze the same scope than SonarQube to report the same results. So for now we have decided to focus on static code quality rules.

php:S1135 should work fine:


I have not tested with SonarPHP 2.15 that is more than one year old, so I suggest you try in standalone mode (comment out the connected mode configuration to use the default embedded SonarPHP analyzer) or ask your SonarQube administrator to update the SonarPHP plugin.

1 Like

Hi @Julien_HENRY

The S1135 is show in the code, but with a different mark and it does not appear on “problems view” :frowning:

See the printscreen. The two lines after the TODO appear on “problems view” and have a “yellow line” on the code.

I understood… the “problem” is that S1135 is configured with level Info on Sonarqube…

If I change level to Minor (or a higher level) it appears on “Problems View” and the full line is marked

Indeed, this is how we are mapping severities right now:

This is the first time I notice that Hints are not listed in the problem view. Not sure it has always been the case, or if this is a recent change on VSCode side, but anyway good to know.

I feel it is correct to map issues INFO severity to VSCode Hints, but if you disagree, let us know.

Is there a view where I can view all the “VSCode Hints” of a file?

According to https://github.com/Microsoft/vscode/issues/45436 and https://github.com/microsoft/vscode/issues/44141 I don’t think so.