I am trying to create a special query with NDepend, but cannot figure it out.
Here’s what I’d like to query in a more procedural pseudocode:
var list
foreach type t
foreach i = t.attribute that is an interface
var nm = i.numberOfMethods
var mu = numberOfMethods that t actually uses
if mu / nm < 1
list.Add(t)
end foreach
end foreach
return list
It’s supposed to list types that don’t comply with the Interface Segregation Principle.
Thanks!
So the query you ask can be written this way:
This query has the peculiarity to match several time a same type, one for each time
methodsOfInterfaceUnusedis not empty. The result is then nicely presented and understandable: