spaghetti code
expressionprogramming
Code whose control flow is so tangled it is nearly impossible to follow.
The name pictures a plate of noodles: jumps and branches cross each other until tracing one path means tracing them all. Classically caused by unrestricted goto, it now describes any codebase where everything is entangled with everything else.
Spaghetti code is control flow you cannot follow: execution jumps around unpredictably, state is modified from everywhere, and understanding one part requires understanding all of it. The metaphor is precise, because the defining property is tangling rather than volume.
The term dates to the era when goto was the primary control structure, and the structured programming movement was largely a response to it. That war was won, which is why the modern version wears different clothes: not gotos, but a dozen classes that call each other in a cycle, events triggering handlers that fire more events, or a chain of conditionals nobody dares simplify because the behaviour is load-bearing and untested.
The honest observation is that nobody writes it deliberately. It accumulates through reasonable local decisions made under time pressure by people who could not see the whole, which is why blaming individuals misses the mechanism. The defences are structural: boundaries that constrain what can call what, tests that make refactoring safe enough to attempt, and reviews that ask whether a change makes the shape better or only makes the ticket close.
Also known as: spaghetti, tangled code