Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration of the parameters from study-server #59

Merged
merged 21 commits into from
Feb 7, 2024
Merged

Conversation

flomillot
Copy link
Contributor

No description provided.

Signed-off-by: Florent MILLOT <millotflo@gmail.com>
@flomillot flomillot changed the title Migration of the parameters from study-server. Migration of the parameters from study-server Dec 28, 2023
Signed-off-by: Florent MILLOT <millotflo@gmail.com>
Signed-off-by: Florent MILLOT <millotflo@gmail.com>
@SlimaneAmar
Copy link
Contributor

Best pratices

  1. Return optional if really optional else throw not found because it's difficult to understand the code
  2. Reduce the checks null values, normally variables are nerver null or else it's optional
  3. For null checks, on a method public add a Objects.requireNonNull or annotation NotNull and private methods we never check

Signed-off-by: Florent MILLOT <millotflo@gmail.com>
Signed-off-by: Florent MILLOT <millotflo@gmail.com>
… to return SensitivityAnalysisParametersInfos directly instead of Optional.

Signed-off-by: Florent MILLOT <millotflo@gmail.com>
# Conflicts:
#	src/main/java/org/gridsuite/sensitivityanalysis/server/SensitivityAnalysisController.java
#	src/main/java/org/gridsuite/sensitivityanalysis/server/service/SensitivityAnalysisService.java
#	src/main/java/org/gridsuite/sensitivityanalysis/server/service/SensitivityAnalysisWorkerService.java
#	src/main/resources/db/changelog/db.changelog-master.yaml
Signed-off-by: Florent MILLOT <millotflo@gmail.com>
@flomillot
Copy link
Contributor Author

flomillot commented Jan 29, 2024

Best pratices

  1. Return optional if really optional else throw not found because it's difficult to understand the code
  2. Reduce the checks null values, normally variables are nerver null or else it's optional
  3. For null checks, on a method public add a Objects.requireNonNull or annotation NotNull and private methods we never check
  1. As done on loadflow-server and suggested here, I let ResponseEntity manage the return code
  2. Which ones should I remove ? Because I used the same code as voltage-init which I were supposed to copy
    update
    assignAttributes
    Is it these ones I should remove ?
  3. That's already the case, no ?

# Conflicts:
#	src/main/java/org/gridsuite/sensitivityanalysis/server/SensitivityAnalysisController.java
#	src/main/java/org/gridsuite/sensitivityanalysis/server/service/SensitivityAnalysisService.java
#	src/test/java/org/gridsuite/sensitivityanalysis/server/SensitivityAnalysisControllerTest.java
#	src/test/java/org/gridsuite/sensitivityanalysis/server/service/SensitivityAnalysisServiceTest.java
Signed-off-by: Florent MILLOT <millotflo@gmail.com>
…fields.

Signed-off-by: Florent MILLOT <millotflo@gmail.com>
Signed-off-by: Florent MILLOT <millotflo@gmail.com>
Signed-off-by: Florent MILLOT <millotflo@gmail.com>
Copy link
Contributor

@AbdelHedhili AbdelHedhili left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code : ok, but can you check if you can resolve some sonar issue

@flomillot
Copy link
Contributor Author

code : ok, but can you check if you can resolve some sonar issue

Unfortunately it's issues already present. For the number of params, it's allowed if it's for methods called by the controller if I remember well.

Slimane AMAR added 2 commits February 5, 2024 11:42
@flomillot flomillot requested a review from SlimaneAmar February 6, 2024 16:18
Signed-off-by: Florent MILLOT <millotflo@gmail.com>
# Conflicts:
#	src/main/resources/db/changelog/db.changelog-master.yaml
#	src/test/java/org/gridsuite/sensitivityanalysis/server/SensitivityAnalysisControllerTest.java
Signed-off-by: Florent MILLOT <millotflo@gmail.com>
Signed-off-by: Florent MILLOT <millotflo@gmail.com>
…java

Signed-off-by: Florent MILLOT <millotflo@gmail.com>
…Infos and toEntity methods.

Signed-off-by: Florent MILLOT <millotflo@gmail.com>
@flomillot flomillot requested a review from ayolab February 7, 2024 09:25
Copy link

sonarqubecloud bot commented Feb 7, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

4 New issues
0 Security Hotspots
96.2% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@flomillot flomillot merged commit 9eed97f into main Feb 7, 2024
3 checks passed
@flomillot flomillot deleted the parameters-migration branch February 7, 2024 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants