C# Analysis - spotting unused using directives

csharp

(Jason Doherty) #1

Hi,
Been using SonarCloud for a few weeks and think it’s great - reducing time it takes to review PRs and improving our test code coverage :slight_smile:

Just wondered if there was an easy way to spot using directives in C# (.net core) that are not being used, it’s a constant thing we pick up in PRs, and sounds like a good fit for SonarCloud to register them as code smells - although it doesn’t seem to do it at the moment?

Thanks


(Amaury Levé) #2

Hi @jasonpdoherty,

Here is the link to the ticket for this new rule: https://github.com/SonarSource/sonar-dotnet/issues/2210

Cheers,
Amaury


(Jason Doherty) #3

Brilliant thanks - any ideas how can implement it? - guessing a new quality profile?

Any links to any guides would be great!


(Amaury Levé) #4

We will handle the implementation and the rule will be available under the ID S1128 but I cannot commit on any ETA.