Why this matters
Placing multiple statements on the same line makes code harder to read and debug. Keeping one statement per line improves clarity.
Detect multiple statements on the same line, separated by semicolons. This reduces readability and debugging efficiency. Recommend placing each statement on its own line.
Placing multiple statements on the same line makes code harder to read and debug. Keeping one statement per line improves clarity.
Side-by-side examples engineers can pattern-match during review.
if (True): print("hello") # Noncompliantif (True):
print("hello")if (True): print("hello") # Noncompliantif (True):
print("hello")From the same buckets as this rule.
Check if loops use equality operators (== or !=) in termination conditions. These can lead to infinite loops if the condition is never met exactly. Instead, use relational operators like < or > for safer loop termination.