BusinessCentral.LinterCop icon indicating copy to clipboard operation
BusinessCentral.LinterCop copied to clipboard

LC0005 false positive

Open Aize-S opened this issue 1 year ago • 3 comments

In one of my reports, I get this LC0005 message: image

Global var: image

The line of code in question: image

Definition of the procedure that is called: image

When adhering to the warnings wishes: image

The error changes: image

I.e. I'm running in circles 😉

Changing the procedure definition solves my problem for now: image

Aize-S avatar Dec 28 '23 15:12 Aize-S

I've created an repo and indeed the rule creates an false positive on this scenario.

image

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.

Arthurvdv avatar Jan 08 '24 09:01 Arthurvdv

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;
}

Arthurvdv avatar Jan 08 '24 09:01 Arthurvdv

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.

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.

Aize-S avatar Jan 08 '24 13:01 Aize-S