Showing 107 of 141 total issues
File species_populations.py
has 1555 lines of code (exceeds 250 allowed). Consider refactoring. Open
""" Store species populations, and partition them among submodel private species and shared species
:Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu>
:Author: Jonathan Karr <karr@mssm.edu>
:Author: Arthur Goldberg, Arthur.Goldberg@mssm.edu
File verify.py
has 1280 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
:Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu>
:Author: Yin Hoon Chew <yinhoon.chew@mssm.edu>
:Date: 2018-09-17
:Copyright: 2018, Karr Lab
File dynamic_components.py
has 1162 lines of code (exceeds 250 allowed). Consider refactoring. Open
""" Dynamic components of a multialgorithm simulation
:Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu>
:Author: Jonathan Karr <karr@mssm.edu>
:Date: 2018-02-07
File dfba.py
has 703 lines of code (exceeds 250 allowed). Consider refactoring. Open
""" A submodel that uses Dynamic Flux Balance Analysis (dFBA) to model a set of reactions
:Author: Yin Hoon Chew <yinhoon.chew@mssm.edu>
:Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu>
:Date: 2020-07-29
Function read_model
has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring. Open
def read_model(self, sbml_version='l3v2', model_file_suffix='-wc_lang.xlsx'):
""" Read a model into a `wc_lang` representation
dFBA test cases are read directly from SBML, whereas other cases are read from WC Lang spreadsheets.
- 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
File utils.py
has 439 lines of code (exceeds 250 allowed). Consider refactoring. Open
""" Utilities for testing
:Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu>
:Date: 2019-10-26
:Copyright: 2019, Karr Lab
File time_ordered_list.py
has 392 lines of code (exceeds 250 allowed). Consider refactoring. Open
""" Doubly-linked list ordered by time
:Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu>
:Date: 2019-11-20
:Copyright: 2019, Karr Lab
File run_results.py
has 386 lines of code (exceeds 250 allowed). Consider refactoring. Open
""" Store and retrieve combined results of a multialgorithmic simulation run
:Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu>
:Author: Jonathan Karr <karr@mssm.edu>
:Date: 2018-05-20
File multialgorithm_simulation.py
has 370 lines of code (exceeds 250 allowed). Consider refactoring. Open
""" Initialize a multialgorithm simulation from a language model and run-time parameters
:Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu>
:Date: 2017-02-07
:Copyright: 2016-2019, Karr Lab
Function add_test_submodel
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def add_test_submodel(cls, model, model_type, submodel_num, comp, species_types,
default_species_copy_number, default_species_std,
species_copy_numbers, species_stds, expressions,
submodel_framework='WC:stochastic_simulation_algorithm'):
""" Create a test submodel
- 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
File sim_config.py
has 356 lines of code (exceeds 250 allowed). Consider refactoring. Open
""" Classes to represent WC simulation configurations and import/export configurations to/from SED-ML
:Author: Jonathan Karr <karr@mssm.edu>
:Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu>
:Date: 2017-08-19
Function verify_model
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def verify_model(self, num_discrete_stochastic_runs=None, discard_run_results=True, plot_file=None,
ode_time_step_factor=None, tolerances=None, evaluate=False):
""" Verify a model
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 analyze
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def analyze(file): # pragma: no cover
atols = set()
rtols = set()
cases = set()
data = {}
- 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 a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def plot(model, time = np.zeros(0),
species_counts = None, volume = np.zeros(0), extracellular_volume = np.zeros(0),
selected_species_compartments = [],
yDatas = {},
units = 'mM', title = '', fileName = ''):
- 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 determine_dependencies
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def determine_dependencies(self):
""" Determine the dependencies that rate laws have on executed reactions
In a multi-algorithmic simulation, two types of dependencies arise when NRM considers which
rate laws to update after a reaction executes:
- 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 obtain_expression_usage
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def obtain_expression_usage(model):
""" Obtain the use of expressions by rate laws in a WC Lang model
Adapted from DynamicModel.obtain_dependencies.
- 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
File make_models.py
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
""" Make simple models for testing
:Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu>
:Author: Jonathan Karr <karr@mssm.edu>
:Date: 2018-04-27
Function make_test_model
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def make_test_model(cls, model_type,
init_vols=None,
init_vol_stds=None,
density=1100,
molecular_weight=10.,
- 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 differs
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def differs(self):
""" Evaluate whether the species amounts predicted by simulation run(s) differ from the correct amounts
Returns:
:obj:`obj`: `False` if amounts in the simulation run(s) and the correct amounts are equal
- 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 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def plot(model, results, filename):
# get expected results
mean_doubling_time = model.parameters.get_one(id='mean_doubling_time').value
cytosol = model.compartments.get_one(id='c')