h3>Exceptions</h3>
<p>Unless all blocks are identical, blocks in an <code>if</code> chain that contain a single line of code are ignored. The same applies to blocks in a
<code>switch</code> statement that contains a single line of code with or without a following <code>break</code>.</p>
<pre>
if (a == 1) {
  doSomething();  // Compliant, usually this is done on purpose to increase the readability
} else if (a == 2) {
  doSomethingElse();
} else {
  doSomething();
}
</pre>
<h2>Resources</h2>
<h3>Related rule