Don't call your method Dispose

Rule ND2015 Naming Conventions

The identifier Dispose should be kept for System.IDisposable implementations. Warns when a method named Dispose() belongs to a type not implementing System.IDisposable.

How to fix

Either implement System.IDisposable on the parent type, or rename the method, e.g. Close() Terminate() Finish() Quit() Exit() Unlock() ShutDown()…

CQLinq source

This rule is written in CQLinq, C# LINQ over the NDepend code model. It ships with every new NDepend project: you can read it, adapt it, or use it as a starting point for your own custom rules.

// <Name>Don't call your method Dispose</Name>
// <Id>ND2015:DontCallYourMethodDispose</Id>

warnif count > 0

// Activate this rule only when IDisposable is resolved in third-party code
// else this rule might produce false positives.
let thirdPartyDisposable = ThirdParty.Types.WithFullName("System.IDisposable").FirstOrDefault()
where thirdPartyDisposable != null

from m in JustMyCode.Methods.WithSimpleName("Dispose")
where !m.ParentType.Implement("System.IDisposable".AllowNoMatch()) 
   &&  m.OverriddensBase.Count() == 0    // Can't change the name of an override
   && !m.IsNewSlot  // new slot also means override of an interface method 
select new {
   m,
   Debt = 15.ToMinutes().ToDebt(),
   Severity = Severity.High
}

//<Expl>
// The parent type of the *{0}* doesn't implement the *IDisposable* interface.
// You should either implement it or rename this method using a different 
// identifier, such as:: *Close() Terminate() Finish() Quit() Exit() Unlock() ShutDown()*…
//</Expl>

//<Desc>
// The identifier *Dispose* should be kept for *System.IDisposable*
// implementations. Warns when a method named *Dispose()* belongs to a type
// not implementing *System.IDisposable*.
//</Desc>

//<HowToFix>
// Either implement *System.IDisposable* on the parent type, or rename the
// method, e.g. *Close() Terminate() Finish() Quit() Exit() Unlock()
// ShutDown()*…
//</HowToFix>

Naming Conventions: all 23 items