Methods name should begin with an Upper character

Rule ND2007 Naming Conventions

Warns about methods 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. ComputeSize).

How to fix

Pascal Case the names of matched methods.

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>Methods name should begin with an Upper character</Name>
// <Id>ND2007:MethodsNameShouldBeginWithAnUpperCharacter</Id>

warnif count > 0 
from m in JustMyCode.Methods where 
  !m.NameLike (@"^[A-Z]") && 
  !m.IsSpecialName && 
  !m.IsGeneratedByCompiler &&
  !m.IsExplicitInterfaceImpl && // This can generate unexpected method name.

  // For records some generated methods are not marked as generated
  !(m.SimpleName.Length > 0 && m.SimpleName[0] == '<') &&

  // Some extension property accessors must start with these
  !m.SimpleName.StartsWithAny("get_", "set_")
  
select new {
   m,
   Debt = 3.ToMinutes().ToDebt(),
   Severity = Severity.Medium
}

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

//<Desc>
// Warns about *methods* 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. *ComputeSize*).
//</Desc>

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

Naming Conventions: all 23 items