BusinessCentral.LinterCop
BusinessCentral.LinterCop copied to clipboard
LC0005 false positive
In one of my reports, I get this LC0005 message:
Global var:
The line of code in question:
Definition of the procedure that is called:
When adhering to the warnings wishes:
The error changes:
I.e. I'm running in circles 😉
Changing the procedure definition solves my problem for now:
I've created an repo and indeed the rule creates an false positive on this scenario.
The rule detects LABRegistration
and LabRegistration
as a valid IdentifierName and matches this with the declared identifies. Unfortunately at the moment I'm not sure how I could resolve this.
Repo example
table 50100 "LAB Registration"
{
fields { field(1; MyField; Integer) { } }
}
codeunit 50100 FormatAddress
{
procedure LabRegistration(var LABRegistration: Record "LAB Registration")
begin
end;
}
codeunit 50101 MyCodeunit
{
procedure MyProcedure()
var
LABRegistration: Record "LAB Registration";
FormatAddress: Codeunit FormatAddress;
begin
FormatAddress.LabRegistration(LABRegistration);
end;
}
I've created an repo and indeed the rule creates an false positive on this scenario.
The rule detects
LABRegistration
andLabRegistration
as a valid IdentifierName and matches this with the declared identifies. Unfortunately at the moment I'm not sure how I could resolve this.
Thanks for looking into it. It's probably not a scenario that happens a lot. If you think of a way to fix it; great! If not; so be it.