KarrLab/wc_sim

View on GitHub
examples/transcription_translation_hybrid_model/run_with_custom_code.py

Summary

Maintainability
B
6 hrs
Test Coverage

Function sim_hyb has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def sim_hyb(rxns, rate_params, init_species, init_time, max_time, checkpoint_period):
    """ Simulate model with SSA/ODE hybrid

    Args:
        rxns (:obj:`dict`): reaction participants and rate laws

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

      def sim_hyb(rxns, rate_params, init_species, init_time, max_time, checkpoint_period):
      Severity: Minor
      Found in examples/transcription_translation_hybrid_model/run_with_custom_code.py - About 45 mins to fix

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

        def sim_ssa(rxns, rate_params, init_species, init_time, max_time, checkpoint_period):
        Severity: Minor
        Found in examples/transcription_translation_hybrid_model/run_with_custom_code.py - About 45 mins to fix

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

          def sim_ode(rxns, rate_params, init_species, init_time, max_time, checkpoint_period):
          Severity: Minor
          Found in examples/transcription_translation_hybrid_model/run_with_custom_code.py - About 45 mins to fix

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

                def func(ys, time, species_ids, rxns, rate_params):
            Severity: Minor
            Found in examples/transcription_translation_hybrid_model/run_with_custom_code.py - About 35 mins to fix

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

              def sim_ssa(rxns, rate_params, init_species, init_time, max_time, checkpoint_period):
                  """ Simulate model with SSA
              
                  Args:
                      rxns (:obj:`dict`): reaction participants and rate laws
              Severity: Minor
              Found in examples/transcription_translation_hybrid_model/run_with_custom_code.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

              There are no issues that match your filters.

              Category
              Status