Wednesday, 4 November 2020

What Code Analyzers are right for you?

A code analyzer is a library that builds on the compiler's functionality to offer enhanced analysis of the syntax and semantics of your code at build time. The AL Language extension for Visual Studio Code contains four analyzers:

·        CodeCop is an analyzer that enforces the official AL Coding Guidelines. For more information about the CodeCop rules, see CodeCop Analyzer Rules.

·        PerTenantExtensionCop is an analyzer that enforces rules that must be respected by extensions meant to be installed for individual tenants. For more information about the PerTenantExtensionCop rules, see PerTenantExtensionCop Analyzer Rules.

·        AppSourceCop is an analyzer that enforces rules that must be respected by extensions meant to be published to Microsoft AppSource. For more information about the AppSourceCop rules, see AppSourceCop Analyzer Rules.

·        UICop is an analyzer that enforces rules that must be respected by extensions meant to customize the Web Client. For more information about the UserInterfaceCop rules, see UICop Analyzer Rules.

  

If you are developing an app for AppSource (ISV, Add-on Apps) then you need to enable below Code Analyzers

AppSourceCop 

CodeCop 

UICop 

 



If you are developing a customization for a specific customer then you need to enable below code analyzers

PerTenantExtensionCop 

CodeCop 

UICop 




Do not forget to set "al.enableCodeAnalysis"true