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

Sonar cleaning complex #1122

Merged
merged 38 commits into from
Oct 7, 2024
Merged

Sonar cleaning complex #1122

merged 38 commits into from
Oct 7, 2024

Conversation

phiedw
Copy link
Collaborator

@phiedw phiedw commented Sep 2, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)

Does this PR already have an issue describing the problem?

No

What kind of change does this PR introduce?

Code clean up

What is the current behavior?

Many complex sonar code smells.

What is the new behavior (if this is a feature change)?
Fewer code smells.

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

phiedw and others added 22 commits August 29, 2024 10:32
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
…tures

Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
@phiedw phiedw changed the base branch from main to sonar_cleaning September 2, 2024 11:41
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
Base automatically changed from sonar_cleaning to main September 2, 2024 13:20
Signed-off-by: phiedw <philippe.edwards@rte-france.com>
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
…_cleaning_complex

Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
@phiedw phiedw added PR: waiting-for-review This PR is waiting to be reviewed cleaning This issue or pull request only concerns improving the overall state of the code labels Sep 12, 2024
if (!instant.isPreventive()) {
flowCnecAdder.withContingency(contingencyId);
cnecId += " - " + contingencyId;
cnecIdCopy += " - " + contingencyId;
}
flowCnecAdder.withInstant(instant.getId());
Copy link
Collaborator

Choose a reason for hiding this comment

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

already added

private void addCnecsOnState(FlowCnecAdder flowCnecAdder, String cnecId, Contingency contingency, Instant instant, MeasurementCreationContext measurementCreationContext, String networkElementId) {
String contingencyId = Objects.isNull(contingency) ? "" : contingency.getId();
String cnecIdCopy = cnecId;

if (!instant.isPreventive()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

you could add this in previous if/else preventive check

phiedw and others added 2 commits October 7, 2024 11:06
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
@Godelaine Godelaine merged commit f9e2e87 into main Oct 7, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleaning This issue or pull request only concerns improving the overall state of the code PR: waiting-for-review This PR is waiting to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants