Empty statements should be removed or documented
Properties
DC0003
Info
Design
Code Fix
Ignore Obsolete
A lone semicolon in AL is an empty statement — valid syntax that does nothing at runtime. These typically appear by accident: a leftover from deleted code, or a reflexive keystroke after a block. Without a comment, a reviewer cannot tell whether the semicolon marks an intentional no-op or a forgotten implementation, and may remove a deliberate empty branch or leave an accidental one in place.
Remove the empty statement when it serves no purpose. When it is intentional, add a leading or trailing comment explaining why.
Example
procedure PostSalesDocument(ShouldValidate: Boolean)
begin
if ShouldValidate then begin
; // Empty statements should be removed or documented [DC0003]
ValidateDocument();
end;
; // Empty statements should be removed or documented [DC0003]
end;These semicolons serve no purpose — remove them:
procedure PostSalesDocument(ShouldValidate: Boolean)
begin
if ShouldValidate then begin
ValidateDocument();
end;
end;When an empty statement is intentional — for example, to handle a case branch that deliberately takes no action — a comment suppresses the diagnostic:
case PaymentMethod of
PaymentMethod::Cash:
ProcessCashPayment();
PaymentMethod::Credit:
; // No action needed: credit payments are settled asynchronously by the payment gateway
else
Error('Unsupported payment method.');
end;