CodeCop Analyzer Rules

CodeCop is an analyzer that enforces the official AL Coding Guidelines.

Rules

IdTitleCategoryDefault severity
AA0001There must be exactly one space character on each side of a binary operator such as := + - AND OR =.ReadabilityWarning
AA0002There must be no space character.ReadabilityWarning
AA0003There must be exactly one space character between the NOT operator and its argument.ReadabilityWarning
AA0005Only use BEGIN..END to enclose compound statements.ReadabilityWarning
AA0008Function calls should have parenthesis even if they do not have any parameters.ReadabilityWarning
AA0013When BEGIN follows THEN, ELSE, DO, it should be on the same line, preceded by one space character.ReadabilityWarning
AA0018The END, IF, REPEAT, UNTIL, FOR, WHILE, and CASE statement should always start a line.ReadabilityWarning
AA0021Variable declarations should be ordered by type.ReadabilityWarning
AA0022Substitute the IF THEN ELSE structure with a CASE.ReadabilityWarning
AA0040Avoid using nested WITH statements.ReadabilityWarning
AA0050Permission set extensions should not include permissions for objects defined in another application.DesignWarning
AA0051Permission set extensions should not include permission sets defined in another application.DesignWarning
AA0052Permission set extensions should not include permission sets which include permissions for objects defined in another application.DesignWarning
AA0053Permission set extensions should not include wildcard permissions.DesignWarning
AA0072The name of variables and parameters must be suffixed with the type or object name.ReadabilityInfo
AA0073The name of temporary variable must be prefixed with Temp.ReadabilityWarning
AA0074TextConst and Label variable names should have an approved suffix.ReadabilityWarning
AA0087Lowering permissions should only be used in testsDesignWarning
AA0100Do not have identifiers with quotes in the name.DesignWarning
AA0101Use camel case property values in pages of type API.DesignWarning
AA0102Use camel case name for field controls in pages of type API.DesignWarning
AA0103Use camel case property values in queries of type API.DesignWarning
AA0104Use camel case name for column controls in queries of type API.DesignWarning
AA0105PagePart controls must not refer to parent pages.DesignError
AA0106A page of type API can only refer to the same subpage once.DesignError
AA0131String parameters must match placeholders.DesignWarning
AA0136Do not write code that will never be hit.DesignWarning
AA0137Do not declare variables that are unused.DesignWarning
AA0139Do not assign a text to a target with smaller size.DesignWarning
AA0150Do not declare parameters by reference if their values are never changed.DesignWarning
AA0161Only use AssertError in Test Codeunits.DesignWarning
AA0175Only find record if you need to use it.DesignWarning
AA0181The FindSet() or Find() methods must be used only in connection with the Next() method.DesignWarning
AA0189Only use a correct values of ApplicationArea.DesignWarning
AA0194Only write actions that have an effect.DesignWarning
AA0198Do not use identical names for local and global variables.DesignWarning
AA0199Use only a correct order for ApplicationArea.DesignWarning
AA0200When ApplicationArea is set to 'All', no other values for ApplicationArea should be specified.DesignWarning
AA0201When ApplicationArea is set to 'Basic', you must also specify 'Suite'.DesignWarning
AA0202To avoid confusion, do not give local variables the same name as fields, methods, or actions in the same scope.DesignWarning
AA0203To avoid confusion, do not give methods the same name as fields or actions in the same scope.DesignWarning
AA0204To avoid confusion, do not give global variables the same name as fields, methods, or actions in the same scope.DesignWarning
AA0205Variables must be initialized before usage.DesignWarning
AA0206The value assigned to a variable must be used.DesignWarning
AA0207The EventSubscriber method must be local.DesignWarning
AA0210Avoid non-indexed fields into filtering.DesignInfo
AA0211Avoids a runtime error from using CalcFields on a field that is not a FlowField or a field of type Blob.DesignWarning
AA0213Obsoleted object must have a state 'Pending' or 'Removed' and a justification specifying why this field is being obsoleted.DesignWarning
AA0214The local record should be modified before saving to the database.DesignWarning
AA0215Follow the style guide about the best practices for naming.ReadabilityWarning
AA0216Use a text constant for passing user messages and errors without concatenations.LocalizabilityWarning
AA0217Use a text constant or label for format string in StrSubstNo.LocalizabilityWarning
AA0218You must write a tooltip in the Tooltip property for all controls of type Action and Field that exist on page objects.LocalizabilityWarning
AA0219The Tooltip property of Fields should start with 'Specifies'.LocalizabilityInfo
AA0220The value of the Tooltip property of Fields must be filled.LocalizabilityWarning
AA0221You must specify a OptionCaption property for all fields which source expressions is not a table field.LocalizabilityWarning
AA0222SIFT index should not be used on primary or unique key.DesignWarning
AA0223The value of the OptionCaption property of Fields must be filled in.LocalizabilityWarning
AA0224The count of option captions specified in the OptionCaption property is wrong.LocalizabilityWarning
AA0225You must specify a caption in the Caption property for Fields that exist on page objects.LocalizabilityWarning
AA0226The value of the Caption property of Fields must be filled in.LocalizabilityWarning
AA0227Optional return value should not be omitted in upgrade codeunits.DesignWarning
AA0228The local method must be used; otherwise removed.DesignWarning
AA0230Version should not be specified for internal assemblies.DesignWarning
AA0231StrSubstNo or string concatenation must not be used as a parameter in the Error method.DesignWarning
AA0232The FlowField of a table should be indexed.DesignInfo
AA0233Use Get(), FindFirst() and FindLast() without Next() method.DesignWarning
AA0234You should write a tooltip in the Tooltip property for all fields on table objects.LocalizabilityInfo
AA0235When using 'OnInstallAppPerCompany' you should also add 'Company-Initialize'::'OnCompanyInitialize' event subscriber.DesignInfo
AA0237The name of non-temporary variables must not be prefixed with Temp.ReadabilityWarning
AA0240Email and Phone No must not be present in any part of the source code.DesignWarning
AA0241Use all lowercase letters for reserved language keywords.ReadabilityHidden
AA0242Limit JIT loads by selecting all fields for load.DesignWarning
AA0243Running an upgrade codeunit is not allowed.DesignWarning
AA0244Do not use identical names for parameters and global variables.DesignWarning
AA0245To avoid confusion, do not give parameters the same name as fields, methods, or actions in the same scope.DesignWarning
AA0246Suppressing all diagnostics is not allowed.DesignWarning
AA0247Use namespaces.DesignInfo
AA0248Add 'this' qualification to improve readability.ReadabilityHidden
AA0249PageField trigger is unused due to a property value.DesignWarning
AA0250External business event should have obsolete marker.DesignWarning
AA0251External business event with obsolete marker must have the obsolete attribute set.DesignError
AA0252Moving external business events to another app is not allowed.DesignError
AA0448You must use the FieldCaption method instead of the FieldName method and TableCaption method instead of TableName method.LocalizabilityWarning
AA0462The CalcDate should only be used with DataFormula variables. Alternatively the string should be enclosed using the <> symbols.LocalizabilityWarning
AA0470Placeholders should have a comment explaining their content.LocalizabilityWarning
AA0471Page control fields of type 'Decimal' must have the property AutoFormatType specified.LocalizabilityInfo
AA0472Page control fields having amount AutoFormatType defined must have the property AutoFormatExpression specified.LocalizabilityInfo
AA0473Table control fields of type 'Decimal' must have the property AutoFormatType specified.LocalizabilityInfo
AA0474Table control fields that have amount AutoFormatType defined, must have the property AutoFormatExpression specified.LocalizabilityInfo
AA0475Truncate can only be used on normal tables without media fields and outside of try functions.DesignError
AA0476The AI test configuration is not valid.DesignError
AA0477Unordered using statementsReadabilityInfo

Using the Code Analysis Tool
Ruleset for the Code Analysis Tool
Using the Code Analysis Tools with the Ruleset