55 rules of the open linter. Each page has the question as engineers search for it, a short answer, what the defect does to a running plant, and a bad / fixed code example verified by running the linter.
Turn rules on or off and set severity for your team (Team plan) →
undeclared-global · Global name typo (gvl.*)
ELSIF branch never runs: the previous condition already covers the whole range
unreachable-branch · Unreachable IF/ELSIF branch
TON in CODESYS never fires: the timer instance is not called every scan
uncalled-timer · Uncalled timer/trigger
Array index out of bounds in Structured Text: CODESYS does not always catch it
array-bounds · Array index out of bounds
WHILE TRUE without EXIT in a PLC: why the controller hangs
infinite-loop · Infinite loop with no exit
Division by zero in Structured Text: how to find it before site start-up
div-by-zero · Division by a literal zero
CheckDivReal or CheckBounds exists but does not protect: a hollowed-out check
broken-implicit-check · Implicit check does not protect
Two modules with the same Modbus address in a CODESYS configuration
modbus-address-duplicate · Duplicate Modbus address on modules
Analog input with no plausibility check: a broken sensor reads as 0 °C
heating-ai-no-range-check · Analog input without a plausibility check
Division by zero in CFC: a literal 0 wired into DIV
cfc-div-zero · CFC: division by a literal zero
One channel in a group never gets a field written
family-gap · Channel never written: a gap in the family
Pump 2's block input is fed with pump 1's signal
param-channel-mismatch · Channel parameter fed from another channel
Pump never starts: the start command depends on its own feedback
self-enable · Command depends on its own feedback
TON pause lasts one scan: the timer input is cleared later in the same branch
timer-reset-by-own-condition · Timer cleared by its own run condition
TOF never switches off: the timer input is re-armed in the same branch
timer-rearmed-by-own-branch · Off-delay never expires
TOF is only called while its input is high: the off-delay never runs
timer-off-delay-in-own-branch · Off-delay is not called when it should be counting
Two calls of the same timer in a row with different inputs
fb-call-overwritten · A second call to the instance overwrites the first
R_TRIG fires only once: the edge detector never sees the input drop
edge-lost-in-own-branch · An edge input never sees the drop, so only the first event counts
Timer has no PT preset anywhere: the output comes at once
fb-preset-missing · The instance has no preset anywhere
An alarm can never trip: the condition is always false after substitution
always-false-condition · Condition can never be true
A wired module input has its sensor type set to Off
channel-sensor-off · Sensor type cleared on a wired channel
An analog module output is mapped but no signal type is selected
channel-output-off · Module output left unconfigured
An I/O module excluded from polling and forgotten
module-disabled · Module excluded from polling
int-division · Integer division (lost fraction?)
REAL_TO_TIME(x) * 1000 truncates the setpoint: 2.7 s becomes 2 s
real-to-time-mul · REAL_TO_TIME(...)*N truncates the setpoint
REAL_TO_WORD(x) * N: can the WORD overflow
real-to-word-mul · REAL_TO_WORD(...)*N may overflow WORD
No POUs for Implicit Checks in a CODESYS project: what it changes
missing-implicit-checks · No POUs for implicit checks (runtime guards)
A Check function exists in the project but is not active
implicit-check-disabled · Check present but not active
CODESYS task watchdog disabled: why it is dangerous
watchdog-disabled · Task watchdog disabled
Timer with PT := T#0S: there is no delay
timer-zero-pt · Timer with zero delay (PT := T#0)
CASE without ELSE in Structured Text: what happens on an unexpected value
case-without-else · CASE without an ELSE branch (no default)
Assigning a variable to itself, x := x, in Structured Text
self-assignment · Assignment of a variable to itself
Empty IF branch or empty loop in Structured Text
empty-branch · Empty IF/loop branch
One line in a group of similar assignments writes to another channel
index-mismatch · Line indexes differently from its group
An alarm signal is read but nothing ever writes it
signal-without-source · Nothing ever raises this alarm
Comparing UINT or WORD with zero: IF x < 0 never runs
unsigned-vs-zero · Unsigned compared against zero
One write in a series goes to a different exchange buffer
write-series-outlier · One write in a series goes to another buffer
Two programs write the same cells of an exchange array
array-write-overlap · Two POUs write the same array cells
A block parameter is taken from another unit's settings
param-family-outlier · Parameter fed from another unit's settings
An output freezes when no mode branch applies
output-stuck-outside-modes · Output freezes when no mode branch applies
FOR i := 0 TO n - 1 with an unsigned n: a 65535-iteration loop
for-unsigned-minus-one · Loop up to X - 1 with an unsigned X
Modbus slave buffer window shifted but its size left unchanged
buffer-window-overrun · Buffer window shifted but size unchanged
DHW: the heating valve opens when the sensor fails
heating-dhw-fault-opens · DHW: valve opens on a sensor fault
One variable shown on screen under two different captions
visu-two-labels · One variable under two captions
The number in an element caption differs from the variable index
visu-index-mismatch · Caption number differs from the index
double-semicolon · Double ;; (empty statement)
A POU nobody calls: dead code in a CODESYS project
dead-pou · Dead code: a POU nobody calls
Single-letter variable names in PLC code: why they hurt
naming · Cryptic variable name
Magic numbers in PLC code: why move a constant to VAR CONSTANT
magic-number · Magic number: a raw constant in code
A POU without a single comment: the minimum PLC code needs
missing-comments · POU without a single comment
PLC routine too long: when to split it into function blocks
routine-size · Bloated routine (decomposition candidate)
Copy-pasted logic in a PLC program: why duplication is risky
copy-paste · Duplicated logic block (copy-paste)
Deeply nested IF in PLC code: how to simplify it
deep-nesting · Deep IF nesting
Unused local variable in a POU
unused-local · Unused local variable
PLCopen variable naming: x, i, r, t prefixes
plcopen-naming · Name off the PLCopen standard
Check your project Local version on GitHub →