# Rider not showing CodeSmells

**URL:** <https://community.sonarsource.com/t/rider-not-showing-codesmells/55252>\
**Category:** IntelliJ Platform\
**Tags:** rider, intellij, sonarqube-ide\
**Created:** [December 18, 2021, 7:42pm UTC](https://community.sonarsource.com/t/rider-not-showing-codesmells/55252 "2021-12-18T19:42:55Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheRealLenon](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/thereallenon/32/28610_2.png) [@TheRealLenon](https://community.sonarsource.com/u/TheRealLenon)\
**Post date:** [December 18, 2021, 7:42pm UTC](https://community.sonarsource.com/t/rider-not-showing-codesmells/55252/1 "2021-12-18T19:42:56Z")

</div>

When using SonarLint with rider, i don´t get displayed any issues.

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/3/f/3f239176159c5812f8879d222beff475652e76d6.png)

But when pushing it to SonarCloud i get some displayed:

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/a/c/ac919ebeb2d03fc8f1b4b7bd09d76ca6d6f3c95b.png)

The Project is linked to the Qube:

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/2/0/2054c10a4bc8f08d888c14fe8c42346bdbfabb22.png)

Is this a known Issue using Rider/SonarLint on a Mac?

---

<div class="post-metadata">

**Author:** ![TheRealLenon](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/thereallenon/32/28610_2.png) [@TheRealLenon](https://community.sonarsource.com/u/TheRealLenon)\
**Post date:** [December 19, 2021, 9:09pm UTC](https://community.sonarsource.com/t/rider-not-showing-codesmells/55252/2 "2021-12-19T21:09:59Z")

</div>

After checking with windows (where VS will show the smells) i suppose this is a bug.

The same behaviour is seen on rider, when even not using the qube binding.

@Julien_HENRY sorry for tagging, but i cant adjust the tags anymore.

---

<div class="post-metadata">

**Author:** ![Damien\_Urruty](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/damien_urruty/32/43383_2.png) [@Damien\_Urruty](https://community.sonarsource.com/u/Damien_Urruty)\
**Post date:** [December 20, 2021, 7:57am UTC](https://community.sonarsource.com/t/rider-not-showing-codesmells/55252/3 "2021-12-20T07:57:27Z")

</div>

Hello @TheRealLenon,

Welcome to the community and thanks for this feedback.

What language are you trying to analyze ? Is it C# ? Could you show us some issues that you expect to be found in SonarLint ?

Also could you send us here the output of the Log view with verbose logs activated ? See [here](https://github.com/SonarSource/sonarlint-intellij/wiki/Troubleshooting#how-to-get-sonarlint-for-intellij-logs) how to enable them. This will help us understand what is happening.

Thanks  
Damien

---

<div class="post-metadata">

**Author:** ![TheRealLenon](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/thereallenon/32/28610_2.png) [@TheRealLenon](https://community.sonarsource.com/u/TheRealLenon)\
**Post date:** [December 20, 2021, 8:42am UTC](https://community.sonarsource.com/t/rider-not-showing-codesmells/55252/4 "2021-12-20T08:42:52Z")

</div>

The expected Issues should be

> Parameter validation in “async”/“await” methods should be wrapped  
> This is shown in VS2022 & Sonarcloud.

[HERE](https://gist.github.com/TheRealLenon/be877f4e30d32a45457ff20d6d832de7) you can see the full log Rider creates.

PS: When activating all rules, i get some rules displayed but still not all.

---

<div class="post-metadata">

**Author:** ![Damien\_Urruty](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/damien_urruty/32/43383_2.png) [@Damien\_Urruty](https://community.sonarsource.com/u/Damien_Urruty)\
**Post date:** [December 20, 2021, 11:37am UTC](https://community.sonarsource.com/t/rider-not-showing-codesmells/55252/5 "2021-12-20T11:37:37Z")

</div>

I see a few interesting traces:

> 1779: Couldn’t get a connected engine to check for update: Project is not bound to a SonarQube project

Could you check if your project is properly configured ? If you trigger a manual update from the settings, it should work without errors.

> 1780: Omnisharp: [ERROR] Failure while loading the analyzer reference ‘Microsoft.Extensions.Logging.Generators’: Could not load file or assembly ‘Microsoft.CodeAnalysis, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies.

There are a few similar error, in some cases this could cause issues not to be raised.

> Omnisharp: [DEBUG] Attempting to resolve ‘SonarAnalyzer.CSharp.resources, Version=8.26.0.0, Culture=en-US, PublicKeyToken=c5b62af9de6d7244’  
> Omnisharp: [DEBUG] FAILURE: Could not locate ‘/Users/pko/Library/Application Support/JetBrains/Toolbox/apps/Rider/ch-0/213.5744.299/Rider.app.plugins/sonarlint-intellij/omnisharp/osx/omnisharp/.msbuild/Current/Bin/SonarAnalyzer.CSharp.resources.dll’.  
> Omnisharp: [INFORMATION] Solution initialized → queue all documents for code analysis. Initial document count: 15.  
> Omnisharp: [DEBUG] Attempting to resolve ‘Microsoft.CodeAnalysis.NetAnalyzers, Version=6.0.5.1905, Culture=neutral, PublicKeyToken=31bf3856ad364e35’  
> Omnisharp: [DEBUG] FAILURE: Could not locate ‘/Users/pko/Library/Application Support/JetBrains/Toolbox/apps/Rider/ch-0/213.5744.299/Rider.app.plugins/sonarlint-intellij/omnisharp/osx/omnisharp/.msbuild/Current/Bin/Microsoft.CodeAnalysis.NetAnalyzers.dll’.  
> Omnisharp: [DEBUG] Attempting to resolve ‘Microsoft.CodeAnalysis, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’  
> Omnisharp: [DEBUG] FAILURE: Could not locate ‘/Users/pko/Library/Application Support/JetBrains/Toolbox/apps/Rider/ch-0/213.5744.299/Rider.app.plugins/sonarlint-intellij/omnisharp/osx/omnisharp/.msbuild/Current/Bin/Microsoft.CodeAnalysis.dll’.  
> Omnisharp: [ERROR] Failure while loading the analyzer reference ‘Microsoft.Extensions.Logging.Generators’: Could not load file or assembly ‘Microsoft.CodeAnalysis, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies.  
> Omnisharp: [DEBUG] Attempting to resolve ‘Microsoft.CodeAnalysis, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’  
> Omnisharp: [DEBUG] FAILURE: Could not locate ‘/Users/pko/Library/Application Support/JetBrains/Toolbox/apps/Rider/ch-0/213.5744.299/Rider.app.plugins/sonarlint-intellij/omnisharp/osx/omnisharp/.msbuild/Current/Bin/Microsoft.CodeAnalysis.dll’.  
> Omnisharp: [ERROR] Failure while loading the analyzer reference ‘System.Text.Json.SourceGeneration’: Could not load file or assembly ‘Microsoft.CodeAnalysis, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies.  
> Omnisharp: [DEBUG] Attempting to resolve ‘SonarLint.OmniSharp.DotNet.Services.XmlSerializers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c5b62af9de6d7244’  
> Omnisharp: [DEBUG] FAILURE: Could not locate ‘/Users/pko/Library/Application Support/JetBrains/Toolbox/apps/Rider/ch-0/213.5744.299/Rider.app.plugins/sonarlint-intellij/omnisharp/osx/omnisharp/.msbuild/Current/Bin/SonarLint.OmniSharp.DotNet.Services.XmlSerializers.dll’.  
> {“Event”:“ProjectDiagnosticStatus”,“Body”:{“Type”:“background”,“Status”:0,“ProjectFilePath”:“/Users/pko/\_development/Private/KoIdentity/src/Abstraction/Abstraction.csproj”},“Seq”:605,“Type”:“event”}

This is probably the most problematic trace, as Omnisharp (that we leverage to do the analysis) is not able to find our analyzer file. Could you please tell me what appears in _/Users/pko/Library/Application Support/JetBrains/Toolbox/apps/Rider/ch-0/213.5744.299/Rider.app.plugins/sonarlint-intellij/omnisharp/osx_ and subfolders ? Also what version of SonarLint are you using ?

---

<div class="post-metadata">

**Author:** ![Damien\_Urruty](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/damien_urruty/32/43383_2.png) [@Damien\_Urruty](https://community.sonarsource.com/u/Damien_Urruty)\
**Post date:** [December 20, 2021, 2:39pm UTC](https://community.sonarsource.com/t/rider-not-showing-codesmells/55252/6 "2021-12-20T14:39:20Z")

</div>

Could you provide a minimal reproducer project to help in the investigation ?

Also I confirm that given the traces you sent, you are not properly connected to SonarQube.

---

<div class="post-metadata">

**Author:** ![TheRealLenon](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/thereallenon/32/28610_2.png) [@TheRealLenon](https://community.sonarsource.com/u/TheRealLenon)\
**Post date:** [December 20, 2021, 6:49pm UTC](https://community.sonarsource.com/t/rider-not-showing-codesmells/55252/7 "2021-12-20T18:49:35Z")

</div>

@Damien_Urruty I´m so sorry, i accidentally pasted the wrong Log…

Here is a full log, after i was connected: [RiderSonar.log · GitHub](https://gist.github.com/TheRealLenon/be877f4e30d32a45457ff20d6d832de7)

> [@Damien\_Urruty](#):
>
> This is probably the most problematic trace, as Omnisharp (that we leverage to do the analysis) is not able to find our analyzer file. Could you please tell me what appears in _/Users/pko/Library/Application Support/JetBrains/Toolbox/apps/Rider/ch-0/213.5744.299/Rider.app.plugins/sonarlint-intellij/omnisharp/osx_ and subfolders ? Also what version of SonarLint are you using ?

I´m using the latest SonarLint from the JetBrains(Rider)-Marketplace. And Rider is 2021.3.1. You can find the whole sonarlint-intellij folder here: [File-Upload.net - Datei nicht gefunden](https://www.file-upload.net/download-14787711/sonarlint-intellij.zip.html)

An example project can be found here: [GitHub - TheRealLenon/KoIdentity](https://github.com/TheRealLenon/KoIdentity) You also should see the pipeline run did catch the code smells: [Implementing Basic Abstraction by TheRealLenon · Pull Request #1 · TheRealLenon/KoIdentity · GitHub](https://github.com/TheRealLenon/KoIdentity/pull/1)

---

<div class="post-metadata">

**Author:** ![rita.g](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/rita.g/32/7273_2.png) [@rita.g](https://community.sonarsource.com/u/rita.g)\
**Post date:** [December 21, 2021, 8:49am UTC](https://community.sonarsource.com/t/rider-not-showing-codesmells/55252/8 "2021-12-21T08:49:11Z")

</div>

Hello @TheRealLenon,

Thank you for sharing the project with us. I’ve checked out develop branch (where the PR was merged to) and it doesn’t compile on my side due to missing namespaces. Once I add the namespaces, the issue is there:

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/1/9/190a74d96e1a253e053563a0a08cd13d649fb30b.png)  
 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/d/9/d9f4c8c3de19866375fea217230e08c0355727a1.png)

Can you please confirm if the project compiles on your side?

Also, would you mind please trying out the following sample code:

```auto
public static class Extensions
{
    public static async Task SkipLinesAsync(this TextReader reader, int linesToSkip) // Noncompliant
    {
        if (reader == null) { throw new ArgumentNullException(nameof(reader)); }
        if (linesToSkip < 0) { throw new ArgumentOutOfRangeException(nameof(linesToSkip)); }

        for (var i = 0; i < linesToSkip; ++i)
        {
            var line = await reader.ReadLineAsync().ConfigureAwait(false);
            if (line == null) { break; }
        }
    }
    
    public class TextReader
    {
        public Task<string> ReadLineAsync()
        {
            throw new NotImplementedException();
        }
    }
}

```

This produces S4457 on my side when added to your project.

Please let me know.

Thanks,  
Rita

---

<div class="post-metadata">

**Author:** ![TheRealLenon](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/thereallenon/32/28610_2.png) [@TheRealLenon](https://community.sonarsource.com/u/TheRealLenon)\
**Post date:** [December 21, 2021, 9:35pm UTC](https://community.sonarsource.com/t/rider-not-showing-codesmells/55252/9 "2021-12-21T21:35:14Z")

</div>

Hello @rita.g ,

The solution builds on the current DEV-Branch. The error you faced was because of the `namespace Tekoding.KoIdentity.Abstraction.Store;` notation which is (i suppose) a .NET6 feature.

Even after pasting the example code, i don´t get displayed any errors.

---

<div class="post-metadata">

**Author:** ![duncanp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/duncanp/32/293_2.png) [@duncanp](https://community.sonarsource.com/u/duncanp)\
**Post date:** [December 22, 2021, 10:45am UTC](https://community.sonarsource.com/t/rider-not-showing-codesmells/55252/10 "2021-12-22T10:45:33Z")

</div>

@TheRealLenon I think the problem is that you are using a language feature that is not supported by the version of Roslyn used by OmniSharp.

I was able to get analysis results by disabling `ImplicitUsings` in the project file and adding the required explicit references.

OmniSharp ships with an embedded version of Roslyn. In fact, it seems to have two embedded versions, but the one it uses when analysing is v3.11, which doesn’t support implicit namespaces.

I can’t think of any easy workaround. We have a [ticket](https://jira.sonarsource.com/browse/SLI-616) to upgrade SonarLint for Rider to use a newer version of OmniSharp which should fix this issue. We’re hoping to release the next version in January, but that will depend on us finishing other sprints on time.

---

<div class="post-metadata">

**Author:** ![rita.g](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/rita.g/32/7273_2.png) [@rita.g](https://community.sonarsource.com/u/rita.g)\
**Post date:** [January 17, 2022, 2:33pm UTC](https://community.sonarsource.com/t/rider-not-showing-codesmells/55252/11 "2022-01-17T14:33:38Z")

</div>

Hi @TheRealLenon,  
We’ve released a new version of SonarLint for Rider, [6.4.0.41939](https://plugins.jetbrains.com/plugin/7973-sonarlint/versions/stable/153536), would you mind please giving it a try?

---

<div class="post-metadata">

**Author:** ![Julien\_HENRY](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/julien_henry/32/61_2.png) [@Julien\_HENRY](https://community.sonarsource.com/u/Julien_HENRY)\
**Post date:** [January 31, 2022, 8:43am UTC](https://community.sonarsource.com/t/rider-not-showing-codesmells/55252/12 "2022-01-31T08:43:52Z")

</div>

Split this topic on January 31, 2022, 8:43am UTC

A post was split to a new topic: [Omnisharp uses the wrong solution to load](https://community.sonarsource.com/t/omnisharp-uses-the-wrong-solution-to-load/57315)
