Showing 107 of 141 total issues
Function run
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def run(self, test_case_type_name=None, cases=None, num_stochastic_runs=None,
Function convert_checkpoints
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def convert_checkpoints(self):
""" Convert the data in saved checkpoints into pandas dataframes for loading into hdf
Returns:
:obj:`tuple` of pandas objects: dataframes of the components of a simulation checkpoint history
Function run
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def run(self, max_time, results_dir=None, progress_bar=True, checkpoint_period=None,
seed=None, ode_time_step=None, dfba_time_step=None, profile=False, submodels_to_skip=None,
verbose=True, object_memory_change_interval=0, options=None):
""" Run one simulation
- 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
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"
Further reading
Function add_species_locations
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def add_species_locations(self, store_name, species_ids, replace=False):
""" Add species locations to the species location map
Record that the species listed in `species_ids` are stored by the species population store
identified by `store_name`. To replace existing location map values without raising an
- 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 schedule_next_reaction
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def schedule_next_reaction(self, reaction_index):
""" Schedule the next reaction after a reaction executes
Args:
reaction_index (:obj:`int`): index of the reaction that just executed
- 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 ode_test_generator
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def ode_test_generator(ode_time_step_factors=None, tolerance_ranges=None):
""" Generate a nested iteration of test arguments for an ODE submodel
Iterates over ODE time step factor and solver tolerances
- 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 plot
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def plot(): # pragma: no cover
file = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..', 'tests', 'testing',
'verification_results', 'ode_tuning', FILE)
pathname = os.path.normpath(file)
num_cases, fraction_solved_df, compute_time_df, failures_rate_df = analyze(pathname)
Function plot
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def plot(
species_ssa, time_ssa,
species_ode, time_ode,
species_hyb, time_hyb,
exp_avg_species, filename):
Function plot
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot(
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, id, dynamic_model, reactions, species, dynamic_compartments,
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, id, dynamic_model, reactions, species, dynamic_compartments,
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, id, dynamic_model, reactions, species, dynamic_compartments,
Function read_expected_predictions
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def read_expected_predictions(self):
""" Get the test case's expected predictions
Returns:
:obj:`pandas.DataFrame`: the test case's expected predictions
- 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 __init__
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, id, dynamic_model, reactions, species, dynamic_compartments,
local_species_population, dfba_time_step, options=None):
""" Initialize a dFBA submodel instance
Args:
- 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 __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, species_name, random_state, initial_population, cont_submodel_ids=None,
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, name, initial_population, molecular_weights, initial_population_slopes=None,
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, root_dir, case_name, model_file, settings, case_type, correct=False):
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, name=None, initial_population=None, molecular_weights=None,
Function plot_expected_vs_simulated
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_expected_vs_simulated(dynamic_model,