Do not name enum values 'Reserved'

Rule ND2008 Naming Conventions

An enum member named "Reserved" is presumably a placeholder to rename or remove later — a breaking change. Users can't be expected to ignore it or read documentation, and it causes confusion in object browsers and IDEs. Instead, add a new member in the future version: usually not a breaking change as long as original members' values don't change.

How to fix

Remove or rename the member.

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>Do not name enum values 'Reserved'</Name>
// <Id>ND2008:DoNotNameEnumValuesReserved</Id>

warnif count > 0 
from f in Application.Fields where 
  f.IsEnumValue && 
  f.NameLike (@"Reserved")
select new {
   f,
   Debt = 3.ToMinutes().ToDebt(),
   Severity = Severity.Medium
}

//<Expl>
// The *{0}'s name* shouldn't be *Reserved*.
// This might break consummer code in the future
// in case of change.
//</Expl>

//<Desc>
// An enum member named **"Reserved"** is presumably a placeholder to rename
// or remove later — a breaking change. Users can't be expected to ignore it
// or read documentation, and it causes confusion in object browsers and
// IDEs. Instead, add a new member in the future version: usually not a
// breaking change as long as original members' values don't change.
//</Desc>

//<HowToFix>
// Remove or rename the member.
//</HowToFix>

Naming Conventions: all 23 items