KarrLab/wc_sim

View on GitHub

Showing 107 of 141 total issues

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

    def __init__(self, dynamic_model, random_state, wc_lang_compartment, species_ids=None):
Severity: Minor
Found in wc_sim/dynamic_components.py - About 35 mins to fix

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

    def analyzeResults(model, time, volume, growth, speciesCounts):
    Severity: Minor
    Found in temp_wc_analysis/exercise.py - About 35 mins to fix

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

          def continuous_adjustment(self, time, cont_submodel_id, population_slope, time_step=None):
      Severity: Minor
      Found in wc_sim/species_populations.py - About 35 mins to fix

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

            def read_into_array(self, time, species, populations, round=True):
        Severity: Minor
        Found in wc_sim/species_populations.py - About 35 mins to fix

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

              def adjust_continuously(self, time, cont_submodel_id, population_slopes, time_step=None):
          Severity: Minor
          Found in wc_sim/species_populations.py - About 35 mins to fix

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

                def get_population(self, time, interpolate=None, round=None, temporary_mode=False):
            Severity: Minor
            Found in wc_sim/species_populations.py - About 35 mins to fix

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

                  def __init__(self, test_cases_root_dir, test_case_type, test_case_num,
              Severity: Minor
              Found in wc_sim/testing/verify.py - About 35 mins to fix

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

                    def __init__(self, name, period, contributors, aggregation_function, **kwargs):
                Severity: Minor
                Found in wc_sim/aggregate_distributed_props.py - About 35 mins to fix

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

                      def scale_conv_opt_model(self, conv_opt_model, copy_model=True,
                  Severity: Minor
                  Found in wc_sim/submodels/dfba.py - About 35 mins to fix

                    Function check_simul_results has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def check_simul_results(test_case, dynamic_model, results_dir, integration_framework=None,
                                            expected_initial_values=None,
                                            expected_times=None, expected_species_trajectories=None,
                                            expected_property_trajectories=None, rel_tol=1e-7):
                        """ Evaluate whether a simulation predicted the expected results
                    Severity: Minor
                    Found in wc_sim/testing/utils.py - About 35 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 convert_metadata has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def convert_metadata(self, metadata_class):
                            """ Convert the saved simulation metadata into HDF5 attributes on a `metadata` Group
                    
                            Args:
                                metadata_class (:obj:`EnhancedDataClass`): the class that stored the metadata
                    Severity: Minor
                    Found in wc_sim/run_results.py - About 35 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 get_species_id has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def get_species_id(self, species_type):
                            """ Get the species id of a species type
                    
                            Raises an error if the given species type is contained in multiple compartments. I believe
                            that this doesn't occur for models in the SBML test suite.
                    Severity: Minor
                    Found in wc_sim/testing/verify.py - About 35 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 annotate_heatmap has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def annotate_heatmap(im, data=None, valfmt="{x:.2f}",
                                         textcolors=["black", "white"],
                                         threshold=None, **textkw): # pragma: no cover
                        """
                        A function to annotate a heatmap.
                    Severity: Minor
                    Found in wc_sim/testing/analyze_tolerances.py - About 35 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 adjust_continuously has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def adjust_continuously(self, time, cont_submodel_id, population_slopes, time_step=None):
                            """ A continuous submodel adjusts the population slopes of a set of species at simulation time `time`
                    
                            Species retain the population slopes to interpolate the population until the next
                            call to `adjust_continuously`.
                    Severity: Minor
                    Found in wc_sim/species_populations.py - About 35 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

                    Avoid too many return statements within this function.
                    Open

                                return (next_node._data.pop_before - prev_node._data.pop_after) / \
                    Severity: Major
                    Found in wc_sim/utils/time_ordered_list.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return self._slope_between_node_pair(left_node)
                      Severity: Major
                      Found in wc_sim/utils/time_ordered_list.py - About 30 mins to fix

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

                            def __init__(self, id, dynamic_model, reactions, species, dynamic_compartments,
                                         local_species_population, ode_time_step, options=None):
                                """ Initialize an ODE submodel instance
                        
                                Args:
                        Severity: Minor
                        Found in wc_sim/submodels/odes.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 prepare_tolerances has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def prepare_tolerances(self):
                                """ Prepare tolerance dictionary
                        
                                Use values from `verification_test_reader.settings` if available, otherwise from
                                `numpy.allclose()`s defaults.
                        Severity: Minor
                        Found in wc_sim/testing/verify.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 get_concentrations has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def get_concentrations(self, compartment_id=None):
                                """ Get species concentrations at checkpoint times
                        
                                Args:
                                    compartment_id (:obj:`str`, optional): if provided, obtain concentrations for species in
                        Severity: Minor
                        Found in wc_sim/run_results.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 get_data has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def get_data():
                            datafile = os.path.join(os.path.dirname(__file__), '..', 'data', '2019-11-22_run_ode_solver_w_internal.tsv')
                            with open(datafile, 'r') as fh:
                                while(True):
                                    line = fh.readline()   # discard header lines
                        Severity: Minor
                        Found in multialg_analysis/code/analyze_ode_steps.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

                        Severity
                        Category
                        Status
                        Source
                        Language