E1854: function has reached the size where it must be split
A function has 60 or more code lines, the size at which strict mode (--strict, ADR-0041) requires the function to be split.
A function has 60 or more code lines, the size at which strict mode
(--strict, ADR-0041) requires the function to be split. Blank lines, #
comments and """ documentation blocks do not count. E1853 reports a
function above 50 code lines and E1855 one above 80; this code is the range
between. The message names the function and the count, as in function `long` has 60 code lines; split is required at 60.
Example
The comment # catalog: repeat N stands for N copies of the lines up to
# catalog: end, with {n} replaced by the copy's number. The example is 58
bindings value_01 to value_58, so that long has 60 code lines.
Fix
Split the function into functions that each do one thing, and call them in order.
When a long function is one operation that splitting would only scatter, such
as a state machine or a register setup sequence, mark it with
meta limitless("verb") (ADR-0048). The exception is then visible in the
source and in review.
Run actus explain E1854 in your terminal to read this entry offline. Browse Strict & toolchain or all error codes.