Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "sonar"
-
Want to finish my little friend for a long time now. He can dance Michael Jackson's moonwalk for now.
Idea was to use the sonar sensor to switch dancing styles but he is still blind :(11 -
Last week, the team lead told me that he can't merge because my code has code smells and going forward, can't have that. We use Sonar and well the way to "fix it" according to him is to mark the line using //NOSONAR.
Most of the issues are minor like Unused imports and for me incomplete TODOs.
And before the "verbal" rule was only need to fix Major + issues. And well the reason I use TODOs is to mark code that probably needs changing in the future. I know there's going to be some feature that these lines have to be changed. But the requirements are fully defined yet from business.
But I sort of blew up on him. YOU WANT TO ENFORCE ZERO CODE SMELLS NOW?!?!?! AND THESE MINOR ISSUES? MARK THEM WITH NOSONAR?
HERE'S WHAT I THINK FOR THE LAST X YEARS... THE CODE DESIGN IS SHIT, MINOR CODE SMELLS AND MANUALLY MARKING THE ONES U NEED TO KEEP... ARE THE LEAST OF OUR PROBLEMS...
THE OTHER PROBLEMS I'VE MENTIONED BEFORE EVER. MOS YEAR BUT YOU DIMWITS NEVER LISTEN.
YOU THINK MY TODOS ARE BAD... 90% OF THE CODE AND FEATURES (THE ONES NOT DONE BY ME) LOOK AND SMELL LIKE MONKEY SHIT. UNDOCUMENTED, MESSY, FULL OF BUGS.
AND GUESS WHAT? NEW FEATURE, SOME DEV FORGETS TO CHANGE SOME COMPONENT THAT DEPENDS ON IT. WOULDN'T IT BE GREATE IF THERE WERE BOOKMARKS... O WAIT...
i just was catching up on comics again and saw this one... with triggered my memory and this rant... My first thought was to forward it to him...11 -
SonarQube reduces our code quality through arbitrary nonsense rules, and it's inability to understand perfectly decent Kotlin code. Unfortunately we have a CTO who is completely enamoured with it. I hope someone from Sonar is reading this: You made my pleasurable Dev job a misery, and it may very well be the thing that makes me quit. Fuck your arrogant product. I honestly wouldn't mind it so much if your UX offered a way to discuss each warning and provide affected code snippets so you could argue your case and collaborate on the rule set. But no, you know my code base best right? Fuck you and and your ivory tower.8
-
Sorry, long since my last post...
I have quit my job recently at DERP & CO.. The level of anxiety was already somewhat of medical severity.
For months I had been in a project that not only did not progress, but that it was getting worst day by day.
A bit of Context
November: "Dev, junior anon needs you to help him on the SHIT project because they are running out of time, it is mainly doing unit tests."
Well, the code was a mess, there was a LOT of copy paste and it was all bad quality (we talk about methods with complexities between 80 and 120 according to SONAR QUBE).
Dev: "Anon, you know this is wrong, right?"
Anon: "Why? it works"
Dev: after long explanation.
Anon: "Oh well, yes, from now on I will take it into account." And he did it / try his best.
Dev does the unit tests and do extra work outside of the reach of the sprint (y than i mean work after hours, classic) and alerts the boss of the mess.
December: After a project of approximately 6 or 8 months of development, the boss discovers that the junior anon have been doing everything wrong and/or with poor quality (indicating that throughout the whole development the quality of the code was NEVER checked nor the functionality).
Boss: "This is a shit. Dev, you have to correct all the errors and warnings marked on sonar", which are around 1200 between smelling code, high risk errors, etc.
Dev fixes something like 900 bugs... lots of hours...
Boss: "This still is all wrong, we have to redo it. We will correct the errors leaving something stable and we will make a new repository with everything programmed as it should be, with quality and all"
- 900 corrections later, now are irrelevant -
Boss: "Dev, you will start to redo it, anon is out on other project. First you must leave the existing one working properly"
Dev: "ok ..."
January: How can I correct the mess if the client asks for more things. I am just fixing the mess, doing new functionalities, and when I have free time (outside the work) I try to advance the new repository, poorly I must say because burntout.
Boss: "Everything should be arranged at the end of January, so that you can redo everything well in February."
I can't handle everything, it starts to fall further behind. Junior Anon quits the job.
February: Big Bad Bugs in the code appear and practically monopolize the month (the code is very coupled with itself and touching in one place sometimes meant breaking other stuff).
Boss: "It can't be, you've been with this since January and you haven't even started correcting this mess in the new repo"
Dev: "It is that between the new things that are requested and the bugs I cannot put myself with that"
Boss: "Do not worry, you will be helped by random dev if you needed. SPOILER ALERT: random dev is allways bussy. Not made up bussy, He had a lot of work by itself, but it can't help me the way I need it.
High anxiety levels, using free time to try to reduce the work left and gradually losing the taste for develop.
March: So far, not only do they add new things day and day, but now they want to modify things that were already "ok", add new ones and refactor everything in a new repo. I just did not see an end of this nonsense.
Dev breaks, the doctor says it's anxiety, so I just know what I have to do.
Dev: "I quit my job"
Cool Manager: "Damn, why?"
Explain everithig
Cool Manager: "Do you want to try if I can change you to other project or anotjer scope on the same project?"
Dev: "Thanks, but no Thanks. I need to stop for a while".
End. sry for long sad post and maybe poor use of English (?) Not my native language.10 -
Well paid java dev. But the HW/SW-Stack is awful.
Monitor: single 1600x1024
5yr old notebook, old i5, magnetic hdd
Forced to use windows 7
No maven server
No CI server
SVN but no git
Eclipse, no intelliJ
No sonar server
There are days where I just can't take it anymore.11 -
A continuation of the worst idiot that I worked for, in possibly the worst project of the world. ( The guy who said youtube watching doesn't cost data, downloading the videos offline does)
Guy sends me a template for a patent application.. I ask him why, and he's all secretive until he takes me into a meeting with the patent officers of the organization to reveal his grand plans.
Here goes his idea. He wanted to file a patent for a sonar made for large vehicles in India. His idea was that people in India are used to overtake busses while they turn and they are overrun by the large vehicles. True to some extent but a completely overkill solution for a minor issue that could be solved by educating the masses. I try to explain this to him, and he's pissed off. Starts throwing random, made up stats at me saying 2000 people die everyday on every street. I'm like WHAT??? I look at the patent officer, and he gives me that "don't look at me dude, I'm just here for any questions about the patent process" look. He's busy doodling in his notebook while I try everything possible to invalidate the stupid idea my client has barfed all over the meeting room and the attendants. I even bring out the technical challenges leaving aside the practicality of the nonsense. I asked him how to distinguish between a pedestrian, a parked vehicle, a dog, a cow.. To which he responds with an on the spot thoughtless answer. Heat signatures!! In 5 minutes we went from sonar to heat maps in a tropical country such as India.. He now wants a hybrid solution.
He was about to start yelling when I caved in on the condition that I want nothing to do with the idea after I finish the patent application.. Made up some document and sent it to the asshole, only to never hear about it again.. Thank god for that.. R&D my ass..7 -
So I'm required to take an intro Java course at my university, and can't test out...
My professor actually just described constructors as classes, not analogous to, or metaphorically. He said they were classes. All of the students are now confused out of their minds. Should I say something?7 -
"Refractor this method to reduce its Cognitive Complexity from 110 to 15 allowed."
*Pan*
Ok let's do it :
label : for(....) {
if(...){
for(.....){
If(...){
....
break label;
}
}
}
}
*Pan Pan*1 -
Does anyone else think some of the Sonar rules are actually crap?
In particular the Put all you variables above methods one?
I have some static methods and variables and some object ones.
Apart from creating a new class for them which I think is over kill for just a few helper methods, don't you feel you should keep all static stuff separate?
Clean code shouldn't be about following arbitrary debatable rules, it should be preventing the horrible crap that any experienced developer would instantly call shit... If he didn't write it.
And I'm pretty sure I'm experienced so if I'm not calling a price of code shit...I don't see why Sonar should...1 -
Due to covid, mgrs decided to fire 10% but could not negotiate schedule increase with internal IT. With no promotions or hikes, few full stacks we have leave.
Now am working with 2 data engg doing cloud java microsvs work while learning. Their first delivery was applauded by their mgr who is under pressure to retain them.
I as arch review their code. No unit tests, print statements all around, shoddy exception handling, variable naming issues. We have Sonar by default in our build. They ignore the report. I ask them about it. Seems mgr told them he is getting a contract person from another team on part time basis to do/fix. I share my confusion.
Mgr calls me up and checks if we can put it as tech debt backlog and deploy to prod !!!1 -
My team is the meme of the coding dinosaurs.... they think git basics like working in a branch and doing pr's and not commit directly to master is a "theory", they use old and unknown shit for everything and even when said shit has a better way of doing something they just choose the worst one. At the moment they have me changing all the files in multiple apps from tab indentation to spaces because this generates a code coverage issue on sonar instead of just deactivating that check... why the fuck did I take this job whyyyyyy2
-
WTF kind of bullshit software is sonar.
I can't deploy my application because sonar is telling me that there is a vulnerability. So I look at it. IT'S A FUCKING DEV DEPENDENCY. Are you fucking serious sonar? I can't deploy because a dev dependency has a vulnerability that allows DOS attacks. What the fuck do you think will happen?! I'm going to DOS my own fucking application whilst coding or what? Who the fuck would even care?!
I fucking hate our Pipeline, all the tools behind it operate like shit. the only thing positive about it, is that I am able to deploy applications myself without having to call someone and wait a week. Because putting a file in a directory is hard ._.3 -
A group of friends and I when we were 15 competed in a UK-wide competition to build a robot with sonar and touch sensors to navigate through a field of obstacles. The winner was the fastest average. Our robot only travelled in bent lines, and turned when it detected an obstacle infront of it. We had our three tries, the first two taking perhaps 30 seconds. The third time we twisted it slightly on its start position, and without stopping it followed a curve through the whole course, in about 3 seconds. Unfortunately we weren't even mentioned in the runners up :L1
-
I setup ELK for our team and went live with it on Production VM.
I'm the only one that knows how it works, is setup... Because no one else cares or wants to know as long as it works...
And well if it doesn't, let's just say they hope that I'm around...
On a side note, I think I'll leave a bit early today since I cut or main projects build process time by 50%.
Root cause: SONAR complains if you implement that using if else to match each field... it is pretty ugly...
And can use Lombok to clean it up, last rant.
So shaved off 10 minutes in each build... And well I'm like seriously? No one else bothered to figure this out for the last year or 2?
I mean I've been pretty busy too but the team had like 20 ppl and at least 4 senior devs and well u don't even need to be senior? Just inquisitive and proactive?2 -
My senior dev instructed me to swap lines of variable declarations and rename one of them so that sonar will not complain about duplicated code fragments.2
-
So Sonar (Java code style checker) is telling me to return immediately instead of first assigning the results to a variable:
ArrayList<string> strings = ...
{Some long running logic that populates the list}
String x = String.join(strings);
return x;
Declaring x is bad apparently... but I disagree...
Am I not understanding something here?
The upside out this is you can breakpoint it and well you meet want to add additional logic later while you find a bug while debugging...
I guess it would be noticeably slower but a few seconds... If I were to call it 1 billion times?14 -
Ok so Sonar had a rule that you should not throw Exception. Rather you should always throw a specific types or catch them...
I don't understand this. So if the underlying function throws 10 different types of exceptions then the calling function should also declare it throws 10 different types rather than just Exception?
Assuming it isn't in a position to handle them?2 -
In my Java project, I added a wiremock rule to a few tests. Now my Jacoco code coverage in sonar dropped to 0%. 😩 Maven is running the goals, bit not creating the jacoco.exec file.
That's one of the worst things in Java. Once you understood the concept of immutables, the build tools start to annoy you.2 -
How should you override Equals in Java?
We have model classes with lots of fields and the we override the details equals to compare all the fields. I guess like doing a deep comparison.
And in all these classes SONAR is complaining about lots of ifs, complexity, etc.
And it's killing the analysis time... Old issue never fixed because whoever setup sonar was too incompetent to bother asking, researching, or fixing...
Is there a better way to override the equals to get the same result but without triggering SONAR issues?
Pretty sure this is a solved problem. And well if the top of my head, is just create a Util method that uses reflection like
Boolean equals( Object a, b, Class class)
foreach (String f: class, getFields()) {if !compare(class.getField(f,a),class.getField(f,b)) return false; }
return true5 -
Linux noob... just accidentally made myself (not root) owner on all files. seemed fine for a while, but I couldn't sudo or even ssh. had to rollback my server nearly a month to fix it 😭
-
I find it very surprising that people at work are always reluctant to do code reviews. There are no standards in place and everyone is free to push whatever they want. There is Sonar but it doesn't catch bad logic. Don't know how are we going to deal with this technical debt.4
-
I'm starting an app open-source. Consists of an emergency "sonar", which you will publish notices and reply too with your connected peers. And I need suggestions and collabs. Can see on my GitHub: github.com/roqueando/konarium.io
Who is interested in helping in backend or frontend I started a workgroup on slack too, so here is the room: todevmore.slack.com
If you have a question, comment below I will reply.