Skip to content

WDFN-909 - Decreased the complexity in the monitoring_location view function so that it passes the default McCabe complexity setting.

Bucknell, Mary S. requested to merge mbucknell/waterdataui:wdfn-909 into main

Before making a pull request

  • Put the appropriate EXEMPT flag if needed in the MR label (see https://practices.wma.chs.usgs.gov/practice/peer_code_review/)
  • Run all linters (make lint)
  • Run all tests (make test)
  • Update the changelog appropriately
  • If making a release, update code.json metadataLastUpdated and bump CHANGELOG.md to next version.

Description

I reorganized the monitoring_location view function by creating a utility function, removing many of the local variables by assigning directly to the context and by removing some of the nested if statements that were setting status code and template.

While I was in location_utilities test, I added tests to get complete coverage on get_default_parameter_code.

I also moved the feature toggle of the temporary_mlp page to the top so it returns the 404 immediately.

After making a pull request

  • If appropriate, put the link to the PR in the JIRA ticket
  • Assign someone to review unless the change is trivial
  • Check the accessibility CI step and fix or explain any issues.

Merge request reports

Loading