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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GeoMechanicsApplication] Addressed several recently introduced code smells #11546

Merged
merged 1 commit into from
Sep 8, 2023

Conversation

avdg81
Copy link
Contributor

@avdg81 avdg81 commented Sep 8, 2023

馃摑 Description
Eliminated several recently introduced code smells that have been found by SonarQube.

馃啎 Changelog

  • Moved a variable declaration to inside the if statement (to limit the variable's scope as much as possible).
  • Pass some polymorphic objects by reference to const.
  • Renamed a few function parameters to comply with the Kratos Style Guide.
  • Improved the code layout.
  • Don't raise Exception, but use a more specific error class.
  • Only pass a single argument when constructing a RuntimeError.
  • Avoid having an unused loop variable (replaced i by _).
  • Use operators += and -= when appropriate.
  • Don't multiply by a hard-coded 1.
  • Moved reading of GiD output files to its own class and refactored its implementation into smaller and easy to understand methods.

- Moved a variable declaration to inside the `if` statement (to limit
  the variable's scope as much as possible).
- Pass some polymorphic objects by reference to `const`.
- Renamed a few function parameters to comply with the Kratos Style
  Guide.
- Improved the code layout.
- Don't raise `Exception`, but use a more specific error class.
- Only pass a single argument when constructing a `RuntimeError`.
- Avoid having an unused loop variable (replaced `i` by `_`).
- Use operators `+=` and `-=` when appropriate.
- Don't multiply by a hard-coded 1.
- Moved reading of GiD output files to its own class and refactored its
  implementation into smaller and easy to understand methods.
@avdg81 avdg81 added Cleanup GeoMechanics Issues related to the GeoMechanicsApplication labels Sep 8, 2023
@avdg81 avdg81 self-assigned this Sep 8, 2023
@avdg81 avdg81 merged commit 94127e6 into master Sep 8, 2023
10 of 11 checks passed
@avdg81 avdg81 deleted the geo/fix-some-recent-code-smells branch September 8, 2023 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cleanup GeoMechanics Issues related to the GeoMechanicsApplication
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants