Sonarlint integration with sonarcloud in Visual studio

Team have integrated sonarlint plugin with sonarcloud on various IDEs

1 Eclipse. it is showing errors and warning properly

Below is the problem
2 visual studio> just saying there is 1 or 2 issues but not showing any actual warning or error

3 Visual studio code>> does not show any warning or error

In all ide’s connected to sonarcloud project.
ng further

Do we need to configure something extra for visual studio and visual studio code.

Hi

Can someone please help on this on priority

let me know if any thing else needed


This is a .net project and i cannot see any c# rule. this is analyzed in sonarcloud altthoug

sh “${dotnetPath}/dotnet sonarscanner begin
/o:se1
/k:se1-backend
/d:sonar.host.url=https://sonarcloud.io
sh ‘${dotnetPath}/dotnet build’
sh ‘${dotnetPath}/dotnet sonarscanner end’


[Info - 16:33:59.379] [SYNC] Fetching rule set for language ‘go’ from profile ‘AY2XrrZj6xK3k4004Df4’
[Info - 16:33:59.516] [SYNC] Fetching rule set for language ‘apex’ from profile ‘AY2XrrZj6xK3k4004Dfn’
[Info - 16:33:59.642] [SYNC] Fetching rule set for language ‘azureresourcemanager’ from profile ‘AY2XrrZj6xK3k4004Dfz’
[Info - 16:33:59.722] [SYNC] Fetching rule set for language ‘java’ from profile ‘AY2XrrZj6xK3k4004DgG’
[Info - 16:33:59.766] [SYNC] Fetching rule set for language ‘c’ from profile ‘AY2XrrZj6xK3k4004Df7’
[Info - 16:33:59.918] [SYNC] Fetching rule set for language ‘cloudformation’ from profile ‘AY2XrrZj6xK3k4004Df8’
[Info - 16:34:00.054] [SYNC] Fetching rule set for language ‘cobol’ from profile ‘AY2XrrZj6xK3k4004Dfj’
[Info - 16:34:00.218] [SYNC] Fetching rule set for language ‘cpp’ from profile ‘AY2XrrZj6xK3k4004Dfu’
[Info - 16:34:00.402] [SYNC] Fetching rule set for language ‘cs’ from profile ‘AY2XrrZj6xK3k4004DgH’
[Info - 16:34:00.569] [SYNC] Fetching rule set for language ‘css’ from profile ‘AY2XrrZj6xK3k4004Dft’
[Info - 16:34:00.723] [SYNC] Fetching rule set for language ‘docker’ from profile ‘AY2XrrZj6xK3k4004Dfq’
[Info - 16:34:00.870] [SYNC] Fetching rule set for language ‘go’ from profile ‘AY2XrrZj6xK3k4004Df4’
[Info - 16:34:00.922] [SYNC] Fetching rule set for language ‘js’ from profile ‘AY2XrrZj6xK3k4004DgE’
[Info - 16:34:00.996] [SYNC] Fetching rule set for language ‘java’ from profile ‘AY2XrrZj6xK3k4004DgG’
[Info - 16:34:01.290] [SYNC] Fetching rule set for language ‘json’ from profile ‘AY2XrrZj6xK3k4004Df2’
[Info - 16:34:01.362] [SYNC] Fetching rule set for language ‘js’ from profile ‘AY2XrrZj6xK3k4004DgE’
[Info - 16:34:01.532] [SYNC] Fetching rule set for language ‘json’ from profile ‘AY2XrrZj6xK3k4004Df2’
[Info - 16:34:01.625] [SYNC] Fetching rule set for language ‘kubernetes’ from profile ‘AY2XrrZj6xK3k4004Df_’
[Info - 16:34:01.644] [SYNC] Fetching rule set for language ‘kubernetes’ from profile ‘AY2XrrZj6xK3k4004Df_’
[Info - 16:34:01.778] [SYNC] Fetching rule set for language ‘php’ from profile ‘AY2XrrZj6xK3k4004Df6’
[Info - 16:34:01.963] [SYNC] Fetching rule set for language ‘plsql’ from profile ‘AY2XrrZj6xK3k4004Dfr’
[Info - 16:34:01.987] [SYNC] Fetching rule set for language ‘php’ from profile ‘AY2XrrZj6xK3k4004Df6’
[Info - 16:34:02.130] [SYNC] Fetching rule set for language ‘py’ from profile ‘AY2XrrZj6xK3k4004DgF’
[Info - 16:34:02.307] [SYNC] Fetching rule set for language ‘secrets’ from profile ‘AY2XrrZj6xK3k4004DgC’
[Info - 16:34:02.349] [SYNC] Fetching rule set for language ‘plsql’ from profile ‘AY2XrrZj6xK3k4004Dfr’
[Info - 16:34:02.443] [SYNC] Fetching rule set for language ‘terraform’ from profile ‘AY2XrrZj6xK3k4004Df5’
[Info - 16:34:02.632] [SYNC] Fetching rule set for language ‘ts’ from profile ‘AY2XrrZj6xK3k4004DgB’
[Info - 16:34:02.724] [SYNC] Fetching rule set for language ‘py’ from profile ‘AY2XrrZj6xK3k4004DgF’
[Info - 16:34:02.825] [SYNC] Fetching rule set for language ‘tsql’ from profile ‘AY2XrrZj6xK3k4004Dfv’
[Info - 16:34:02.981] [SYNC] Fetching rule set for language ‘web’ from profile ‘AY2XrrZj6xK3k4004Dfg’
[Info - 16:34:03.117] [SYNC] Fetching rule set for language ‘xml’ from profile ‘AY2XrrZj6xK3k4004Dfk’
[Info - 16:34:03.120] [SYNC] Fetching rule set for language ‘secrets’ from profile ‘AY2XrrZj6xK3k4004DgC’
[Info - 16:34:03.241] [SYNC] Fetching rule set for language ‘yaml’ from profile ‘AY2XrrZj6xK3k4004Df3’
[Info - 16:34:03.379] [SYNC] Synchronizing project branches for project ‘srem_srem-apigee-services’
[Info - 16:34:03.471] [SYNC] Fetching rule set for language ‘terraform’ from profile ‘AY2XrrZj6xK3k4004Df5’
[Info - 16:34:03.811] [SYNC] Fetching rule set for language ‘ts’ from profile ‘AY2XrrZj6xK3k4004DgB’
[Info - 16:34:04.185] [SYNC] Fetching rule set for language ‘tsql’ from profile ‘AY2XrrZj6xK3k4004Dfv’
[Info - 16:34:04.524] [SYNC] Fetching rule set for language ‘web’ from profile ‘AY2XrrZj6xK3k4004Dfg’
[Info - 16:34:04.859] [SYNC] Fetching rule set for language ‘xml’ from profile ‘AY2XrrZj6xK3k4004Dfk’
[Info - 16:34:05.191] [SYNC] Fetching rule set for language ‘yaml’ from profile ‘AY2XrrZj6xK3k4004Df3’
[Info - 16:34:05.524] [SYNC] Synchronizing project branches for project -apigee-services’
[Info - 16:36:30.390] Analyzing file “file:///c:/offc/devops_repo/cres-service/Aqari.DeedText/DeedTextBuilder/Contracts/IDeedTextBuilder.cs”…
[Info - 16:36:30.653] Found 0 issues

