Abstract base class should be suffixed with 'Base'

Rule ND2003 Naming Conventions

Warns about abstract classes not suffixed with Base, a common .NET practice. Only base classes deriving directly from System.Object are matched (not abstract classes in the middle of a hierarchy chain).

How to fix

Suffix the names of matched base classes with Base.

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>Abstract base class should be suffixed with 'Base'</Name>
// <Id>ND2003:AbstractBaseClassShouldBeSuffixedWithBase</Id>

warnif count > 0 from t in Application.Types where 
  t.IsAbstract && 
  t.IsClass &&

  t.BaseClass != null &&
  t.BaseClass.FullName == "System.Object" &&

  ((!t.IsGeneric && !t.NameLike (@"Base$")) ||
   ( t.IsGeneric && !t.NameLike (@"Base<")))
select new {
   t,
   Debt = 5.ToMinutes().ToDebt(),
   Severity = Severity.Medium
}

//<Expl>
// The *abstract base {0}'s name* should be suffixed with *Base*.
//</Expl>

//<Desc>
// Warns about *abstract classes* not suffixed with **Base**, a common .NET
// practice. Only base classes deriving directly from *System.Object* are
// matched (not abstract classes in the middle of a hierarchy chain).
//</Desc>

//<HowToFix>
// Suffix the names of matched base classes with **Base**.
//</HowToFix>

Naming Conventions: all 23 items