hubverse-org / hubAdmin

Utilities for administering hubverse Infectious Disease Modeling Hubs
https://hubverse-org.github.io/hubAdmin/
Other
1 stars 2 forks source link

Is there potential for reducing cyclomatic complexity of `check_input()` #2

Open annakrystalli opened 7 months ago

annakrystalli commented 7 months ago

check_input() is an internal function used to check that inputs to functions of the create_* family of functions (used to create hub config programmatically) conform to expectation defined in the hubverse schema.

As such the function is run for it's side effects only of throwing errors if a given condition is not met.

It has a high cyclomatic complexity (51) because it is composed of primarily if statements, used to deploy the appropriate according to the property of the input being checked. I dont think this is really a problem for the function as I don't see an obvious way around using if statements to deploy the correct checks. Because of this, Aat the moment I'm silencing the linting issue but open to other opinions on whether: a) this is really a problem to concern ourselves with? b) If yes, any suggestions of how to address it?