Our website uses cookies to enhance your browsing experience.
Accept
to the top
>
>
>
V7024. Suspicious sub-expression in...
menu mobile close menu
Additional information
toggle menu Contents

V7024. Suspicious sub-expression in sequence of similar comparisons.

Jun 16 2026

The analyzer has detected a code fragment that may contain a typo. A sequence of three or more similar comparisons linked by the || or && operator contains an expression that breaks the pattern of such comparisons.

The example:

if (a.x === b.x && a.y === b.y && a.z === b.y)

In the example, properties of the a variable are compared with those of the b variable. However, in the a.z == b.y expression, different properties are compared. Most likely, this is a copy-paste error, and the check should compare the same properties.

The fixed example:

if (a.x === b.x && a.y === b.y && a.z === b.z)