REF014: unhandled-message-handler
Message handler whose type nothing sends
| Code | REF014 |
| Name | unhandled-message-handler |
| Category | References (REF) |
| Default severity | info |
| Enabled by default | no |
| Fix available | no |
| ign-lint equivalent | none |
What it does
Section titled “What it does”Reports message handlers whose type no script sends:
- component message handlers (views): no
system.perspective.sendMessagewith that literal type in the project; - gateway, Perspective session and Vision client message handlers: no
system.util.sendMessage/sendRequest/sendRequestAsyncwith that literal handler name to the project (a literal project name,system.util.getProjectName(), or a project that is not a literal, which may be any project). Gateway resources (tag event scripts) send to every project.
The rule stays silent for a handler when a send with a computed type could
produce its name ('refresh' + suffix covers refreshTable), in
inheritable projects (projects outside the workspace may send to them),
and in projects that have resources whose scripts are not analysed
(Vision windows and templates, reports, alarm pipelines, SFC charts, event
streams).
Why is this bad?
Section titled “Why is this bad?”A handler nothing sends to is dead code, or a sign that the sender was
renamed. This rule is not in the default set: messages are also sent from
other gateways (remoteServers), from Vision clients and from scripts
that build the type from data.
Example
Section titled “Example”A view whose button has a message handler refreshTrend while every
script sends refreshTrends.
Generated from the rule metadata by iglint generate-docs; iglint rule REF014 prints the same page in the terminal. Source: docs/rules/REF014.md.