rand_wc_model_gen/model_gen/core.py
File core.py
has 819 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
""" Classes to generate random wc models
:Author: Mike Zheng <xzheng20@colby.edu>
:Author: Jonathan Karr <karr@mssm.edu>
:Date: 2019-08-13
Function run
has 268 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def run(self):
""" Generate a :obj:`wc_lang` model
Returns:
:obj:`wc_lang.Model`: model
Function gen_reactions
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
Open
def gen_reactions(self, model, options):
""" Generate reactions and rate laws of the random model
Args:
model (:obj:`wc_lang.Model`): model
- 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 gen_species
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
def gen_species(self, model, options, misc_options):
""" Generate species type, species, and init concentrations of the random model
Args:
model (:obj:`wc_lang.Model`): model
- 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 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def plot(model, results, filename):
""" plot simulation results of the hard-coded rna model
"""