mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
24 lines
740 B
HTML
24 lines
740 B
HTML
<html>
|
|
<body>
|
|
Reports <code>switch</code> statements or expressions
|
|
with a too low ratio of switch labels to executable statements.
|
|
<p>Such <code>switch</code> statements
|
|
may be confusing and should probably be refactored.</p>
|
|
|
|
<p>Example:</p>
|
|
<pre><code>
|
|
switch (i) { // one case and 5 executable statements -> 20% density
|
|
case 1:
|
|
System.out.println("1");
|
|
System.out.println("2");
|
|
System.out.println("3");
|
|
System.out.println("4");
|
|
System.out.println("5");
|
|
break;
|
|
}
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
<p>
|
|
<p>Use the <b>Minimum density of branches</b> field to specify the allowed ratio of the switch labels to executable statements.</p>
|
|
</body>
|
|
</html> |