Linux topped open source software in quality in a study of the defects that occur in the software development process. For more than seven years, Coverity Scan Service analyzed 850 million lines of code from more than 300 open source projects, including those written in Linux, PHP, and Apache. Using a measure of defects per 1,000 lines of code, the study found that Linux consistently recorded defect densities of less than 1.0, with versions scanned between 2011 and 2012 having defect rates below 0.7. The study also found that high-risk defects were prevalent in the software development process, with 36 percent of defects classified as a "threat to overall software quality and security if undetected." The most common high-risk defects included memory corruption, illegal memory access, and resource leaks, which the study's report says are "all difficult to detect without automated code analysis." The study also found that the average quality of open source software was virtually equal to that of proprietary software.