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

org.sonar.l10n.javascript.rules.javascript.UnreachableCode.html Maven / Gradle / Ivy

There is a newer version: 2.5
Show newest version

return, break, continue, or throw statements should be followed by a } or case or default.

The following code snippet illustrates this rule :

function sayHello() {
  if (true) {
    return;
    var b; // Non-Compliant - this will never be executed
  } else {
    var c;
  }

  while (true) {
    break;
    var d; // Non-Compliant - this will never be executed
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy