What's wrong
Code like this seems to trigger a violation:
if not this():
...
elif not that():
...
else:
...
How it should be
No violation. It would be awkward to rewrite the code without negations, as it would require either calculating the conditions multiple times or pre-calculating the conditions into variables beforehand.
What's wrong
Code like this seems to trigger a violation:
How it should be
No violation. It would be awkward to rewrite the code without negations, as it would require either calculating the conditions multiple times or pre-calculating the conditions into variables beforehand.