mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
27 lines
797 B
HTML
27 lines
797 B
HTML
<html>
|
|
<body>
|
|
Reports <code>switch</code> statements or expressions with too many <code>case</code> labels.
|
|
<p>Such a long switch statement may be confusing and should probably be refactored.
|
|
Sometimes, it is not a problem (for example, a domain is very complicated and has enums with a lot of constants).</p>
|
|
<p>Example:</p>
|
|
<pre><code>
|
|
switch (x) {
|
|
case 1 -> {}
|
|
case 2 -> {}
|
|
case 3 -> {}
|
|
case 4 -> {}
|
|
case 5 -> {}
|
|
case 6 -> {}
|
|
case 7 -> {}
|
|
case 8 -> {}
|
|
case 9 -> {}
|
|
case 10 -> {}
|
|
case 11,12,13 -> {}
|
|
default -> {}
|
|
}
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
<p>Use the <b>Maximum number of branches</b> field to specify the maximum number of <code>case</code> labels expected.
|
|
<p>
|
|
</body>
|
|
</html> |