I write a cognitive compelxity computing engine and need some clarifing about negations and parentheses.
Cognitive complexity whitepaper has this example (page 7):
if (a // +1 for `if` && // +1 !(b && c)) // +1
Why does the third increment trigger?
Cause of negation
! ? - other examples with single negation (before variable) doesn’t increment complexity counter.
Cause of second parentheses? - sonar-java skips parentheses in logical expressions during complexity compluting.
parentheses make increment?
Thanks for any advice and examples.