Why is this an issue?

Identifies a conditional expression mixed with a binary expression in way that suggests a different intended order of operations.

How to fix it

Code examples

Noncompliant code example

module m;
  logic a, b, c, d;
  initial begin
    if ((a + b ? 1 : 2) == 2) begin end // Noncompliant
    if ((c + d ? 1 : 2) == 2) begin end // Noncompliant
  end
endmodule

Compliant solution

module m;
  logic a, b, c, d;
  initial begin
    if ((a + (b ? 1 : 2)) == 2) begin end // Compliant: Parentheses around the '?:' expression to evaluate it first
    if (((c + d) ? 1 : 2) == 2) begin end // Compliant: Parentheses around the '+' expression to silence this issue
  end
endmodule