KarrLab/intro_to_wc_modeling

View on GitHub

Showing 42 of 135 total issues

Function d_conc_d_t has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def d_conc_d_t(concs, time):
    """ Calculate differentials for Goldbeter 1991 cell cycle model
    (`BIOMD0000000003 <http://www.ebi.ac.uk/biomodels-main/BIOMD0000000003>`_)

    Args:
Severity: Minor
Found in intro_to_wc_modeling/cell_modeling/simulation/ode.py - About 1 hr to fix

    Function plot has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def plot(model, time=np.zeros(0),

      Function __init__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(self,

        Function main has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        def main():
            #########################################
            #########################################
            # Concatenate two 3x1 arrays of zeros and ones, and get its shape
            arr = numpy.concatenate((numpy.zeros((3, 1)), numpy.ones((3, 1))), 1)

          Function simulate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          def simulate(mdl):
              # simulates model
          
              # Get metabolism submodel
              submdl = mdl.getComponentById('Metabolism')

            Function get_steady_stability has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def get_steady_stability(self, jacobian):
                    """ Get the stability of a steady state
            
                    Args:
                        jacobian (:obj:`numpy.ndarray`): jacobian of the model

            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 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(self, k_m=5, k_n=20, gamma_m=numpy.log(2) * 60 / 3, gamma_n=numpy.log(2) / 10, m_0=1, n_0=98):

              Function plot has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              def plot(model, time=np.zeros(0),
                       speciesCounts=None, volume=np.zeros(0), extracellularVolume=np.zeros(0),
                       selectedSpeciesCompartments=[],
                       yDatas={},
                       units='mM', fileName=''):

              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 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def __init__(self, id='', name='', submodel='', value=None, units='', comments=''):
              Severity: Minor
              Found in intro_to_wc_modeling/cell_modeling/simulation/multi_algorithm/model.py - About 45 mins to fix

                Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def __init__(self, submodels=None, compartments=None, species=None, reactions=None, parameters=None, references=None):
                Severity: Minor
                Found in intro_to_wc_modeling/cell_modeling/simulation/multi_algorithm/model.py - About 45 mins to fix

                  Function analyzeResults has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def analyzeResults(mdl, time, volume, growth, speciesCounts, output_directory):

                    Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def __init__(self, k_m=5, k_n=20, gamma_m=numpy.log(2) * 60 / 3, gamma_n=numpy.log(2) / 10, m_0=1, n_0=98):

                      Function analyzeResults has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      def analyzeResults(mdl, time, volume, growth, speciesCounts, output_directory):

                        Function simulate has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def simulate(reaction_stochiometries, kinetic_laws, init_copy_number, time_max, time_step):
                        Severity: Minor
                        Found in intro_to_wc_modeling/cell_modeling/simulation/stochastic.py - About 35 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                          return 'unstable spiral source'

                            Function calcMass has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def calcMass(self):
                                    for comp in self.compartments:
                                        if comp.id == 'c':
                                            iCellComp = comp.index
                            
                            Severity: Minor
                            Found in intro_to_wc_modeling/cell_modeling/simulation/multi_algorithm/model.py - About 25 mins to fix

                            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 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def __init__(self, submodels=None, compartments=None, species=None, reactions=None, parameters=None, references=None):
                                    if submodels is None:
                                        submodels = []
                                    if compartments is None:
                                        compartments = []
                            Severity: Minor
                            Found in intro_to_wc_modeling/cell_modeling/simulation/multi_algorithm/model.py - About 25 mins to fix

                            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 setComponentIndices has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def setComponentIndices(self):
                                    for index, obj in enumerate(self.submodels):
                                        obj.index = index
                                    for index, obj in enumerate(self.compartments):
                                        obj.index = index
                            Severity: Minor
                            Found in intro_to_wc_modeling/cell_modeling/simulation/multi_algorithm/model.py - About 25 mins to fix

                            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 simulate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def simulate(self, t_0=0., t_end=100., t_step=1.):
                                    """ Run the simulation
                            
                                    Args:
                                        t_0 (:obj:`float`, optional): initial time (h)

                            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 get_scale has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def get_scale(units, compartmentId, volume, extracellularVolume):
                                """ Get the scale for a unit
                            
                                Args:
                                    units (:obj:`str`): units

                            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

                            Severity
                            Category
                            Status
                            Source
                            Language