No problems have been detected in the workspace

  • Operating system: Ubuntu 22
  • SonarLint plugin version: v4.7.0
  • Programming language you’re coding in: python 3.11
  • Is connected mode used:
    • Connected to SonarQube (optional)

I am trying to use SonarLint for Python Django in VS Code. I am unable to see suggestions from SonarLint in Python code in the editor, nor in the ‘Problems’ section of the Output.

In the Output, I am getting:
‘No problems have been detected in the workspace.’

It does not scan the overall code or show anything new in VS Code. This issue still persists whether I use SonarQube or not.

Hey there, welcome to Sonar Community! :wave: :sonar:

Thanks for raising the topic. I would like to clarify a couple of things :blush:

  1. ‘No problems have been detected in the workspace.’ message does not sound like it’s coming from SonarLint. Would you be able to share SonarLint logs? You can find the instructions on how to get them here.
  2. Do you see issues being raised on SonarQube for the same file? What is the rule that is violated? (it should look something like python:Sxxx
  3. It would be ideal if you could share with us an example snippet where you expect to see an issue but don’t.

Thanks in advance,
Sophio :hibiscus:

2 Likes

sonar_output.log (55.5 KB)

When I opened serializers.py, I was able to see the logs, but I was unable to see the problems marked in ‘PROBLEMS’ or in the editor.
I wasn’t able to see SonarQube issues either; it was all empty.

Hello, thanks for the logs :bowing_man:

I see the last log line says

Analysis detected 16 issues and 0 Security Hotspots in 5811ms

It means the analysis was completed successfully, and problems should appear in the editor and in the PROBLEMS tab.

Would you be able to share a screenshot showing that this is not the case? Something that might be happening is either

  • You have applied some filters to the PROBLEMS view that hides SonarLint issues
  • You have enabled SonarLint focus: New Code option and will only be seeing issues on new code. You will be able to check the SonarLint focus value by looking at the VSCode status bar, or going checking the value of the following user setting - sonarlint.focusOnNewCode

Screenshot 2024-08-05 at 09.54.00

Hope that helps,
Sophio :hugs:

1 Like

I have attached a screenshot of the Output and Problems sections, along with the settings.json file from VS Code.
settings.json (3.7 KB)

1 Like

Thanks! That looks strange :eyes:

Would you be able to provide the information about the following?

Thanks :bowing_woman:

1 Like

Usually, I keep SonarQube disconnected. However, I am attaching screenshots and logs after connecting to a self-hosted SonarQube instance.

I can see Pylance problems when I check out to other Git branches, not my usual branch.

I am also attaching output.log after connecting to SonarQube.

Output_with_sonarqube.log (56.2 KB)

Thanks for the details.

As you can see from the image, I am not able to reproduce the issue. I see the analysis result in the editor and in the problems view.

Based on the information you provided, SonarLint analysis detects 18 issues in your file, but the PROBLEMS view is not showing any of them. Could it be that you have tweaked some VSCode settings related to PROBLEMS display? Such as problems.visibility or outline.problems.enabled :woman_shrugging:

Also, we just released SonarLint v4.8 yesterday, maybe updating will help.

Sorry I have not really been able to help :see_no_evil:
Best,
Sophio

1 Like

Hello @Purushottam_Nawale,

It seems that the issue storage SonarLint is using is corrupted. Could you try to close VSCode, remove all the /home/rhythmflow/.sonarlint/known-findings-store-* folders and restart?

1 Like

Thank you very much. it worked.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.