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] Some more cleanup in custom_constitutive #11499

Merged
merged 1 commit into from
Aug 23, 2023

Conversation

avdg81
Copy link
Contributor

@avdg81 avdg81 commented Aug 23, 2023

馃摑 Description
Fixed several code smells reported by SonarQube in directory custom_constitutive. Also addressed several problems found by clang-tidy.

馃啎 Changelog

  • Removed some commented out code.
  • Applied the rule of zero to some classes.
  • Merged some enclosing if statements with outer ones.
  • Avoid implicit narrowing conversions.
  • When a default constructor can be generated by the compiler use that.
  • Applied the rule of five to a class.
  • Put const in front of the type name rather than after it.
  • Replaced several raw for loops by calls to std::copy and std::copy_n.
  • Some minor layout improvements.
  • Changed a reference to a reference-to-const.
  • Uncommented some multi-line comments.
  • Replaced some old-style inclusion guards by #pragma once.
  • Removed some redundant comments and blank lines.
  • Don't annotate a member function with both virtual and override.
  • Simplified some tests in if statements.
  • Corrected a few spelling mistakes.
  • Make better use of KRATOS_ERROR_IF and KRATOS_ERROR_IF_NOT.
  • Removed some redundant pairs of parentheses.
  • Avoid hiding member functions that are inherited from a base class (see "C.138: Create an overload set for a derived class and its bases with using" from the C++ Core Guidelines).
  • Replaced some occurrences of NULL by nullptr.

@avdg81 avdg81 added Cleanup GeoMechanics Issues related to the GeoMechanicsApplication labels Aug 23, 2023
@avdg81 avdg81 requested a review from WPK4FEM August 23, 2023 09:01
- Removed some commented out code.
- Applied the rule of zero to some classes.
- Merged some enclosing `if` statements with outer ones.
- Avoid implicit narrowing conversions.
- When a default constructor can be generated by the compiler use that.
- Applied the rule of five to a class.
- Put `const` in front of the type name rather than after it.
- Replaced several raw `for` loops by calls to `std::copy` and
  `std::copy_n`.
- Some minor layout improvements.
- Changed a reference to a reference-to-const.
- Uncommented some multi-line comments.
- Replaced some old-style inclusion guards by `#pragma once`.
- Removed some redundant comments and blank lines.
- Don't annotate a member function with both `virtual` and `override`.
- Simplified some tests in `if` statements.
- Corrected a few spelling mistakes.
- Make better use of `KRATOS_ERROR_IF` and `KRATOS_ERROR_IF_NOT`.
- Removed some redundant pairs of parentheses.
- Avoid hiding member functions that are inherited from a base class
  (see "C.138: Create an overload set for a derived class and its
  bases with `using`" from the C++ Core Guidelines).
- Replaced some occurrences of `NULL` by `nullptr`.
@avdg81 avdg81 force-pushed the geo/code_smells_custom_constitutive branch from bcabda6 to efbb285 Compare August 23, 2023 09:48
@WPK4FEM WPK4FEM merged commit a0820da into master Aug 23, 2023
11 checks passed
@WPK4FEM WPK4FEM deleted the geo/code_smells_custom_constitutive branch August 23, 2023 12:02
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