Why is this an issue?

Comparing objects of different lengths always returns false. Thus, such comparisons should be removed.

How to fix it

Code examples

Noncompliant code example

entity top is
  port (
    A : in std_logic_vector(1 downto 0);
    B : in std_logic_vector(2 downto 0);
    Z : out std_logic
  );
end;

architecture rtl of top is
begin
  process (A, B) is
  begin
    if (A = B) then
      Z <= '1';
    else
      Z <= '0';
    end if;
  end process;
end;

Compliant solution

entity top is
  port (
    A : in std_logic_vector(2 downto 0);
    B : in std_logic_vector(2 downto 0);
    Z : out std_logic
  );
end;

architecture rtl of top is
begin
  process (A, B) is
  begin
    if (A = B) then
      Z <= '1';
    else
      Z <= '0';
    end if;
  end process;
end;