LinterCop
LinterCop inspects procedure bodies for code that is valid but harder to read, change or keep fast than it needs to be: cognitive complexity, redundant statements, patterns with a modern AL replacement. Nothing breaks when a LinterCop rule is ignored; the cost lands on whoever maintains the code next. It is the ALCops counterpart of the linters used in other languages, and the direct continuation of BusinessCentral.LinterCop .
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 | ✓ | |
| LC0097 | Avoid mixing exit() and named return variable assignments | Info | — | |
| LC0098 | Event subscriber name does not match the configured template | Info | ✓ | ✓ |
| LC0099 | Event subscriber parameter is not referenced | Info | ✓ | ✓ |