Sloppy code usually has sloppy ideas behind it. Clear thinking begets competent execution. I'd be really wary of any codebase that doesn't pass the smell test, because usually when you really get into it you find flawed premises left and right.
The ideas underlying the implementation are not necessarily tied to the implementation given the skill gap.