Avoid fields with name too long

Rule ND2011 Naming Conventions

Matches fields with names longer than 40 characters: less readable.

How to fix

Rename the field with a shorter name conveying the same information.

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>Avoid fields with name too long</Name>
// <Id>ND2011:AvoidFieldsWithNameTooLong</Id>

warnif count > 0 from f in JustMyCode.Fields where
 !f.IsGeneratedByCompiler &&
  f.Name.Length > 50
orderby f.Name descending
select new {
   f,
   NameLength = f.Name.Length,
   Debt = 3.ToMinutes().ToDebt(),
   Severity = Severity.Medium
}

//<Expl>
// The *{0}'s name* is excessively long, which tends to reduce code readability.
//</Expl>

//<Desc>
// Matches fields with names longer than 40 characters: less readable.
//</Desc>

//<HowToFix>
// Rename the field with a shorter name conveying the same information.
//</HowToFix>

Naming Conventions: all 23 items