rules repository

G-4260 Avoid inverting boolean conditions with NOT.

Severity Warning Check Free

Reason

It is more readable to use the opposite comparison operator instead of inverting the comparison with not.

Example

Non-Compliant Example

declare
   l_color types_up.color_code_type;
begin
   if not l_color != constants_up.co_red then
      my_package.do_red();
   end if;
end;
/
Issues
LineColumnMessage
47Inverting boolean condition.

Compliant Solution - ★★★★★

declare
   l_color types_up.color_code_type;
begin
   if l_color = constants_up.co_red then
      my_package.do_red();
   end if;
end;
/

Parameters

Use parameters to customize the rule to your needs.

ParameterDescriptionDefault Value
DisableAllQuickFixComma-separated list of rules for which a quick fix should not be applied to all the problems in a file.Core G-3130

References