StefanMaron / BusinessCentral.LinterCop

Community driven code linter for AL (MS Dynamics 365 Business Central)
https://stefanmaron.com
MIT License
77 stars 31 forks source link

Rule Request - Internal procedure with no references #433

Closed tscottjendev closed 10 months ago

tscottjendev commented 10 months ago

Not sure if this is something that fits your model but I would like to have a rule that checks to see if an internal procedure has no references. I am currently refactoring and splitting a monolith app and find unreferenced code once I have made objects internal.

You would need to cover an internal procedure in an object with Access = Public and a procedure in an object with Access = Internal.

What do you think?

Arthurvdv commented 10 months ago

Good idea. I'm doubting on this rule in combination with the internalsVisibleTo property of the app.json.

The be honest we tent to use this for our testing apps, and using it more than I would admit 😅

When opening a multi-root workspace in VS Code this could work (although there's a challenge if the project isn't loaded). I'm unsure about this in a ADO/Github pipeline.

  "internalsVisibleTo": [
    {
      "id": "51e7db57-be52-492d-a10c-ad26b45e255c",
      "publisher": "MyPublisher",
      "name": "MyApp.TestApp"
    }
  ],