{
    "href": "/post/2014/04/21/submit-to-the-central-scrutinizer/",
    "relId": "2014/04/21/submit-to-the-central-scrutinizer",
    "title": "Submit To The Central Scrutinizer",
    "author": "pmjones",
    "markup": "html",
    "tags": [
        {
            "href": "/tag/aura/",
            "relId": "aura",
            "title": "Aura",
            "author": null,
            "created": "2020-09-14 21:51:57 UTC",
            "updated": [
                "2020-09-14 21:51:57 UTC"
            ],
            "markup": "markdown"
        },
        {
            "href": "/tag/php/",
            "relId": "php",
            "title": "PHP",
            "author": null,
            "created": null,
            "updated": [],
            "markup": "markdown"
        },
        {
            "href": "/tag/programming/",
            "relId": "programming",
            "title": "Programming",
            "author": null,
            "created": null,
            "updated": [],
            "markup": "markdown"
        }
    ],
    "created": "2014-04-21 14:54:11 UTC",
    "updated": [
        "2014-04-21 14:54:11 UTC"
    ],
    "html": "<p>(<em>N.b.: I was unable to write this post without saying <a href=\"https://www.youtube.com/watch?v=ljnT49jU9vM\">\"ssscrrrrutinizer\"</a> out loud over and over. I blame my friend Ray Chavarie for inflicting Frank Zappa on me at an impressionable time in my life.</em>)</p>\n<p>After finishing Uncle Bob's excellent <a href=\"http://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882\">Clean Code</a> recently, I have been looking at my own code in <a href=\"http://auraphp.com/packages/v2\">Aura v2</a> even more critically. I started trying to apply more of the Clean Code principles to the different libraries, and thought I had done pretty well.  But then I saw a <code>scrutinizer.yml</code> file in Luis Cordova's <a href=\"https://github.com/gushphp/gush\">Gush</a> project, and I was curious about it.</p>\n<p>I visited <a href=\"http://scrutinizer-ci.com\">scrutinizer-ci.com</a> to read up on the project, and man was I floored. Here is a service that will analyze your project on Github and assign it a quality grade that aligns really well with the Clean Code principles (among others). After you register a repository with Scrutinizer and perform the first analysis, you can fine-tune the process <a href=\"https://github.com/auraphp/Aura.Sql_Schema/blob/develop-2/.scrutinizer.yml\">with a config file</a> so that the Scrutinizer looks in the right directories for source code, gives you code coverage analysis, and so on.</p>\n<p>For one of my first experiments with the Scrutinizer, I started with the <a href=\"https://github.com/auraphp/Aura.Sql_Schema\">Aura.Sql_Schema v2</a> package. I thought it would come out pretty well, but even after pointing the Scrutinizer in the right direction, it only scored an 8.61 or so.  I guess that's OK -- but could we do better?</p>\n<p>Using the <a href=\"https://scrutinizer-ci.com/g/auraphp/Aura.Sql_Schema/code-structure/develop-2/hot-spots\">Hot Spots</a> page I was able to find the worst offenders in the classes and methods. Because we have 100% test coverage on all Aura code, it was a only matter of applying appropriate refactorings -- the tests help to assure that changes don't break anything. (The Scrutinizer will even suggest refactorings for you to apply.)</p>\n<p>After the refactoring processes, the Scrutinizer reported a 9.46. You can see the Scrutinizer report for Aura.Sql_Schema <a href=\"https://scrutinizer-ci.com/g/auraphp/Aura.Sql_Schema/\">here</a>. There's still room for improvement, but at least I know where the greatest improvement opportunities are.</p>\n<p>Now that I've got a few days' experience with Scrutinizer, I find it a very valuable tool.  It's very helpful as an objective assesment of code quality, so much so that I have added Scrutinizer badges to each Aura v2 package readme. You can see all the badges for all the packages on the <a href=\"http://auraphp.com/packages/v2\">v2 packages page</a>.</p>\n<p>Maybe the rest of the world knew about Scrutinizer before this, and I'm late to the game. I had not heard about it until recently, and now that I'm aware of it, I think it's a great service for any developer concerned about code quality. Congratulations to <a href=\"https://twitter.com/schmittjoh\">@schmittjoh</a> and everyone else involved in <a href=\"https://scrutinizer-ci.com\">Scrutinizer</a>.  Very nicely done!</p>\n<p>UPDATE: In response to a question elsewhere: yes, Scrutinizer is free for open-source projects.</p>\n<hr>\n<p class=\"reddit-links\">Read the Reddit discussion about this post <a href=\"https://www.reddit.com/r/PHP/comments/23ldsc/submit_to_the_central_scrutinizer/\">here</a>.</p>\n"
}
