Closed fvet closed 3 months ago
The internal method PreProcessIncomingMessage in Codeunit ESCN IC Message Order (Access = Public) is declared but never used.
You're right, this seems like a false positive.
When a codeunit implements an interface, then LC0052 (and LC0053) should not raise a diagnostic.
This should now be resolved in the (pre)release version of v0.30.15 of the LinterCop.
The changes that were made are now leading to false negatives. It should not completely skip procedures in codeunits that implement an interface, because if you do that it skips procedures that are not part of the interface. I think instead the method that checks if a procedure implements an interface procedure could/should be adjusted slightly. 😉
@rvanbekkum , you're right, thank you for bringing this to our attention.
I need to verify if the procure is declared in the interface and then skip these.
That's already been accounted for in the current implementation, but maybe there's an issue with the scenario in which the access modifiers of the procedures are not matching? Would need to be checked though, that's just a guess.
@rvanbekkum, Thanks! That validation was are hiding in plain sight somehow 😅
I've moved this validation a bit up in the chain to early exclude procedures that are part of the interface.
When I declare an internal interface with methods. (Interface is set to internal, allowing use to add methods without breaking things) And implement the interface by adding the methods in a public codeunit, LC0052 pops up. (Codeunit was public due to legacy, so we ended up adding the interface related functions as internal in the codeunit)
In my opinion, the LC0052 should not raise a warning here? Functions are not explicitly referenced, but referenced via the interface instead.