I think you could have more luck if you try to read it as a series of check this
, if true then this
, else that
.
For this, it might be easier to put the ?
and :
operators at the beginning of lines, and read them as if they were arrows on a flowchart, labeled "yes" and "no". e.g.:
cond1
? cond2
? cond3
? res1
: res2
: res3
: res4
Which could be read as:
cond1?
yes -> is cond2
yes -> is cond3?
yes -> res1
no -> res2
no -> res3
no -> res4
That still doesn't make this very readable, and I agree with all the comments saying this kind of code should really be rewritten to be readable.