{"id":12096,"date":"2014-04-23T12:16:42","date_gmt":"2014-04-23T09:16:42","guid":{"rendered":"https:\/\/mozaicworks.com\/?p=6924"},"modified":"2022-02-01T17:59:33","modified_gmt":"2022-02-01T15:59:33","slug":"measuring-code-quality","status":"publish","type":"post","link":"https:\/\/mozaicworks.com\/blog\/measuring-code-quality","title":{"rendered":"Measuring code quality"},"content":{"rendered":"
In about six weeks I’ll attend the second edition of I T.A.K.E. Unconference<\/a>. “Preparing” for it, I decided to take a look at the videos for some of the talks that I missed last year. Today, I watched The Good, the Bad and the Ugly of Dealing with Smelly Code<\/a> by Radu Marinescu<\/a>.<\/p>\n Watching it has reinforced my belief that we can (and should) try to be more specific about measuring the code quality<\/strong>. I meet quite often teams that only track the number of reported production bugs. This is a good metric, and one I recommend, but it shouldn’t be the only thing you measure. Why? For at least a few reasons:<\/p>\n So, what is Radu suggesting that we do? Well, he argues that we should augment our toolset by adding applications which measure and visualize quality at the class and module level. This way, we can control quality.<\/p>\n A popular tool for code analysis is SonarQube<\/a>, which supports 20 languages, but there’s a Wikipedia page<\/a> that lists tens of others.\u00a0Radu himself has been part of a team which develops two products for the same purpose: inFusion<\/a> and inCode<\/a>. You should check them out. They not only provide standards metrics like lines of code per class or cyclomatic complexity, but they have heuristic engines which can detect code smells like God Class<\/a> or Feature Envy<\/a>. If you use inFusion or inCode, you can also take advantage of another tool called CodeCity<\/a>, which represents your code graphically, just like a city with buildings. The image above is actually generated using this tool.<\/p>\n Some more advice I took from Radu’s talk:<\/p>\n What about you? How do you ensure a high code quality? What tools are you using for code analysis? Let me know in the comments.<\/p>\n Also, if you’d like to learn more about the quality of your code or playing with data, don’t miss this year’s edition of I T.A.K.E. Unconference<\/a>. A couple of sessions that I find interesting:\u00a0Aki Salmi \u2013 Refactoring Legacy Code \u2013 a true Story<\/a>\u00a0and\u00a0Martin Naumann \u2013 Open Data Wizardry 101<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":" In about six weeks I’ll attend the second edition of I T.A.K.E. Unconference. “Preparing” for it, I decided to take a look at the videos for some of the talks that I missed last year. Today, I watched The Good, the Bad and the Ugly of Dealing with Smelly Code by Radu Marinescu. Watching it […]<\/p>\n","protected":false},"author":4,"featured_media":6927,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"footnotes":""},"categories":[1103,1126],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/mozaicworks.com\/wp-json\/wp\/v2\/posts\/12096"}],"collection":[{"href":"https:\/\/mozaicworks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mozaicworks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mozaicworks.com\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/mozaicworks.com\/wp-json\/wp\/v2\/comments?post=12096"}],"version-history":[{"count":2,"href":"https:\/\/mozaicworks.com\/wp-json\/wp\/v2\/posts\/12096\/revisions"}],"predecessor-version":[{"id":14308,"href":"https:\/\/mozaicworks.com\/wp-json\/wp\/v2\/posts\/12096\/revisions\/14308"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mozaicworks.com\/wp-json\/wp\/v2\/media\/6927"}],"wp:attachment":[{"href":"https:\/\/mozaicworks.com\/wp-json\/wp\/v2\/media?parent=12096"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mozaicworks.com\/wp-json\/wp\/v2\/categories?post=12096"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mozaicworks.com\/wp-json\/wp\/v2\/tags?post=12096"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}\n
\n