Parameter is not referenced
Properties
LC0095
Warning
Design
Code Fix
Ignore Obsolete
CodeCop AA0137 detects unreferenced parameters only in local procedures and explicitly excludes event subscribers. LC0095 covers the non-local, non-subscriber gaps: internal procedures and public procedures.
A parameter that is never referenced in the procedure body clutters the signature, misleads callers about what the procedure needs, and creates unnecessary coupling. Removing it simplifies both the definition and every call site.
Example
codeunit 50100 MyCodeunit
{
procedure MyProcedure(MyVariant: Variant) // Parameter 'MyVariant' is not referenced in procedure 'MyProcedure'. [LC0095]
begin
end;
}Fixed:
codeunit 50100 MyCodeunit
{
procedure MyProcedure()
begin
end;
}Covered by this rule
- Internal procedures
- Public procedures
Excluded from this rule
- Local procedures (AA0137 handles them)
- Triggers (platform-defined signatures, cannot be changed)
- Interface implementations (bound by interface contract)
- Event declarations (
[IntegrationEvent]/[BusinessEvent], parameters define the subscriber contract) - Obsolete procedures (pending or removed, not worth modifying)
Relationship to AA0137
| Scope | AA0137 | LC0095 |
|---|---|---|
| Local procedures | ✅ | ❌ (defers to AA0137) |
| Internal procedures | ❌ | ✅ |
| Public procedures | ❌ | ✅ |
| Event subscribers | ❌ | ❌ (covered by LC0099 ) |
| Triggers | ❌ | ❌ |
| Interface implementations | ❌ | ❌ |
| Event declarations | ❌ | ❌ |
See also
- AA0137 - Do not declare variables that are unused
- LC0099 - Event subscriber parameter is not referenced
- LC0052 - Internal procedure not referenced
- LC0053 - Internal procedure only used in current object