Using constants instead of hard-coded numeric values improve readability and maintainability.
Note that the following structures and not checked against this rule:
architecture a of e is
begin
output <= d1 when input = 3 -- Noncompliant: '3' hard-coded value
else d2 when input = 4 -- Noncompliant: '4' hard-coded value
else d3;
end;
architecture a of e is
constant fly : integer := 3; -- Compliant: '3' is part of constant declaration
constant dream : integer := 4; -- Compliant: '4' is part of constant declaration
begin
output <= d1 when input = fly
else d2 when input = dream
else d3;
end;