5

Just started NDepend on a WPF project. Changed the "potentially dead types" built-in query to include our System.Windows.Application derived class instead of the class called Program:

// <Name>Potentially dead Types</Name>
warnif count > 0
let canTypeBeConsideredAsDeadProc = new Func<IType, bool>(
   t => !t.IsPublic &&
        (t.BaseClass == null || t.BaseClass.FullName != "System.Windows.Application") && 
        !t.IsGeneratedByCompiler && ...

After tackling these, I would still need to deal with lots of dead methods found by NDepend that are actually used in a WPF Binding. Any ideas how to start on this without marking all such view-model properties with an attribute?

Unfortunately all methods used by only those properties also seem to be dead code, so this query "leaks" into parts of the model, too.

wigy
  • 2,174
  • 19
  • 32
  • One idea that came to my mind was to treat all properties alive on each subclass of our abstract ViewModel class. But that would not help me spot those properties that are not used in a type-safe way from the views. We use d:DataType on all views to make Bindings type-safe. – wigy Feb 16 '15 at 08:49
  • Well, well. Bounty of 50 was lost. I am looking now for alternatives to NDepend. And if you want to uninstall it you need to run NDepend.Install.VisualStudioAddin.exe :P – wigy Feb 24 '15 at 09:20

0 Answers0