{"id":6557,"date":"2014-10-09T09:14:13","date_gmt":"2014-10-09T07:14:13","guid":{"rendered":"http:\/\/daniel.haxx.se\/blog\/?p=6557"},"modified":"2014-10-09T09:14:13","modified_gmt":"2014-10-09T07:14:13","slug":"coverity-scan-defect-density-0-00","status":"publish","type":"post","link":"https:\/\/daniel.haxx.se\/blog\/2014\/10\/09\/coverity-scan-defect-density-0-00\/","title":{"rendered":"Coverity scan defect density: 0.00"},"content":{"rendered":"<p>A couple of days ago I decided to stop slacking and grab this long dangling item in my TODO list: run the <a href=\"https:\/\/scan.coverity.com\/\">coverity scan<\/a> on a recent <a href=\"http:\/\/curl.haxx.se\/\">curl<\/a> build again.<\/p>\n<p>Among the static analyzers, <a href=\"http:\/\/daniel.haxx.se\/blog\/2012\/07\/12\/three-static-code-analyzers-compared\/\">coverity does in fact stand out<\/a> as the very best one I can use. We run <a href=\"http:\/\/curl.haxx.se\/scans\/\">clang-analyzer against curl every night<\/a> and it hasn&#8217;t report any problems at all in a while. This time I got almost 50 new issues reported by Coverity.<\/p>\n<p>To put it shortly, a little less than half of them were issues done on purpose: for example we got several reports on ignored return codes we really don&#8217;t care about and there were several reports on dead code for code that are conditionally built on other platforms than the one I used to do this with.<\/p>\n<p>But there were a whole range of legitimate issues. Nothing really major popped up but a range of tiny flaws that were good to polish away and smooth out. Clearly this is an exercise worth repeating every now and then.<\/p>\n<h2>End result<\/h2>\n<p>21 new curl commits that mention Coverity. Coverity now says &#8220;<strong>defect density: 0.00<\/strong>&#8221; for curl and libcurl since it doesn&#8217;t report any more flaws. (That&#8217;s the number of flaws found per thousand lines of source code.)<\/p>\n<h2>Want to see?<\/h2>\n<p>I can&#8217;t seem to make all the issues publicly accessible, but if you do want to check them out in person just click over to the <a href=\"https:\/\/scan.coverity.com\/projects\/37\">curl project page at coverity<\/a> and &#8220;request more access&#8221; and I&#8217;ll grant you view access, no questions asked.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A couple of days ago I decided to stop slacking and grab this long dangling item in my TODO list: run the coverity scan on a recent curl build again. Among the static analyzers, coverity does in fact stand out as the very best one I can use. We run clang-analyzer against curl every night &hellip; <a href=\"https:\/\/daniel.haxx.se\/blog\/2014\/10\/09\/coverity-scan-defect-density-0-00\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Coverity scan defect density: 0.00<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,11,6],"tags":[348,196,33,343],"class_list":["post-6557","post","type-post","status-publish","format-standard","hentry","category-curl","category-development","category-floss","tag-clang-analyzer","tag-coveritycom","tag-curl-and-libcurl","tag-source-code"],"_links":{"self":[{"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/posts\/6557","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/comments?post=6557"}],"version-history":[{"count":9,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/posts\/6557\/revisions"}],"predecessor-version":[{"id":6566,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/posts\/6557\/revisions\/6566"}],"wp:attachment":[{"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/media?parent=6557"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/categories?post=6557"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/tags?post=6557"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}