# Blazor support of Sonar C#

**URL:** <https://community.sonarsource.com/t/blazor-support-of-sonar-c/62469>\
**Category:** SonarQube Server / Community Build\
**Tags:** csharp\
**Created:** [May 1, 2022, 2:13pm UTC](https://community.sonarsource.com/t/blazor-support-of-sonar-c/62469 "2022-05-01T14:13:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mu88](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/mu88/32/51076_2.png) [@mu88](https://community.sonarsource.com/u/mu88)\
**Post date:** [May 1, 2022, 2:13pm UTC](https://community.sonarsource.com/t/blazor-support-of-sonar-c/62469/1 "2022-05-01T14:13:06Z")

</div>

Hey 👋🏻

Is Sonar C# capable of properly analyzing Blazor components (`razor` files)? Because when executing Sonar C# on Codacy againt my Blazor project, the analyzer gets totally crazy with a bunch of false-positives (e. g. on every `@using` or `@inject` statement). You can find the analysis result here: [Project28 - Codacy - Files](https://app.codacy.com/gh/mu88/Project28/file/70304326297/issues/source?bid=28115579&fileBranchId=28115579)

Codacy has the tendency to say _we don’t know Sonar in detail, we’re just executing the tool_, so that’s why I’m asking here before asking Codacy whether it should work properly 😉

Thanks!

- Operating system: I don’t know Codacy’s OS
- IDE name and flavor/env: On Codacy, using C#
- SonarLint plugin version: I don’t know the version on Codacy
- Is connected mode used:
  - Connected to SonarCloud or SonarQube (and which version): I don’t know

---

<div class="post-metadata">

**Author:** ![Pavel\_Mikula](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/pavel_mikula/32/7381_2.png) [@Pavel\_Mikula](https://community.sonarsource.com/u/Pavel_Mikula)\
**Post date:** [May 2, 2022, 8:22am UTC](https://community.sonarsource.com/t/blazor-support-of-sonar-c/62469/4 "2022-05-02T08:22:52Z")

</div>

Hi @mu88,

We do not support `.razor` file analysis. We only support Razor `.cshtml` files in XSS detecting rule [S5131](https://rules.sonarsource.com/csharp/type/Vulnerability/RSPEC-5131) - and this one will not work on Codacy platform.

From the `Remove this unused method parameter 'using'.` issue, we can only guess that Codacy does some cross-compilation and tries to analyze the generated code. I don’t see any parameter named `using` there.

---

<div class="post-metadata">

**Author:** ![mu88](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/mu88/32/51076_2.png) [@mu88](https://community.sonarsource.com/u/mu88)\
**Post date:** [May 2, 2022, 9:20am UTC](https://community.sonarsource.com/t/blazor-support-of-sonar-c/62469/5 "2022-05-02T09:20:17Z")

</div>

Thank you for your reply.

And are you planning to support Razor files? Because the whole Blazor topic becomes more and more important due to increased community adoption

---

<div class="post-metadata">

**Author:** ![Pavel\_Mikula](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/pavel_mikula/32/7381_2.png) [@Pavel\_Mikula](https://community.sonarsource.com/u/Pavel_Mikula)\
**Post date:** [May 2, 2022, 10:21am UTC](https://community.sonarsource.com/t/blazor-support-of-sonar-c/62469/6 "2022-05-02T10:21:39Z")

</div>

We have it on our radar and we’d like to support that. We can’t provide any ETA as we have other priorities for this year.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/system/32/31083_2.png) [@system](https://community.sonarsource.com/u/system)\
**Post date:** [May 9, 2022, 10:22am UTC](https://community.sonarsource.com/t/blazor-support-of-sonar-c/62469/7 "2022-05-09T10:22:23Z")

</div>

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