Public procedure requires XML documentation (DC0004)
Public procedures form the API surface of a codeunit. They should be documented with XML documentation comments to describe their purpose, parameters, and return values. This helps consumers of the API understand how to use the procedure correctly.
Note: This rule is disabled by default. Enable it in your project’s .editorconfig or ruleset file if you want to enforce XML documentation on public procedures.
Example
The following public procedure lacks XML documentation:
codeunit 50100 MyCodeunit
{
procedure CalculateTotal(Quantity: Decimal; UnitPrice: Decimal): Decimal // Public procedure requires XML documentation [DC0004]
begin
exit(Quantity * UnitPrice);
end;
}
To fix this, add XML documentation:
codeunit 50100 MyCodeunit
{
/// <summary>
/// Calculates the total price based on quantity and unit price.
/// </summary>
/// <param name="Quantity">The number of units.</param>
/// <param name="UnitPrice">The price per unit.</param>
/// <returns>The total price.</returns>
procedure CalculateTotal(Quantity: Decimal; UnitPrice: Decimal): Decimal
begin
exit(Quantity * UnitPrice);
end;
}
See also
- DC0005 - XML documentation must match procedure signature