org.sonar.l10n.javascript.rules.javascript.UnreachableCode.html Maven / Gradle / Ivy
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
}
}