wc_sim/model_utilities.py
Function sample_copy_num_from_concentration
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
def sample_copy_num_from_concentration(species, volume, random_state):
""" Provide the initial copy number of `species` from its specified value
The initial copy number is sampled from a specified distribution whose mean is given
in molecules or molarity.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function find_private_species
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
def find_private_species(model, return_ids=False):
""" Identify a model's species that are private to a submodel.
Find the species in a model that are modeled privately by a single submodel. This analysis
relies on the observation that a submodel can only access species that participate in
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"