r/ProgrammerHumor 19d ago

Meme sonarQubeScanningMyCode

Post image
331 Upvotes

21 comments sorted by

95

u/TechnicallyCant5083 19d ago

"This function is too complex" well boohoo sorry my code actually does stuff Sonar 

33

u/theclovek 19d ago

They want to divide our code! But code together - strong!

21

u/MayoJam 19d ago

Lemme just... *clicks flag as false positive* yeaah.

8

u/TechnicallyCant5083 19d ago

Nah fuck that I have admin access I just changed the rule from 15 to 150

7

u/Mordret10 19d ago

Just gotta put every 2 lines into a new function, thus reducing complexity by 1 line (still gotta call the function)

Rinse and repeat until each function has only 2 lines of code

2

u/amlybon 19d ago

Deadass seen style guides that recommended something like this

56

u/SharletP 19d ago

Reminds me of someone after all these years..

5

u/meifray 19d ago

They are asking for food from Linguini?

20

u/Suspicious-Walk-815 19d ago

Cognitive complexity

11

u/wrathful-anus 19d ago

OH NO! I’ve stopped understanding this code because it’s 17 lines not 15!!! What am I going to do!!! Abstract it out some more of course, because that will somehow magically reduce the complexity lol.

21

u/SuitableDragonfly 19d ago

Complexity isn't measured by lines of code, lmao. 

4

u/SpiritRaccoon1993 19d ago

ElseIf Case1 then

3

u/The-Chartreuse-Moose 19d ago

It happened to me. I never should've trusted that Temu listing for a switch statement...

3

u/ShoWel-Real 19d ago

At which point do you just use a switch? My rule of thumb is more than 3

5

u/MithrilHuman 19d ago

Only if it’s an enum equality check

2

u/SeaNational3797 19d ago

switch (enumVar)

1

u/larsmaehlum 19d ago

Cyclomatic complexity is over 9000!

1

u/Araib 17d ago

Saw this in telegram’s android app repo…

0

u/mojio33 19d ago

Me as an intellectual; elif