Blazor support of Sonar C#

Hey :wave:t2:

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

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 :wink:


  • 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

Hi @mu88,

We do not support .razor file analysis. We only support Razor .cshtml files in XSS detecting rule S5131 - 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.

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

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.

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