I realize that the query this question is looking for won't be enough to find every little problem with IDisposable implementations, but every early warning counts, so I'll take what I can get.
I'd like to know if anyone has come up with a CQL query for NDepend that will list all classes that doesn't implement IDisposable, but has one or more fields that does. A class could end up on the resultlist of this query either through a bug (ie. someone forgot to check the field types for IDisposable implementations), or through code evolution (ie. a class used in a field somewhere gets IDisposable tacked on at a later date without all usages being updated).
The simple query to find all classes that doesn't implement IDisposable is:
SELECT TYPES WHERE !Implement "System.IDisposable"
However, this will of course not check if the class should implement IDisposable for the above rule.
Does anyone have such a query? I'm still getting to grips with CQL so this part eludes me.