Back

LL070

Identical if/else branches

Object Pascal — Delphi & Free Pascal
Warning
Reliability

Identical branches are almost always copy-paste errors that mask intended logic

identical branches are almost always copy-paste errors that mask intended logic.

Why this severity

identical branches are almost always copy-paste errors that mask intended logic.


Known false positives

intentional no-op branches kept for future expansion with a comment.

Remediation example

if IsAdmin then
  GrantFullAccess
else
  GrantReadOnly;

Reconnecting… Connection lost. Reload