microsoft / microsoft/AL

CodeAnalyzer - rule "AA0072" ignores triggers and event subscriber

Open
#8,272 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PowerShell
Stars
881
Forks
285
Avg merge
3d 36m
Merged PRs (30d)
1

Description

Please include the following with each issue:

1. Describe the bug
The CodeCop rule AA0072 still doesn't behave correctly in certain scenarios like local variable in the OnAction trigger of pages.
There are two older issues for this which both have been closed without resolving the issue. One was marked as not planned because there was a plan to overhaul the analysers and the second one was marked as completed without a comment.
https://github.com/microsoft/AL/issues/7177
https://github.com/microsoft/AL/issues/6871

The issue #6871 describes a lot of scenarios where it doesn't trigger.

2. To Reproduce
Steps to reproduce the behavior:

  1. Add this action to a page
  2. See no information
actions
    {
        area(Navigation)
        {
            action(Test)
            {
                Caption = 'Test';

                trigger OnAction()
                var
                    Test: Record "User Setup"
                begin
                    Test.Get();
                end;
            }
        }
    }

3. Expected behavior
Show information of rule AA0072

4. Actual behavior
No information

5. Versions:

  • AL Language: 17.0.2273547
  • Visual Studio Code: 1.125.0-insider
  • List of Visual Studio Code extensions that you have installed:
    • ALCops
  • Operating System:
    • Windows
    • Linux
    • MacOS
Final Checklist

Please remember to do the following:

  • Search the issue repository to ensure you are reporting a new issue

  • Reproduce the issue after disabling all extensions except the AL Language extension

  • Simplify your code around the issue to better isolate the problem

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the AL snippet in Visual Studio Code with rule AA0072 enabled, focusing on the page action's OnAction trigger and its local variable. Compare the behavior with the scenarios described in issues #7177 and #6871. Done means AA0072 reports the expected information for this trigger and the related event-subscriber cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
vscode
Domain
compilers, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.