Jump statements (return
, break
and continue
) and throw
expressions move control flow out of the
current code block. So any statements that come after a jump are dead code.
Noncompliant Code Example
function fun(a) {
var i = 10;
return i + a;
i++; // Noncompliant; this is never executed
}
Compliant Solution
function fun(int a) {
var i = 10;
return i + a;
}
See