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

Refactor calculate_deco_information() to Reduce Complexity #4378

Open
1 of 4 tasks
coltwood93 opened this issue Nov 19, 2024 · 0 comments
Open
1 of 4 tasks

Refactor calculate_deco_information() to Reduce Complexity #4378

coltwood93 opened this issue Nov 19, 2024 · 0 comments

Comments

@coltwood93
Copy link

Describe the issue:

  • Bug
  • Change request
  • New feature request
  • Discussion request

Issue long description:

In profile.cpp, calculate_deco_information() is a rather long and complex function. Breaking out the logic into helper functions would improve readability and maintainability.

Operating system:

Not applicable. Found by code review.

Subsurface version:

Not applicable. Current version of profile.cpp.

Steps to reproduce:

Not applicable. Function is at line 839 of profile.cpp.

Current behavior:

This function has several blocks of logic that initialize state, iterates and updates plot entries, and updates final deco information. All of this takes place in a mass of nested loops and conditional checks.

Expected behavior:

The logic can be broken out into helper functions that are called by the original function so that it is easier to follow and the code can be more easily maintained and tested.

Additional information:

This issue is based on a review for code smells.

This is officially my first issue on any repository, so I hope this is remotely helpful to the project. I'm currently taking an open source class at Oregon State (I see one of my classmates also just opened an issue) and am a recreational diver who has had Subsurface recommended to me multiple times, so this project checked all the boxes for this assignment.

If this issue is not worthwhile of being incorporated, I'm more than happy to take on an existing issue for my next assignment which is creating a pull request.

Mentions:

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

No branches or pull requests

1 participant