Hi,

I invite you to familiarize yourself with the FAQ, in particular the section about being patient.

Regarding your topic, we try to keep it to one topic per thread. Otherwise it can get messy, fast and you started with 3 different questions.

I’d like to ask you to start over with one topic per IDE / SonarLint flavor.

 
Thx,
Ann

Hi

ok , lets start with visual studio

Hi

Just to add

I saw a post where just after installing sonarlint in visual studio it starts showing warning even before binding to the project but for me it not showing anything at all

Let me know what If I am missing some settings that needs to be checked in visual studio

But I am interested to see same warning, errors that are shown in sonarcloud project after binding

Hi,

So you’re using the latest version of SonarLint for Visual Studio.

Can you please explain the problem?

 
Ann

Hi,

The purpose of SonarLint is to show you the issues in the file(s) you’re working in. If you’re looking for a comprehensive list of all issues in your project… that’s not the purpose.

The docs should help.

 
Ann

Hi

Thanks for your reply but as shown in your reply the way there are lots of warning i am not seeing any warning or recommendations from sonarlint een after clicking analyze

[ThreadId 1] Initializing the package...
[ThreadId 1] Finishing initializing the  package
[ThreadId 1] [DEBUG] [NotificationService] notification 'shared.binding.suggestion.for.cres-service' will not be shown: notification has already been displayed.
[SecretsAnalyzer] Analyzing C:\Users\masroora\cres-service\.sonarlint\cres-service.json
[SecretsAnalyzer] Finished analyzing C:\Users\masroora\cres-service\.sonarlint\cres-service.json, analysis time: 0.002s
[SecretsAnalyzer] Found 0 issue(s) for C:\Users\masroora\cres-service\.sonarlint\cres-service.json
[SecretsAnalyzer] Analyzing C:\Users\masroora\cres-service\CRES.Business\Actions\IssueGiftDeed.cs
[SecretsAnalyzer] Finished analyzing C:\Users\masroora\cres-service\CRES.Business\Actions\IssueGiftDeed.cs, analysis time: 0.019s
****[SecretsAnalyzer] Found 0 issue(s) for C:\Users\masroora\cres-****service\CRES.Business\Actions\IssueGiftDeed.cs

Hi,

What kind of project are we dealing with here?

I see the file you’re editing is .cs. How is it built?

 
Ann

It is a .net project

For sonar analysis I built it using dotnet build solutionfile

Hi,

What rules are raising issues on the file in SonarQube?

 
Thx,
Ann

issues are reported in sonarcloud from multiple rules

i tried both by binding project and unbinding also . sonarlint is not showing any error

i right some rubbish code also and still no warning or error in visual studio from sonarlint

This repo which is being analyzed contain 13K lines of code and it is not possible to not have any warning or errors in code

Hi,

Let’s look at DeedTextBuilder.cs. You’ve provided a screenshot that shows it has at least 2 issues in it. What lines are they on? Can you share a screenshot of those same lines in DeedTextBuilder.cs in SonarLint?

 
Thx,
Ann

below image from sonarcloud

below image from visual studio ide “sonarlint”

Hi,

Thanks for the screenshots!

I’ve flagged this for team attention.

 
Ann

Hi @masroora

Firstly, because .Net analysis is run by the Roslyn analysers it’s normal that you wouldn’t see that information in the SonarLint logs. The line in the log shows only info about the secret analyzers.

For the issue you are having;

  • Did you try uninstalling and reinstalling SonarLint? It’s unlikely but let’s rule out any issues during the vsix install.
  • Are you able to see errors and warnings generated by VS?
  • If it’s yes can you send a screenshot of the the errorlist of the file open?

Best,
Uğraş Ergün

Hi @uergun

i have reinstall the sonarlint also but still not see anty warning from sonarlint.

try to write some dummy code also but still no error reported by sonarlint

below is the output from sonarlint

Hi

This is my sonarlint rule settings
image

i have bind the project again and here it is displaying there are bugs and vulnerabilities

but when opening the DeedTextbuilder.cs. it is not showing any warning or issue and even i write dummy code still saying 0 issues found