TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
C# Coding Standard
Search

Rule:  11@412Checked automatically with code checker

This rule is Obsolete
Synopsis:Put case labels on a separate line
Language:C#
Severity Level:8
Category:Coding style


Description:

Code like:

    switch( j )
    {
      case 0: ++i;
        break;
      default: break;
    }

does not give any coding rule violation.
However extra statements on the specific case labels or on the default case label of a switch shall give a warning:

    "Put case labels on a separate line"
And the break shall also be treated as a separate statement.

So the code above should read:

    switch( j )
    {
      case 0:
        ++i;
        break;
      default:
        break;
    }