Files
openide/java/java-impl/resources/inspectionDescriptions/SwitchStatementWithTooManyBranches.html
Leonid Shalupov 40795fe787 IJI-2422: community/java: move resources under resources root
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
2025-02-05 04:43:28 +00:00

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>