A huge chunk of a "legacy codebase" is "sloppy code that shouldn’t have been written"

Unless you're inheriting code written by Bill Atkinson or something.