“How can I get Bill to stop writing spaghetti code” is only superficially a technical problem. In reality, it presents a human problem.
Actually, it's a management problem. Management must establish and enforce proper process and culture.
Necessary but not sufficient:
1. Code standards, determined and agreed upon together
2. Peer review against those standards
3. Requirements Definition policies and procedures
4. Function Specification policies and procedures
5. Unit Testing policies and procedures
6. Technical debt policies and procedures (when to grandfather)
None of this has to be that complicated. When the rules are understandable, logical, and everyone agrees to play by them, this takes the monkey off everyone's back. You don't have to worry about approaching Bill about his bad code. You have a "business framework" you can rely upon to take care of that for you. Then no one's the bad guy. This is just good basic I.T. management.Spaghetti code by others is the norm. I have maintained the shitty code of thousands of others. If they're gone, I cuss them all day long. If they're still here, I'm nice. I help management build the processes needed so that I can stay nice. I do my job. I expect management to do theirs.