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

Collectible Errors?! Is it already in use?

Collectible Errors?! Is it already in use?

Collectible Errors?! Is it already in use? This is the second part of my new article series about Collectible Errors. Let's check out the first part here: Collectible Errors?! | Microsoft Dynamics 365 - Ing. Tomáš Kapitán (kepty.cz) or you might be interested in my...

read more
Collectible Errors?!

Collectible Errors?!

Collectible Errors?! It has been already almost a year since ErrorInfo datatype & CollectibleErrors were introduced (I already have an article about basic structure: ErrorInfo data type & Collectible Errors). This article was released for the first time in...

read more
Report layouts in Excel? Yes!!!

Report layouts in Excel? Yes!!!

Everyone is surely aware of how strong Excel is as a software. It has been deeply ingrained in corporate operations worldwide, whether it be for assessing stocks or companies, creating budgets, or organizing customer sales lists. Usage of Excel Layout Due to the fact...

read more
Substituting standard reports

Substituting standard reports

Report objects cannot be extended in versions previous to the Business Central 2021 release wave 1 version when ReportExtensions object was introduced. Since then, many of changes we need to do in reports can be done without creating a new copy of object. On the other...

read more
Isolated events

Isolated events

With Business Central 2022 wave 1, a new setting for event publishers was introduced. Until this version, any error in any event subscriber caused interruption to the current running process and stopped the whole activity. In some cases (such as log-in), this is...

read more
Custom Filter Tokens

Custom Filter Tokens

As a user of the Business Central you have some constants you can use to filter or insert values. These constants contain useful values for data manipulation such as t / today for date field - return current dateq / quarter for date field filters - return range of the...

read more
How to let users choose field(s) properly

How to let users choose field(s) properly

When some complex functionality is developed, it is sometimes necessary to let users choose a specific field. This can be required for field permissions, mapping imported values or any similar process. Earlier, the usual way was to create a link on the Field table...

read more
Working with Translation Files (XLIFF)

Working with Translation Files (XLIFF)

How does the translation file work? In Microsoft Dynamic 365 Business Central, displaying different languages is done using the XLIFF files extension (.xlf). The generated XLIFF files have strings that are specified in properties like Captions, Tooltips......

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