Skip to content

[Bug]: AC0032 - false positive (the return) #343

Description

@pibcht

Analyzer

ApplicationCop

Issue type

False positive (diagnostic fires when it shouldn't)

Rule ID

AC0032

Description

I have the exact same issue as described in #243 but I’m using v0.9.0

Image

The original code:
Image

After commenting it out:
Image

Maybe I missed something. I read the previous issue, but I couldn’t find a clear answer.

AL code to reproduce

table 50000 Setup
{
    Access = Internal;
    AllowInCustomizations = Never;
    Caption = 'Setup';
    DataClassification = CustomerContent;
    DataPerCompany = true;
    Extensible = true;
    Permissions = tabledata Setup2 = rim; // <-- HERE

    fields
    {
        field(1; PK; Boolean)
        {
            Access = Internal;
            Caption = 'Primary Key', Locked = true;
            Editable = false;
            InitValue = true;
            NotBlank = true;
        }
        field(10; Hash; Guid)
        {
            Access = Internal;
            Caption = 'Hash', Locked = true;
            Editable = false;
            NotBlank = true;
        }
        field(11; Enabled; Boolean)
        {
            Caption = 'Enabled';
            DataClassification = SystemMetadata;
            ToolTip = 'Enable or disable the functionality.';
        }
    }
    keys
    {
        key(PK; PK) { Clustered = true; }
    }

    internal procedure GetOrInitialize()
    begin
        if this.Get(true) then exit;

        this.Init();
        this.Insert(true);
    end;

    internal procedure Disable()
    begin
        this.Validate(Enabled, false);
        this.Modify(true);
    end;
}

Additional context

Same issue as described here : #243

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpart of upcoming releaseAvailable in alpha/beta and waiting to be included in the next stable release

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions