Closed bvbeek closed 2 years ago
I assume this would only apply to local functions? Public functions might be used outside of the compilation scope so not possible to detect while compiling the individual project.
I understand what you mean but probably I got one scope. And then I want to know it on the global functions as well. The info may say something like this: Function may not be in use please check....
I feel I am too late, but a local function with no reference should show as a warning while (another rule) should show unused global procedures as info.
It'd be a nice rule. A long time ago, I wrote an extension to figure out what was/wasn't local: https://marketplace.visualstudio.com/items?itemName=mmatthiesen.localize-lens
Source is available so you can modify as needed. Keep in mind you may want some things public for extensions that the base product doesn't use.
I think we should consider the access modifiers as well. So global procedures could be marked as unused if the codeunit is interal (or the procedure itself)
Issue has been addressed. Please see https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/analyzers/codecop-aa0228
Public and internal functions are okay to be unused. We have work planned to address unraised event.
That would be nice: 😀