captainbrosset/cleanjs — Issue #23: Ternary operator complexity
Author: captainbrosset
Created: 2012-01-31 08:04:42+00:00
State: open

Ternary operators can very quickly become unreadable.
When simple values are assigned, it's fine, but the longer the expression, the harder it is to read.
Something like this should be reported as a warning:

params[++ind] == null? false : params[ind][0] !== '-'

Perhaps the reviewer could simply count the number of characters between the = and ? and : and ; to assess the complexity of the expression.