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 | Do not use Object IDs as object references | Warning | ✓ | ✓ |
| LC0007 | Maintainability Index metric | Hidden | ||
| LC0008 | Maintainability Index threshold exceeded | Warning | ✓ | |
| LC0009 | Cyclomatic Complexity metric | Info | ✓ | |
| LC0010 | Cyclomatic Complexity threshold exceeded | Warning | ✓ | |
| LC0019 | DataClassification redundancy | Warning | ✓ | ✓ |
| LC0020 | ApplicationArea redundancy | Info | ✓ | ✓ |
| LC0028 | Use identifier syntax in event subscriber arguments | Warning | ✓ | |
| LC0031 | Use ReadIsolation instead of LockTable | Info | ✓ | ✓ |
| LC0033 | App manifest runtime is behind target version | Warning | ✓ | |
| LC0040 | Explicitly set RunTrigger | Info | ✓ | |
| LC0043 | Use SecretText for sensitive text | Warning | ✓ | |
| LC0048 | Use Error with ErrorInfo or Label instead of Text | Warning | ✓ | |
| LC0052 | Internal procedure not referenced | Warning | ✓ | |
| LC0053 | Internal procedure only used in current object | Warning | ✓ | |
| LC0054 | Interface object name guide | Hidden | ||
| LC0063 | API page canonical field name guide | Info | ✓ | |
| LC0081 | Use IsEmpty method instead of Count | Warning | ✓ | |
| LC0082 | Use Query or Find with Next instead of Count | Info | ✓ | |
| LC0083 | Use new Date/Time/DateTime methods for extracting parts | Info | ✓ | ✓ |
| LC0086 | Page style should not use string literal | Warning | ✓ | |
| LC0088 | Prefer Enum over Option type | Info | ✓ | |
| LC0089 | Cognitive Complexity metric | Hidden | ||
| LC0090 | Cognitive Complexity threshold exceeded | Warning | ✓ | |
| LC0091 | Translatable text should be translated | Warning | ✓ | |
| LC0092 | Name does not match naming convention | Warning | ✓ | |
| LC0094 | AllowInCustomizations redundancy | Warning | ✓ | ✓ |
| LC0095 | Parameter is not referenced | Warning | ✓ | ✓ |
| LC0096 | Unnecessary record parameter in method call | Warning | ✓ |