Once control flow has been moved out of the current code block, any subsequent statements become effectively unreachable.

Why is this an issue?

Jump statements (return, break, continue, and raise) move control flow out of the current code block. So any statements that come after a jump are dead code.

Noncompliant code example

def fun(a):
  i = 10
  return i + a       # Noncompliant
  i += 1             # this is never executed

Compliant solution

def fun(a):
  i = 10
  return i + a

Resources