Some more details.
You need an advisor who will be direct when they think there are issues with your code or the timeliness of your deliverables
To be clear, I was late on my deliverables (because I had lost sleep thinking about what to do about the other stuff but that's besides the point.) However, I was being yelled at while doing another thing that was asked for, explicitly due in 2 hours. (during the meeting he asked for this, he went on a long tirade about being the strong man for yelling and "embarrassing himself") I'm not saying I wasn't in the wrong, it was just the straw that broke the camels back for me.
My advisor has given me lots of feedback. It conflicts day from day and is completely impossible to follow. (A few weeks ago he told he "Finally understands" my place in on the team, as the one who "Understands things".) He also doesn't know how to program (in the computer science department) so he has no concept of the actual quality of my code.
The quality of my code is not the issue. I am offended that my work was insulted in front of my peers behind my back.