All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.squidjava.rules.squid.S1151.html Maven / Gradle / Ivy

Switch cases should remain small to keep the overall switch compact and readable.

The following code snippet illustrates this rule with the default threshold of 5:

switch (myVariable) {
  case 0:                     // Compliant - 5 lines till following case
    System.out.println("");
    System.out.println("");
    System.out.println("");
    break;
  default:                    // Non-Compliant - 6 lines till switch end
    System.out.println("");
    System.out.println("");
    System.out.println("");
    System.out.println("");
    break;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy