-1

I have a C# codebase which has evolved over the past year, and I'd like to get some visibility on the number of interface type references vs class type references. Suppose the code is:

namespace Infrastructure {
   public class Foo {
      private ConcreteClass _field1;
      private OtherConcreteClass _field2;
      private IInterface _field3;

      public void SomeMethod(ConcreteClass parameter1, IInterface parameter2) {
         _field1 = parameter1;
         _field3 = parameter2;
         OtherConcreteClass newVariable = new OtherConcreteClass();
      }
   }
}

Does anyone know of a tool that would report that there are 2 declared interface references and 4 declared class references in this snippet? I've looked at R#, SourceMonitor, CLOC, and a few others, with no success so far.

Daniel A. Thompson
  • 1,904
  • 1
  • 17
  • 26
  • If you're asking for a tool, http://softwarerecs.stackexchange.com/ site should be more suitable. – kenorb Nov 10 '16 at 00:24
  • 2
    Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it. – Krease Nov 10 '16 at 02:07

1 Answers1

1

The best code metric tool I used so for is nDepend (http://www.ndepend.com/) but I'm not sure it will give you the information you want (but it'wll give you many more ...)

I hope this help

mberube.Net
  • 2,120
  • 2
  • 29
  • 39