Types name should begin with an Upper character

Rule ND2006 Naming Conventions

Warns about types whose names don't start with an Upper character. .NET commonly uses Pascal Casing Style (first letter of the identifier and of each concatenated word capitalized, e.g. BackColor).

How to fix

Pascal Case the names of matched types.

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>Types name should begin with an Upper character</Name>
// <Id>ND2006:TypesNameShouldBeginWithAnUpperCharacter</Id>

warnif count > 0
let isAspNetApp = ThirdParty.Assemblies.WithName("System.Web").Any()
from t in JustMyCode.Types where 
  // The name of a type should begin with an Upper letter.
  !t.SimpleNameLike (@"^[A-Z]") &&     

  // Except if it is generated by compiler.
  !t.IsSpecialName &&
  !t.IsGeneratedByCompiler &&

  // Special default ASP.NET type named "_Default"
  !(isAspNetApp && t.SimpleNameEquals("_Default"))

select new { 
   t,
   // We show the type simple name
   // that doesn't include the parent type name
   // for nested types. 
   t.SimpleName,
   Debt = 5.ToMinutes().ToDebt(),
   Severity = Severity.Medium
}

//<Expl>
// The *{0}'s name* should begin with an uppercase letter.
//</Expl>

//<Desc>
// Warns about *types* whose names don't start with an Upper character.
// .NET commonly uses **Pascal Casing Style** (first letter of the
// identifier and of each concatenated word capitalized, e.g. *BackColor*).
//</Desc>

//<HowToFix>
// *Pascal Case* the names of matched types.
//</HowToFix>

Naming Conventions: all 23 items