LinterCop
The LinterCop is a code linter for AL, comparable to widely used static analysis linters in other programming languages. It flags code quality issues, measures complexity, and promotes modern AL patterns. The code it flags is technically valid, but can be written in a cleaner, more maintainable or more idiomatic way.
Rules
| ID | Title | Severity | Enabled | Code Fix |
|---|---|---|---|---|
| LC0003 | Object ID should not be in declaration | Info | ✓ | ✓ |
| LC0007 | Maintainability Index metric | Info | ✓ | |
| LC0008 | Maintainability Index threshold exceeded | Warning | ✓ | |
| LC0009 | Cyclomatic Complexity metric | Info | ✓ | |
| LC0010 | Cyclomatic Complexity threshold exceeded | Warning | ✓ | |
| LC0019 | DataClassification redundancy | Info | ✓ | ✓ |
| LC0020 | ApplicationArea redundancy | Info | ✓ | ✓ |
| LC0028 | Identifiers in event subscribers | Warning | ✓ | |
| LC0031 | Record instance isolation level | Warning | ✓ | ✓ |
| LC0033 | App manifest runtime behind | Warning | ✓ | |
| LC0040 | Explicitly set RunTrigger | Info | ✓ | |
| LC0043 | Use SecretText for sensitive text | Warning | ✓ | |
| LC0048 | Error invocation using text constant | Warning | ✓ | |
| LC0052 | Internal procedure not referenced | Warning | ✓ | |
| LC0053 | Internal procedure only used in current object | Info | ✓ | |
| LC0054 | Interface object name guide | Info | ✓ | |
| LC0063 | API page canonical field name guide | Info | ✓ | |
| LC0081 | Use IsEmpty method instead of Count | Info | ✓ | |
| LC0082 | Use Query or Find with Next instead of Count | Info | ✓ | |
| LC0083 | Use built-in date/time methods | Info | ✓ | ✓ |
| LC0086 | Page style should not use string literal | Warning | ✓ | |
| LC0088 | Option type should be Enum | Info | ✓ | |
| LC0089 | Cognitive Complexity metric | Info | ✓ | |
| LC0090 | Cognitive Complexity threshold exceeded | Warning | ✓ | |
| LC0094 | AllowInCustomizations redundancy | Warning | ✓ | ✓ |