If 1.5 is "the" damage modifier, why does it need to be assigned? The Popup covers some of the code, but you can see that it's related to a boost, so it's not just "the damage multiplier", but rather "the boost damage multiplier". And at some point it's probably reset to be "the default damage multiplier", or another value.
What bothers me about the “constant everything” group is that most constants end up being redundant. I already know that “a” is the DefaultValue, that’s why I gave it that value over setting it to null. I have no problem with constants but I don’t have named constants for everything, it makes certain things seem more important than they are.
Yeah these things become so unreadable. We had it in our frontend that we didnt allow more as 5 elements of something because of reasons that will not ever change. So we have an arr.length > 5, and our sonarqube bitched about it.
Makes me think of "is-even" and then complain it says "& 2", and this 2 is a "magical number". It can go too far, sometimes a number literal is just a number literal.
Most linters will not complain about certain numbers being hard coded, like 0, 1, 2, 10, and maybe a few others (also depending on the tool). And in many cases you can add your own exceptions.
I really question what takes more time. All this time fixing linters to be less of a nazi, or the linters helping us to reduce quality load?
Overall, linters should reduce time spend on working things, in my experience it increases overall time spend. Im not against linters, but, it should not be aggressive
The "I know" might be worth another consideration. For how long will you be able to not just remember that "a" is the default value, but also why? Do your coworkers know? Will new employees know? In some cases it's not necessary to have a constant to store a value you want to use, but it's easier to underestimste than to overestimate when it might be necessary or helpful for someone down the line.
2
u/Outrigger047 Mar 09 '26
Good to see Dracula in action!
29
u/Illustrious_Arm_1330 Mar 09 '26
Long time developer here. I agree with sonar linter, I’d comment the same thing if I were to code review your PR.
Numbers must have a meaning, if you know why that 1.5 is there, name a constant after it
2
u/TheChief275 Mar 09 '26
I had similar qualms with Godot+C#+VSCode, probably the same linter