-
Notifications
You must be signed in to change notification settings - Fork 8
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
Full Sonar analysis #847
Full Sonar analysis #847
Conversation
Signed-off-by: Olivier Perrin <olivier.perrin@rte-france.com>
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
… case Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
09fbd37
to
79364bd
Compare
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
@geofjamg this is a proposal for making switch more lisible when needed (maybe not every time, as done in the PR). Just tell me what do think. Can we change the automatic indentation for mutliple case in a switch? Furthermore, I have an issue with |
When new switch is used as an expression switch (so when we get the returned value from the switch), if not all cases are handled we get a compile time error. So we should in such a case safely remove the default case. |
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
done = true; | ||
} | ||
|
||
if (List.of("v", "angle", "p", "q", "p1", "q1", "p2", "q2").contains(attribute)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this change? this is a sequential search worst in term of performance a a switch/case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sonar asks for an if loop here instead of a switch case. But I understand if we revert.
SonarCloud Quality Gate failed. 0 Bugs 88.8% Coverage Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
Signed-off-by: Olivier Perrin <olivier.perrin@rte-france.com> Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com> Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Please check if the PR fulfills these requirements
What kind of change does this PR introduce?
Quality
What is the current behavior?
An old Sonar profile is used, it is not up-to-date.
What is the new behavior (if this is a feature change)?
An up-to-date Sonar profile is used in powsybl-open-loadflow CI. New code smells are reported and should therefore be corrected.