Unable to get problems in C language after binding SonarLint with SonarQube in VS Coed

Please provide

  • Operating system: Ubuntu 16.04.7 LTS
  • SonarLint plugin version: v 3.6.0
  • Is connected mode used:
    • Connected to SonarCloud or SonarQube (and which version): SonarQube Enterprise version 8.9.8

And a thorough description of the problem / question:

Hi All, Need help please.

We are using VS code IDE having source code in C language. Below are steps followed to bind sonar lint with sonarqube:

  1. Added sonarlint from extensions.

  2. Created Commands.JSON file and below is the syntax of the script:
    [
    { “directory”: ",
    “command”: “”,
    “file”: “”
    }
    ]

  3. Here is settings.JSON file properties used:

{
    "workbench.colorTheme": "Default Light+",
    "sonarlint.ls.javaHome": "" ,
    "sonarlint.pathToCompileCommands": "",
    "sonarlint.output.showVerboseLogs": true,
    "sonarlint.output.showAnalyzerLogs": true,
    "sonarlint.connectedMode.connections.sonarqube": [

    {
        "serverUrl": ,
        "token": 
    }
    ],
    "sonarlint.connectedMode.project": {
        
        "projectKey": 
        
        }
   }

Finally, after analyzing the data, I am getting 1 compilation unit analyzed along with file is indexed, but unable to see any sonarlint issues in problems. This is happening when custom quality profile is used and bind to sonarQube.

The issues identified in sonarqube are not technically visible in VS code when custom quality profile is used.

Hello @Sai_Karthik and welcome to the Sonar community!

Would you be able to provide SonarLint Output logs? Here are the instructions on how to do it.

Also, starting from the SonarLint for VSCode v3.6, you should be able to see status of the SonarQube connection under SONARLINT CONNECTED MODE tab in the VSCode explorer view. Could you check that connection is successful?

Thanks :slight_smile:

LogFile.txt (44.9 KB)

Thanks for quick reply Sophio.
Attaching the SonarLint output logs. When you see the output in the logs, the compilation unit is analyzed but not finding any issue. Please let me know in case if you find any solution.

Hi Sophio ,

Did you get chance go through logs. Any help would be much appreciated.

Hello @Sai_Karthik, were you able to resolve this issue?
I am also facing same issuer, in my case blockers are not reported by sonarlint on vscode ide for c cpp code.

@sophio.japharidze request you to please share any help on this context.

Hello again and sorry for the delay.

@Sai_Karthik, at the end of the logs provided by you I can see:

[Debug - 22:32:53.567] GET 401 xxxxxxx | response time=146ms
[Debug - 22:32:53.567] Failed to get notifications: 401, 

I think this means that the connection is not really successful, maybe the token is not provided, could you please double-check?

@rocky , thanks for reporting the problem as well. Could you also double-check your connection status? This can be done in the SONARLINT CONNECTED MODE view in the VSCode explorer.

If all is good there, please also provide logs on your side.

Thanks!