Current status of AL Code Analyzers

by Oct 10, 2020AL Statis Code Analysers, Development

Home 9 Development 9 AL Statis Code Analysers 9 Current status of AL Code Analyzers

With the last update of Analyzers Rules, there are some new issues with warnings. This is not a comprehensive list of all bugs but contains information about problems that I found on projects that I am working on / managing.

General Analyzer Rules

  • AL0604 (for Runtimes under 6.0)
    • DESCRIPTION: Use of implicit with
    • AL TEXT: Use of implicit ‘with’ will be removed in the future. Qualify with ‘Rec.’. This warning will become an error in a future release.
    • CURRENT PROBLEM: This warning should be shown (together with linked quick fix) only for Runtime >= 6. For Runtimes below this, some required functionality (like Editable/Enable = Rec.”Field Name”) is not supported.
    • LINKS: https://github.com/microsoft/AL/issues/6095

CodeCop Analyzer Rules

  • AA0072
    • DESCRIPTION: The name of variables and parameters must be suffixed with the type or object name.
    • AL TEXT: The name of {0} is not valid. The name of variables and parameters must be suffixed with the type or object name.
    • CURRENT PROBLEM: This rule is still under discussion on AL GIT due to some unexpected/strange behaviour. The most discussed issues are: Whether the company prefix/suffix of the object should be mandatory in variables names; Whether reserved words should be avoided; That subscribers parameters should not be check (as it’s not a problem of subscriber but of published); …
    • LINKS: https://github.com/microsoft/AL/issues/6120
  • AA0150
    • DESCRIPTION: Do not declare parameters by reference if their values are never changed.
    • AL TEXT: Parameter ‘{0}’ is declared by reference but never changed in method ‘{1}’.
    • CURRENT PROBLEM: The rule checks parameters in Codeunits that implements interfaces with methods that contain reference parameters. This should not be check.
    • LINKS: https://github.com/microsoft/AL/issues/6211
  • AA0232
    • DESCRIPTION: The FlowField of a table should be indexed.
    • AL TEXT: The FlowField {0} of {1} should be added to the SIFT key.
    • CURRENT PROBLEM: The rule does not respect field type and suggests adding SIFT index on non-numeric fields (like date, datetime, …).
    • LINKS: https://github.com/microsoft/AL/issues/6140
  • AA0240
    • DESCRIPTION: Email and Phone No must not be present in any part of the source code.
    • AL TEXT: The {0} ‘{1}’ must not contain email addresses or phone numbers.
    • CURRENT PROBLEM: This rule currently checks translation files and evaluate some field (or other) IDs of an object as a phone number.
    • LINKS: https://github.com/microsoft/AL/issues/6039

Recent Articles from the category

BC Open Source? How to start?

BC Open Source? How to start?

BC Open Source? How to start? One of the most exciting news introduced last month in Lyon during Directions EMEA 2023 was the changes to the open-source initiative. This means that you can now contribute to the source code of the Base app and the System app, which are...

read more
Validate a FlowField Field. Wait? What?

Validate a FlowField Field. Wait? What?

Validate a FlowField Field. Wait? What? There are not many things in the AL Language that surprised me. However, last week, I found one such thing - I reviewed customizations made by another partner and had to analyze the OOTB code of the Demand Forecast matrix. I run...

read more
Dynamics NAV 2013 & Expired Cronus License

Dynamics NAV 2013 & Expired Cronus License

We found an interesting problem - we were not able to run the development environment for Dynamics NAV 2013. Whenever we tried to run the development client, we got the following error message: "Your program license has expired" and the development client has closed...

read more
Indirect Dependencies and Access Modifiers

Indirect Dependencies and Access Modifiers

Last week, there was a discussion on Yammer on how to get values from the "Sent Email" record when all fields are marked as Internal. I was surprised that many people do not know what can/can't access modifiers (such as local, protected, or internal) be used for. I...

read more

Sign Up for News

Certifications

Highest certification
Microsoft Data Management and
also in D365 Business Central

Microsoft Certified: Dynamics 365 Business Central Functional Consultant Associate

See other certifications here