9

Recently installed SonarQube and its been amazing to see the level of code quality (or lack thereof)

Some projects have 30 to 60 days of technical debt and I found a few files with a cyclomatic complexity over 100. I’m still learning what the “good” numbers should be.

Yesterday, couple of devs were very proud they were going to start reducing the numbers, they started with one of my solutions that had 5 minutes of technical debt. Yes, 5 minutes.

DevA: “OMG…look at this…it has a cyclomatic complexity of 11…that’s terrible. I thought we were supposed to be professional developers.”
DevB: “And take a look at this, he used the double-slash instead of a triple slash for comments. How does any of code even compile?!”
Me: “Maybe we should tweak some of those SonarQube rules so they make more sense to our code base. We’re never going to use unicode, so all those string culture warnings should go away and code comment formatting? Who cares? Be happy we have comments. I think we should also focus on the bigger fish in that pond. The CRM project is one of the biggest and has a lot of improvement opportunities.”
DevB: “There you go again, don’t bring me problems, bring me solutions..ha ha”
DevA: “Yea, no kidding …hey…did you see the logger? OMG…the whole class is over 25 lines…we gotta split that up into smaller projects so it’s more manageable.”

It’s a good thing our revenue stream isn’t dependent on people getting work done.

Comments
  • 1
    They are just being jealous and think sonar tube is a thread. Now they are getting exposed.

    So, natural reaction is to pick on someone who did it better (maybe it's just one project). Finding flaws there to disguise their own shitty code.

    Take pride in your work, mate 😉
    The results you just told are very nice.

    And 25 lines in a class? C'mon man! The majority of my colleagues don't even come near the 150 lines!
  • 0
    Added Sonarqube to our commit gating CI/CD pipeline. Everybody is happy for the first 48h. Then I need to make it nonblocking, because we can't get code into mainline anymore due to devs not passing the static analysis. So now it is running and screaming bloody red quality violation, but we fix when the features are done....doh...the whole idea was to catch the errors before mainline so we could avoid testing and bugfixing hell in the end.
  • 0
    That awkward moment when sonarqube itself fails with a whole bunch of errors...
Add Comment