KarrLab/wc_sim

View on GitHub

Showing 107 of 141 total issues

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

def check_simul_results(test_case, dynamic_model, results_dir, integration_framework=None,
Severity: Major
Found in wc_sim/testing/utils.py - About 1 hr to fix

    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
    Severity: Minor
    Found in wc_sim/run_results.py - About 1 hr to fix

      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
      Severity: Minor
      Found in wc_sim/submodels/nrm.py - About 1 hr 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 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
      
      
      Severity: Minor
      Found in wc_sim/simulation.py - About 1 hr 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 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
      
      
      Severity: Minor
      Found in wc_sim/testing/verify.py - About 1 hr 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 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
      Severity: Minor
      Found in wc_sim/model_utilities.py - About 1 hr 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 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
      Severity: Minor
      Found in wc_sim/species_populations.py - About 1 hr 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 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 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)
        Severity: Minor
        Found in wc_sim/testing/analyze_tolerances.py - About 1 hr to fix

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

              def __init__(self, id, dynamic_model, reactions, species, dynamic_compartments,
          Severity: Major
          Found in wc_sim/submodels/ssa.py - About 1 hr to fix

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

                def __init__(self, id, dynamic_model, reactions, species, dynamic_compartments,
            Severity: Major
            Found in wc_sim/submodels/odes.py - About 1 hr to fix

              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,
                Severity: Major
                Found in wc_sim/submodels/dfba.py - About 1 hr to fix

                  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
                  Severity: Minor
                  Found in wc_sim/testing/verify.py - About 55 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 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:
                  Severity: Minor
                  Found in wc_sim/submodels/dfba.py - About 55 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 concentrations_to_populations has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def concentrations_to_populations(self, time, species, concentrations, dynamic_model, populations,
                  Severity: Major
                  Found in wc_sim/species_populations.py - About 50 mins to fix

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

                        def __init__(self, species_name, random_state, initial_population, cont_submodel_ids=None,
                    Severity: Major
                    Found in wc_sim/species_populations.py - About 50 mins to fix

                      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):
                      Severity: Major
                      Found in wc_sim/testing/verify.py - About 50 mins to fix

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

                            def __init__(self, name, initial_population, molecular_weights, initial_population_slopes=None,
                        Severity: Major
                        Found in wc_sim/species_populations.py - About 50 mins to fix

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

                              def __init__(self, id, dynamic_model, reactions, species, dynamic_compartments,
                          Severity: Major
                          Found in wc_sim/submodels/testing/deterministic_simulation_algorithm.py - About 50 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language