org.sonar.l10n.py.rules.python.S1763.html Maven / Gradle / Ivy
The newest version!
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
- CWE - CWE-561 - Dead Code
© 2015 - 2025 Weber Informatics LLC | Privacy Policy