KarrLab/wc_sim

View on GitHub

Showing 107 of 141 total issues

File species_populations.py has 1555 lines of code (exceeds 250 allowed). Consider refactoring.
Open

""" Store species populations, and partition them among submodel private species and shared species

:Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu>
:Author: Jonathan Karr <karr@mssm.edu>
:Author: Arthur Goldberg, Arthur.Goldberg@mssm.edu
Severity: Major
Found in wc_sim/species_populations.py - About 4 days to fix

    File verify.py has 1280 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """
    :Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu>
    :Author: Yin Hoon Chew <yinhoon.chew@mssm.edu>
    :Date: 2018-09-17
    :Copyright: 2018, Karr Lab
    Severity: Major
    Found in wc_sim/testing/verify.py - About 3 days to fix

      File dynamic_components.py has 1162 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      """ Dynamic components of a multialgorithm simulation
      
      :Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu>
      :Author: Jonathan Karr <karr@mssm.edu>
      :Date: 2018-02-07
      Severity: Major
      Found in wc_sim/dynamic_components.py - About 2 days to fix

        File dfba.py has 703 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        """ A submodel that uses Dynamic Flux Balance Analysis (dFBA) to model a set of reactions
        
        :Author: Yin Hoon Chew <yinhoon.chew@mssm.edu>
        :Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu>
        :Date: 2020-07-29
        Severity: Major
        Found in wc_sim/submodels/dfba.py - About 1 day to fix

          Function read_model has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
          Open

              def read_model(self, sbml_version='l3v2', model_file_suffix='-wc_lang.xlsx'):
                  """  Read a model into a `wc_lang` representation
          
                  dFBA test cases are read directly from SBML, whereas other cases are read from WC Lang spreadsheets.
          
          
          Severity: Minor
          Found in wc_sim/testing/verify.py - About 1 day 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

          File utils.py has 439 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          """ Utilities for testing
          
          :Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu>
          :Date: 2019-10-26
          :Copyright: 2019, Karr Lab
          Severity: Minor
          Found in wc_sim/testing/utils.py - About 6 hrs to fix

            File time_ordered_list.py has 392 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            """ Doubly-linked list ordered by time
            
            :Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu>
            :Date: 2019-11-20
            :Copyright: 2019, Karr Lab
            Severity: Minor
            Found in wc_sim/utils/time_ordered_list.py - About 5 hrs to fix

              File run_results.py has 386 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              """ Store and retrieve combined results of a multialgorithmic simulation run
              
              :Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu>
              :Author: Jonathan Karr <karr@mssm.edu>
              :Date: 2018-05-20
              Severity: Minor
              Found in wc_sim/run_results.py - About 5 hrs to fix

                File multialgorithm_simulation.py has 370 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                """ Initialize a multialgorithm simulation from a language model and run-time parameters
                
                :Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu>
                :Date: 2017-02-07
                :Copyright: 2016-2019, Karr Lab
                Severity: Minor
                Found in wc_sim/multialgorithm_simulation.py - About 4 hrs to fix

                  Function add_test_submodel has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def add_test_submodel(cls, model, model_type, submodel_num, comp, species_types,
                                            default_species_copy_number, default_species_std,
                                            species_copy_numbers, species_stds, expressions,
                                            submodel_framework='WC:stochastic_simulation_algorithm'):
                          """ Create a test submodel
                  Severity: Minor
                  Found in wc_sim/testing/make_models.py - About 4 hrs 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

                  File sim_config.py has 356 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  """ Classes to represent WC simulation configurations and import/export configurations to/from SED-ML
                  
                  :Author: Jonathan Karr <karr@mssm.edu>
                  :Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu>
                  :Date: 2017-08-19
                  Severity: Minor
                  Found in wc_sim/sim_config.py - About 4 hrs to fix

                    Function verify_model has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def verify_model(self, num_discrete_stochastic_runs=None, discard_run_results=True, plot_file=None,
                                         ode_time_step_factor=None, tolerances=None, evaluate=False):
                            """ Verify a model
                    
                            Args:
                    Severity: Minor
                    Found in wc_sim/testing/verify.py - About 4 hrs 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 analyze has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def analyze(file):  # pragma: no cover
                        atols = set()
                        rtols = set()
                        cases = set()
                        data = {}
                    Severity: Minor
                    Found in wc_sim/testing/analyze_tolerances.py - About 3 hrs 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 a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def plot(model, time = np.zeros(0),
                        species_counts = None, volume = np.zeros(0), extracellular_volume = np.zeros(0),
                        selected_species_compartments = [],
                        yDatas = {},
                        units = 'mM', title = '', fileName = ''):
                    Severity: Minor
                    Found in temp_wc_analysis/analysis.py - About 3 hrs 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 determine_dependencies has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def determine_dependencies(self):
                            """ Determine the dependencies that rate laws have on executed reactions
                    
                            In a multi-algorithmic simulation, two types of dependencies arise when NRM considers which
                            rate laws to update after a reaction executes:
                    Severity: Minor
                    Found in wc_sim/submodels/nrm.py - About 3 hrs 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 obtain_expression_usage has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def obtain_expression_usage(model):
                        """ Obtain the use of expressions by rate laws in a WC Lang model
                    
                        Adapted from DynamicModel.obtain_dependencies.
                    
                    
                    Severity: Minor
                    Found in presentation_2020_07_06_WC_sim_for_H1_model/h1_model_properties.py - About 3 hrs 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

                    File make_models.py has 309 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    """ Make simple models for testing
                    
                    :Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu>
                    :Author: Jonathan Karr <karr@mssm.edu>
                    :Date: 2018-04-27
                    Severity: Minor
                    Found in wc_sim/testing/make_models.py - About 3 hrs to fix

                      Function make_test_model has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def make_test_model(cls, model_type,
                                              init_vols=None,
                                              init_vol_stds=None,
                                              density=1100,
                                              molecular_weight=10.,
                      Severity: Minor
                      Found in wc_sim/testing/make_models.py - About 2 hrs 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 differs has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def differs(self):
                              """ Evaluate whether the species amounts predicted by simulation run(s) differ from the correct amounts
                      
                              Returns:
                                  :obj:`obj`: `False` if amounts in the simulation run(s) and the correct amounts are equal
                      Severity: Minor
                      Found in wc_sim/testing/verify.py - About 2 hrs 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 64 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      def plot(model, results, filename):
                          # get expected results
                          mean_doubling_time = model.parameters.get_one(id='mean_doubling_time').value
                      
                          cytosol = model.compartments.get_one(id='c')
                      Severity: Major
                      Found in examples/translation_metabolism_hybrid_model/run.py - About 2 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language