KarrLab/wc_model_gen

View on GitHub

Showing 120 of 341 total issues

File protein_degradation.py has 259 lines of code (exceeds 250 allowed). Consider refactoring.
Open

""" Generator for protein degradation submodel for eukaryotes
:Author: Yin Hoon Chew <yinhoon.chew@mssm.edu>
:Date: 2019-06-11
:Copyright: 2019, Karr Lab
:License: MIT
Severity: Minor
Found in wc_model_gen/eukaryote/protein_degradation.py - About 2 hrs to fix

    Function gen_kb_rate_laws has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        def gen_kb_rate_laws(self):
            """ Generate rate laws for reactions encoded in KB """
            kb = self.knowledge_base
            model = self.model
    
    
    Severity: Minor
    Found in wc_model_gen/prokaryote/initalize_model.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 calibrate_submodel has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        def calibrate_submodel(self):
            """ Calibrate the submodel by adjusting measured kinetic constants to achieve 
                the measured growth rate while minimizing the total necessary adjustment. 
                Kinetic constants that have no measured values are then imputed based on 
                values determined by Flux Variability Analysis.
    Severity: Minor
    Found in wc_model_gen/eukaryote/metabolism.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 gen_mass_action_rate_law has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    def gen_mass_action_rate_law(model, reaction, model_k, modifiers=None, modifier_reactants=None):
        """ Generate a mass action rate law.
    
            Example:
    
    
    Severity: Minor
    Found in wc_model_gen/utils.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 gen_reactions has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        def gen_reactions(self):
            """ Generate reactions associated with submodel """
            model = self.model
            cell = self.knowledge_base.cell
            nucleus = model.compartments.get_one(id='n')
    Severity: Minor
    Found in wc_model_gen/eukaryote/rna_degradation.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 flux_variability_analysis has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        def flux_variability_analysis(self, conv_model, fraction_of_objective=1.0, 
                fixed_values=None, target_reactions=None):
            """ Conduct flux variability analysis by:
                1) Optimizing the model by maximizing the objective function
                2) Setting the objective function to the optimal value
    Severity: Minor
    Found in wc_model_gen/eukaryote/metabolism.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 gen_rate_laws has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        def gen_rate_laws(self):
            """ Generate rate laws associated with min metabolism model
    
                Raises:
                    :obj:`ValueError:` if any phosphate species are missing from the model
    Severity: Minor
    Found in wc_model_gen/prokaryote/metabolism.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 gen_rate_laws has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def gen_rate_laws(self):
            """ Generate rate laws for the reactions in the submodel """
            model = self.model
            cell = self.knowledge_base.cell
    
    
    Severity: Minor
    Found in wc_model_gen/eukaryote/translation_translocation.py - About 1 hr to fix

      Function clean_and_validate_options has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def clean_and_validate_options(self):
              """ Apply default options and validate options """
              options = self.options
      
              transcription_unit = options.get('transcription_unit', {})
      Severity: Minor
      Found in wc_model_gen/eukaryote/transcription.py - About 1 hr to fix

        Function calibrate_submodel has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def calibrate_submodel(self):
                """ Calibrate the submodel using data in the KB """
                
                model = self.model        
                cell = self.knowledge_base.cell
        Severity: Minor
        Found in wc_model_gen/eukaryote/translation_translocation.py - About 1 hr to fix

          Function gen_reactions has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def gen_reactions(self):
                  """ Generate reactions associated with submodel """
                  model = self.model
                  cell = self.knowledge_base.cell
                  nucleus = model.compartments.get_one(id='n')
          Severity: Minor
          Found in wc_model_gen/eukaryote/transcription.py - About 1 hr to fix

            Function gen_rate_laws has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def gen_rate_laws(self):
                    """ Generate rate laws for the reactions in the submodel """
            
                    model = self.model        
                    cell = self.knowledge_base.cell
            Severity: Minor
            Found in wc_model_gen/eukaryote/transcription.py - About 1 hr to fix

              Function clean_and_validate_options has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def clean_and_validate_options(self):
                      """ Apply default options and validate options """
                      options = self.options
              
                      if 'cytoplasmic_ribosome' not in options:
              Severity: Minor
              Found in wc_model_gen/eukaryote/translation_translocation.py - About 1 hr to fix

                Function clean_and_validate_options has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def clean_and_validate_options(self):
                        """ Apply default options and validate options """
                        options = self.options
                
                        recycled_metabolites = options.get('recycled_metabolites', {})
                Severity: Minor
                Found in wc_model_gen/eukaryote/metabolism.py - About 1 hr to fix

                  Function gen_reactions has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def gen_reactions(self):
                          """ Generate reactions associated with submodel """
                          model = self.model
                          cell = self.knowledge_base.cell
                          submodel = model.submodels.get_one(id='protein_degradation')
                  Severity: Minor
                  Found in wc_model_gen/prokaryote/protein_degradation.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 clean_and_validate_options has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def clean_and_validate_options(self):
                          """ Apply default options and validate options """
                          options = self.options
                  
                          if 'cytoplasmic_ribosome' not in options:
                  Severity: Minor
                  Found in wc_model_gen/eukaryote/translation_translocation.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 determine_protein_structure_from_aa has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def determine_protein_structure_from_aa(self, 
                              polymer_id, count):
                          """ Determine the empirical formula, molecular weight and charge of
                              a protein based on the structural information of its metabolite
                              amino acid monomers to ensure consistency with the pH
                  Severity: Minor
                  Found in wc_model_gen/eukaryote/initialize_model.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):
                          """ Run all the components for initializing model from knowledge base """
                          self.clean_and_validate_options()
                          options = self.options
                  
                  
                  Severity: Minor
                  Found in wc_model_gen/eukaryote/initialize_model.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 calibrate_submodel has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def calibrate_submodel(self):
                          """ Calibrate the submodel using data in the KB """
                          
                          model = self.model        
                          cell = self.knowledge_base.cell
                  Severity: Minor
                  Found in wc_model_gen/eukaryote/transcription.py - About 1 hr to fix

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

                        def relax_bounds(self, target, lower_bound_adjustable, upper_bound_adjustable):
                            """ Relax bounds to achieve set target flux(es) while minimizing the total necessary adjustment
                                to the flux bounds
                            
                            Args:
                    Severity: Minor
                    Found in wc_model_gen/eukaryote/metabolism.py - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language