diff --git a/rules/S3518/python/rule.adoc b/rules/S3518/python/rule.adoc index b352ed41e49..14fb1ace15a 100644 --- a/rules/S3518/python/rule.adoc +++ b/rules/S3518/python/rule.adoc @@ -26,12 +26,12 @@ The goal is to ensure that a zero value never reaches the denominator. def foo(): z = 0 if (unknown()): - # ... z = 4 + ... else: - # ... # (z is not reassigned to a non-zero value here) - z = 1 / z + ... + z = 1 / z # Noncompliant: divisor can be 0 ---- ==== Compliant solution @@ -41,11 +41,11 @@ def foo(): def foo(): z = 0 if (unknown()): - # ... z = 4 + ... else: - # ... z = 1 + ... z = 1 / z ----