0
votes

I have an interface with a single method which is not used anywhere:

public interface IInterface
{
    int Foo();
}

public class MyClass : IInterface
{
    public int Foo()
    {
        return 0;
    }
}

However, JetBrains Rider does not show me any hints, warnings or anything even when the solution-wide analysis is turned on. I have tried changing the settings in Editor > Inspection Settings > Inspection Severity > C# > Redundancies in Symbol Declarations > Type or member is never used and set both private and non-private to Warning. But I am still not getting any warnings. The only way how to find out that the method is not used anywhere is by right-clicking on it and selecting Find usages.

Is there a possibility to find all unused public methods which are implementations of an interface?

1
Does it work if you change both public to internal?mjwills
Yes, it does, but I would have to convert all of my interfaces to internal, which would break the whole solution... so this is not an option for me.Storm

1 Answers

0
votes

After updating Rider to version 2019.2.2, Rider detects also unused public method in interfaces. However, the feature is very unstable and after refactoring a couple of interfaces it stopped working again.