Internal procedure only used in current object
Properties
LC0053
Warning
Design
Code Fix
Ignore Obsolete
Declaring a procedure as internal signals that other objects within the same extension can call it. When no other object actually does, the extra visibility serves no purpose — it exposes the procedure to the rest of the extension and makes it harder to refactor or remove without first checking all dependents. Change the procedure to local to match its actual usage scope.
Example
codeunit 50100 "Sales Validator"
{
procedure ValidateAndPost()
begin
CheckAmounts();
end;
internal procedure CheckAmounts() // Internal procedure only used in current object [LC0053]
begin
end;
}Change the procedure to local:
codeunit 50100 "Sales Validator"
{
procedure ValidateAndPost()
begin
CheckAmounts();
end;
local procedure CheckAmounts()
begin
end;
}Exception
When internalsVisibleTo is configured in app.json, internal procedures become accessible to the listed apps. The rule does not trigger for any procedure in the extension when this property has entries. See LC0052
for details.
See also
- LC0052 — Internal procedure not referenced