All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.delphi.rules.community-delphi.RedundantBoolean.html Maven / Gradle / Ivy

There is a newer version: 1.12.1
Show newest version

Why is this an issue?

Boolean expressions do not have to be explicitly compared to True or False. Doing so adds unnecessary complexity to the statement.

How to fix it

Remove the redundancy in the boolean expression:

if Foo = True then begin
  // ...
end;

if Bar = False then begin
  // ...
end;

DoSomething(not False);
if Foo then begin
  // ...
end;

if not Bar then begin
  // ...
end;

DoSomething(True);




© 2015 - 2024 Weber Informatics LLC | Privacy Policy