V7018. The expression 'A || (A && B)' is redundant and always evaluates to 'A'.
The analyzer has detected an expression that can be simplified. Such expressions may also indicate logical errors.
The example:
let firstCond, secondCond, thirdCond;
....
if (firstCond || (firstCond && thirdCond))
....
The expression is redundant. If firstCond is true, the condition result is always true, regardless of thirdCond. If firstCond is false, the expression is always false.
The firstCond || (firstCond && thirdCond) expression can be simplified as follows:
if (firstCond)
Most likely, a wrong variable was used in the second subexpression. The fixed code may look like this:
if (firstCond || (secondCond && thirdCond))