Coverity has released its 2012 Coverity Scan Open Source Report, which scanned and analyzed the quality of 450 million lines of code. It looked at both open source projects and proprietary code created by Coverity customers' enterprise application development teams. The company found that the defect rate for open source code and proprietary code were remarkably similar: .69 defects per 1,000 lines for open source to .68 defects per 1,000 lines for proprietary code. The industry standard for quality code is a defect rate of 1.0.
Interestingly, the report found that "as projects surpass one million lines of code, there's a direct correlation between size and quality for proprietary projects, and an inverse correlation for open source projects."