Improve maintainability by making examination parameter defaults immutable#1547
Improve maintainability by making examination parameter defaults immutable#1547melihberkpir wants to merge 3 commits intoinformatici:developfrom
Conversation
| /.env | ||
| .DS_Store | ||
| .DS_Store | ||
| .DS_Store |
There was a problem hiding this comment.
Why is this line duplicated 3 times?
There was a problem hiding this comment.
I think I accidentally ran this 3 times in the terminal while pushing.
There was a problem hiding this comment.
Hi @melihberkpir, please remove two of them, thanks!
|
|
||
| super(fileProperties); | ||
|
|
||
|
|
There was a problem hiding this comment.
The only changes I see in this file are related to adding spaces. Why?
There was a problem hiding this comment.
there's a new object... @melihberkpir why did you apply only to weight property and not the others?
| WEIGHT_MIN = myGetProperty("WEIGHT_MIN", DEFAULT_WEIGHT_MIN); | ||
| /*WEIGHT_MIN = myGetProperty("WEIGHT_MIN", DEFAULT_WEIGHT_MIN); | ||
| WEIGHT_MAX = myGetProperty("WEIGHT_MAX", DEFAULT_WEIGHT_MAX); | ||
| WEIGHT_STEP = myGetProperty("WEIGHT_STEP", DEFAULT_WEIGHT_STEP); | ||
| WEIGHT_INIT = myGetProperty("WEIGHT_INIT", DEFAULT_WEIGHT_INIT); | ||
| WEIGHT_INIT = myGetProperty("WEIGHT_INIT", DEFAULT_WEIGHT_INIT);*/ |
There was a problem hiding this comment.
Hi @melihberkpir, if you feel these fields should be removed, just remove them, there's no need to keep them commented ;)
| public final int min; | ||
| public final int max; | ||
| public final int init; | ||
| public final double step; |
There was a problem hiding this comment.
I would go here with private fields and getters (only).
If we don't mind to abandon Java<14 we can use record type for this purpose, and also implement some validation checks in this class, wdyt?
| @@ -0,0 +1,16 @@ | |||
| package org.isf.generaldata; | |||
There was a problem hiding this comment.
Missing the license header too.
The SonarQube analysis highlights multiple maintainability issues in core configuration classes such as ExaminationParameters, mainly caused by mutable default values and unclear responsibility boundaries. This change improves Maintainability by making default configuration values immutable, reducing accidental modification risks and improving code readability. As a result, future extensions and refactorings can be performed more safely with lower risk of regression.