Skip to content

SCR109: self-assignment

Variable assigned to itself

Code SCR109
Name self-assignment
Category Scripts (SCR)
Default severity warning
Enabled by default yes
Fix available no
ign-lint equivalent none

Reports x = x and the matching positions of a, b = a, b.

Not reported in class bodies (x = x there copies a module variable into the class) and when the value is a builtin or an Ignition global (len = len makes a module-level alias).

The statement does nothing. Usually another name was meant on one side (self.value = value written as value = value).

def valueChanged(self, previousValue, currentValue, origin, missedEvents):
currentValue = currentValue

Use instead:

def valueChanged(self, previousValue, currentValue, origin, missedEvents):
self.custom.current = currentValue

Corresponds to W0127 self-assigning-variable.


Generated from the rule metadata by iglint generate-docs; iglint rule SCR109 prints the same page in the terminal. Source: docs/rules/SCR109.md.