CS.CONSTCOND.SWITCH

The condition of a 'switch' statement is constant.

Example 1

Copy
  class Foo {
      void Method() {
          switch(3 + 2)   // defect - the condition is constant
          {  
              /* ... */
          }
      }
  }

Security training

Application security training materials provided by Secure Code Warrior.