Skip to content

Check UnusedVariable

github-actions[bot] edited this page Apr 6, 2026 · 10 revisions

unused-variable - If a local variable is declared but not used, it is dead code and should be removed. Doing so will improve maintainability as developers will not wonder what the variable is used for

Non-compliant Code Example

_method exemplar.hello(name)
  _local message << "Hello " + name  # message is an unused variable
  print("Hello " + name)
_endmethod

Compliant Code Example

_method exemplar.hello(name)
  _local message << "Hello " + name
  print(message)
_endmethod

Non-compliant Code Example

If you have enabled checking the parameters as well, you should use all parameters as well.

_method exemplar.hello(name) # name is an unused parameter
  _local message << "Hello World!"
  print(message)
_endmethod

Compliant Code Example

_method exemplar.hello(name)
  _local message << "Hello " + name
  print(message)
_endmethod

Options

Option Default value Description
unused-variable.check-parameters false Check for unused parameters

Note

This page is generated. Any changes made to this page through the wiki will be lost in the future.

Clone this wiki locally