C#

C#

Made by DeepSource

0 should be assigned to None in enum-s attributed with Flags attribute CS-R1144

Anti-pattern
Major

The Flags attribute specifies that the enumeration can be treated as a bit field; that is, a set of flags. It is idiomatic that 0 be assigned to a member named None in such cases. Consider renaming the concerned member appropriately.

Bad Practice

[Flags]
enum E
{
    Nil = 0,
    // ...
}

Recommended

[Flags]
enum E
{
    None = 0,
    // ...
}

References