I've been in an acquisition where code quality was important. But it was probably an edge case since the buyer just wanted to turn the company into a feature, and ease of integration into the buyer was important.