The 340-Line Function And The 40-Line Rule
Decide what you would do from the brief alone, including whether you would change anything at all. Everything below it is available, but the exercise stops working if you open it first.
processShipment() is 340 lines. The team standard is forty lines per function and the linter now fails the build. Split it.
Cutting it at line boundaries into processShipmentPart1, Part2 and Part3, each taking a mutable ctx object that carries the twenty locals between them. Every function is now under the limit, the build passes, and the diff is provably behaviour-preserving. The reader is worse off. To understand part two you must know what part one left in ctx, so coupling that used to be visible as a local variable is now invisible ordering coupling across three functions, unenforced by anything. A 340-line function you can read top to bottom is less dangerous than three 110-line functions that must be called in one order for reasons written down nowhere (Temporal Coupling).
Read this even if you are confident. It is here rather than behind a button because it is the answer most teams actually ship, it passes review, and the cost of it does not arrive until the change after this one.