title: Empty default case in partial switch vs if sentence
body: <p>Suppose you have an <code>enum</code> type like this:</p>
  
  <pre><code>public enum Type
  {
      A, B, C, D, E, F
  }
  </code></pre>
  
  <p>Then you want to do something depending on some of the values, so you create a switch sentence:</p>
  
  <pre><code>switch (type)
  {
      case Type.A: // Do something
          break;
      case Type.B: // Do something
          break;
      case Type.C: // Do something
          break;
  }
  </code></pre>
  
  <p>This compiles and works fine, but then Sonarqube 5.2 (with the default rules for C#) examines the code and complains about the <code>switch</code> not having a default case (it qualifies it as a major issue). So you change the code to this:</p>
  
  <pre><code>switch (type)
  {
      case Type.A: // Do something
          break;
      case Type.B: // Do something
          break;
      case Type.C: // Do something
          break;
      default: // Do nothing
          break;
  }
  </code></pre>
  
  <p>But then it's SharpDevelop who complains, graying the default case and telling you that the code should not be there as it does nothing.</p>
  
  <p>So you end up changing the code to an <code>if</code> sentence:</p>
  
  <pre><code>if (type == Type.A) // Do something
  else if (type == Type.B) // Do something
  else if (type == Type.C) // Do something
  </code></pre>
  
  <p>With this code, neither SonarQube nor SharpDevelop complain at all. Well, SharpDevelop kindly suggests that the <code>if</code> can be converted into a <code>switch</code>.</p>
  
  <p>So, which way is better? Should I add the default case to the <code>switch</code> and ignore SharpDevelop? Should I ignore the issue in SonarQube? Or should I just go for the <code>if</code> sentence? Is there any other way to do it more properly?</p>