{"id":891,"date":"2019-01-14T21:53:41","date_gmt":"2019-01-14T20:53:41","guid":{"rendered":"https:\/\/craftcoders.app\/?p=891"},"modified":"2024-08-14T15:29:10","modified_gmt":"2024-08-14T13:29:10","slug":"clean-code-the-hard-facts-and-figures","status":"publish","type":"post","link":"https:\/\/craftcoders.app\/clean-code-the-hard-facts-and-figures\/","title":{"rendered":"Clean Code: The hard facts and figures"},"content":{"rendered":"\r\n

A couple of weeks ago I began to read Uncle Bob’s old developer bible: Clean Code. I was excited about the presented concepts and put a lot of thought into applying them into code. One day I was lying on the couch of our office, reading Chapter 2: Meaningful Names.<\/em> Meanwhile, I overheard our team discussing the best troll name for a new database. Another day, I was reading the next chapter. Chapter 3: Functions should be small and do one thing only.<\/em> Back at my desk, I found myself scrolling through functions with hundreds of lines of code.<\/p>\r\n\r\n\r\n\r\n

Although most teams I know try to produce clean code, it seems to be a hard thing to keep a project clean while it grows. I began to wonder: How much clean code is really out there in the wild? Followed by: How can a project even be considered as clean? So I picked some famous open source projects and analyzed them!<\/p>\r\n\r\n\r\n\r\n

What makes a project clean?<\/h2>\r\n\r\n\r\n\r\n

First, let’s summarize what I did: My first intent was to check a static code analysis tool like SonarQube, but I could hardly find an open-source project which also published the results of such tooling. This is when Metrilyzer<\/a> was born. An analysis tool of mine (private projects again<\/a>^^) which can read almost every Java-based project to do some data analysis on it. At first, I focused on the following metrics:<\/p>\r\n\r\n\r\n\r\n