18

Okay so I have been a consumer of devRant for a while now but never posted anything. This is my first.

So yesterday I modified an existing method(some very minor changes!!). Today after coming to the office I see that I have comments from Sonarqube stating
"Reduce cognitive complexity from ** to 15.

I get that it is a good measure to maintain readability but this refactoring is not part of my change at all and any mishap can break the whole code base!!!.

My code even won't build because of this company restriction that there should not be any issues from Sonarqube.

I really want to bash my head against the wall right now.

Comments
  • 3
    Wtf is cognitive complexity?
  • 2
    @endor Probably just cyclic complexity with a fancier name.
  • 3
    It's like a measure of how readable ur code is. The code I modified was completely readable!!! Heck I read it right??
  • 1
    disable rule? suppress warning?
  • 5
    @TheUchihaGirl hi!
    I am sorry for your company, having these restrictions is silly in my honest opinion. Okay, yeah, sure, readable code, sure.

    but literally restricting methods complexity and shit is fucking annoying. I have buddy at corporation and they have shit like that. They were working few days on one method... Becouse writing it was simple, and it worked, but they had to split it into gazillion of other methods becouse complexity metrics were too high, and every single fucking time something will blow up during the reductions. To the point where they gave up, compiled it and used it as external library so noone at company could say anything about it but oh boi that was one of most useless .dll's Ive seen.

    Yeah, artificial "clean code" limit is such a bullshit... now i feel like writing rant about it.
  • 2
    Welcome to devRant. Get that avatar 👍

    I haven't had the pleasure of being enforced to write clean code by another system, but damn... if it's readable and makes sense what's the problem 😅
  • 4
    I will never allow a program to judge whether or not my code is readable. There are already humans on my team who have questionable opinions of what is readable.
  • 2
    @coffeeholic don't have that permission. Only tls have that
  • 1
    @-red We Indians sure are nosy, aren't we...?
  • 1
    @cst1992 😅 Apparently.
  • 0
    Code is read more often than written.

    Nevertheless sonar seems a little daft and passive.
Add Comment