pylint-bot / pylint-unofficial

UNOFFICIAL playground for pylint github migration
0 stars 0 forks source link

warning upon too many conditional expressions #677

Closed pylint-bot closed 8 years ago

pylint-bot commented 9 years ago

Originally reported by: Laura Médioni (BitBucket: lmedioni, GitHub: @lmedioni?)


Emit a warning when a test contains too many conditional expressions. This rule should be configurable through a --max-bool-exp option, defaulting to 5.

Example:

if x > -5 and x < 5 and y > -5 and y < 5 and z > -5 and z < 5:
    do_something()

would trigger a warning.


pylint-bot commented 9 years ago

Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore):


check the number of boolean expressions in if statement is reasonnable

--max-bool-expr option allows to configure it (by default, up to 5 are tolerated)

closes issue #677