Home / Vulnerability Database / C-sharp : Switch missing default
C#

C-sharp : Switch missing default

Classification

Overview

A switch statement missing default label.

The use of default label can aid in avioding mistakes and can be used for the following reasons:

  • Perform some action if the variable has unexpected value.
  • Handle default cases, while special ones are handled under case labels.
  • The one reading the code can crearly see that all cases are covered.
LOW

DerScanner Severity Score

Do you want to fix C-sharp : Switch missing default in your application?

See also

C#

C-sharp : JWT: None Algorithm

C#

C-sharp : Insecure data transmission: Database

C#

C-sharp : Only one of method Equals() and GetHashCode() defined