I think low quality code is probably correlated with open source, but the causality runs in the other direction. It's easy to write garbage and throw it up on Github as your only deliverable, whereas the minimum deliverable for closed source is a functional binary.
Which is why FUD like this is so dangerous. It makes sense in PHB land where they don't understand that a programmer doesn't just use the first hit for a given functionality, but investigates whether it's actually worthwhile to use.