KarrLab/datanator

View on GitHub
datanator/data_source/sabio_rk.py

Summary

Maintainability
F
3 wks
Test Coverage
B
89%

File sabio_rk.py has 1466 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-

"""
:Author: Yosef Roth <yosefdroth@gmail.com>
:Author: Jonathan Karr <jonrkarr@gmail.com>
Severity: Major
Found in datanator/data_source/sabio_rk.py - About 3 days to fix

    Function normalize_parameter_value has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
    Open

        def normalize_parameter_value(self, name, type, value, error, units, enzyme_molecular_weight):
            """
            Args:
                name (:obj:`str`): parameter name
                type (:obj:`int`) parameter type (SBO term id)
    Severity: Minor
    Found in datanator/data_source/sabio_rk.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

    Function load_compounds has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
    Open

        def load_compounds(self, compounds=None):
            """ Download information from SABIO-RK about all of the compounds stored in the local sqlite copy of SABIO-RK
    
            Args:
                compounds (:obj:`list` of :obj:`Compound`): list of compounds to download
    Severity: Minor
    Found in datanator/data_source/sabio_rk.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

    Function load_missing_kinetic_law_information_from_tsv_helper has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
    Open

        def load_missing_kinetic_law_information_from_tsv_helper(self, tsv):
            """ Update the properties of kinetic laws in the local sqlite database based on content downloaded
            from SABIO in TSV format.
    
            Note: this method is necessary because neither of SABIO's SBML and Excel export methods provide
    Severity: Minor
    Found in datanator/data_source/sabio_rk.py - About 6 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 create_kinetic_law_from_sbml has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

        def create_kinetic_law_from_sbml(self, id, sbml, specie_properties, functions, units):
            """ Add a kinetic law to the local sqlite database
    
            Args:
                id (:obj:`int`): identifier
    Severity: Minor
    Found in datanator/data_source/sabio_rk.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 infer_compound_structures_from_names has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

        def infer_compound_structures_from_names(self, compounds):
            """ Try to use PubChem to infer the structure of compounds from their names
    
            Notes: we don't try look up structures from their cross references because SABIO has already gathered
            all structures from their cross references to ChEBI, KEGG, and PubChem
    Severity: Minor
    Found in datanator/data_source/sabio_rk.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 parse_complex_subunit_structure has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

        def parse_complex_subunit_structure(self, text):
            """ Parse the subunit structure of complex into a dictionary of subunit coefficients
    
            Args:
                text (:obj:`str`): subunit structure described with nested parentheses
    Severity: Minor
    Found in datanator/data_source/sabio_rk.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 create_cross_references_from_sbml has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

        def create_cross_references_from_sbml(self, sbml):
            """ Add cross references to the local sqlite database for an SBML object
    
            Args:
                sbml (:obj:`libsbml.SBase`): object in an SBML documentation
    Severity: Minor
    Found in datanator/data_source/sabio_rk.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 load_content has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

        def load_content(self):
            """ Download the content of SABIO-RK and store it to a local sqlite database. """
    
            ##################################
            ##################################
    Severity: Minor
    Found in datanator/data_source/sabio_rk.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 calc_enzyme_molecular_weights has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

        def calc_enzyme_molecular_weights(self, enzymes):
            """ Calculate the molecular weight of each enzyme
    
            Args:
                enzymes (:obj:`list` of :obj:`Enzyme`): list of enzymes
    Severity: Minor
    Found in datanator/data_source/sabio_rk.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 create_specie_from_sbml has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

        def create_specie_from_sbml(self, sbml):
            """ Add a species to the local sqlite database
    
            Args:
                sbml (:obj:`libsbml.Species`): SBML-representation of a compound or enzyme
    Severity: Minor
    Found in datanator/data_source/sabio_rk.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

    SabioRk has 23 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class SabioRk(data_source.HttpDataSource):
        """ A local sqlite copy of the SABIO-RK database
    
        Attributes:
            webservice_batch_size (:obj:`int`): default size of batches to download kinetic information from the SABIO webservice. Note:
    Severity: Minor
    Found in datanator/data_source/sabio_rk.py - About 2 hrs to fix

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

          def load_missing_enzyme_information_from_html(self, ids):
              """ Loading enzyme subunit information from html
      
              Args:
                  ids (:obj:`list` of :obj:`int`): list of IDs of kinetic laws to download
      Severity: Minor
      Found in datanator/data_source/sabio_rk.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 __init__ has 14 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(self, name=None, cache_dirname=None, clear_content=False, load_content=False, max_entries=float('inf'),
      Severity: Major
      Found in datanator/data_source/sabio_rk.py - About 1 hr to fix

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

            def get_parameter_by_properties(self, kinetic_law, parameter_properties):
                """ Get the parameter of :obj:`kinetic_law` whose attribute values are equal to that of :obj:`parameter_properties`
        
                Args:
                    kinetic_law (:obj:`KineticLaw`): kinetic law to find parameter of
        Severity: Minor
        Found in datanator/data_source/sabio_rk.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 create_kinetic_laws_from_sbml has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

            def create_kinetic_laws_from_sbml(self, ids, sbml):
                """ Add kinetic laws defined in an SBML file to the local sqlite database
        
                Args:
                    ids (:obj:`list` of :obj:`int`): list kinetic law IDs
        Severity: Minor
        Found in datanator/data_source/sabio_rk.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 create_kinetic_law_from_sbml has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def create_kinetic_law_from_sbml(self, id, sbml, specie_properties, functions, units):
                """ Add a kinetic law to the local sqlite database
        
                Args:
                    id (:obj:`int`): identifier
        Severity: Minor
        Found in datanator/data_source/sabio_rk.py - About 1 hr to fix

          Function load_content has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def load_content(self):
                  """ Download the content of SABIO-RK and store it to a local sqlite database. """
          
                  ##################################
                  ##################################
          Severity: Minor
          Found in datanator/data_source/sabio_rk.py - About 1 hr to fix

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

                def calc_stats(self):
                    """ Calculate statistics about SABIO-RK
            
                    Returns:
                        :obj:`list` of :obj:`list` of :obj:`obj`: list of list of statistics
            Severity: Minor
            Found in datanator/data_source/sabio_rk.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 load_kinetic_laws has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def load_kinetic_laws(self, ids):
                    """ Download kinetic laws from SABIO-RK
            
                    Args:
                        ids (:obj:`list` of :obj:`int`): list of IDs of kinetic laws to download
            Severity: Minor
            Found in datanator/data_source/sabio_rk.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 normalize_kinetic_laws has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def normalize_kinetic_laws(self, ids):
                    """ Normalize parameter values
            
                    Args:
                        ids (:obj:`list` of :obj:`int`): list of IDs of kinetic laws to download
            Severity: Minor
            Found in datanator/data_source/sabio_rk.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 normalize_parameter_value has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def normalize_parameter_value(self, name, type, value, error, units, enzyme_molecular_weight):
            Severity: Minor
            Found in datanator/data_source/sabio_rk.py - About 45 mins to fix

              Function get_specie_reference_from_sbml has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  def get_specie_reference_from_sbml(self, specie_id):
                      """ Get the compound/enzyme associated with an SBML species by its ID
              
                      Args:
                          specie_id (:obj:`str`): ID of an SBML species
              Severity: Minor
              Found in datanator/data_source/sabio_rk.py - About 45 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 deeply nested control flow statements.
              Open

                                      if seqs:
                                          subunit.sequence = next((seq['Sequence'] for seq in seqs if seq['Entry'] == xref.id), seqs[0]['Sequence'])
                                          iupac_seq = re.sub(r'[^' + Bio.Alphabet.IUPAC.IUPACProtein.letters + r']', '', subunit.sequence)
                                          subunit.molecular_weight = \
                                              + Bio.SeqUtils.molecular_weight(iupac_seq, seq_type='protein') \
              Severity: Major
              Found in datanator/data_source/sabio_rk.py - About 45 mins to fix

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

                    def create_kinetic_law_from_sbml(self, id, sbml, specie_properties, functions, units):
                Severity: Minor
                Found in datanator/data_source/sabio_rk.py - About 35 mins to fix

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

                      def load_missing_kinetic_law_information_from_tsv(self, ids):
                          """ Update the properties of kinetic laws in the local sqlite database based on content downloaded
                          from SABIO in TSV format.
                  
                          Args:
                  Severity: Minor
                  Found in datanator/data_source/sabio_rk.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 (None, None, None, None, None)
                  Severity: Major
                  Found in datanator/data_source/sabio_rk.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                    return (None, None, None, None, None)
                    Severity: Major
                    Found in datanator/data_source/sabio_rk.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                      return (None, None, None, None, None)
                      Severity: Major
                      Found in datanator/data_source/sabio_rk.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                            return ('v_max', 186, value, error, 'mol*s^(-1)*g^(-1)')
                        Severity: Major
                        Found in datanator/data_source/sabio_rk.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                          return (None, None, None, None, None)
                          Severity: Major
                          Found in datanator/data_source/sabio_rk.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                            return (None, None, None, None, None)
                            Severity: Major
                            Found in datanator/data_source/sabio_rk.py - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                              return (None, None, None, None, None)
                              Severity: Major
                              Found in datanator/data_source/sabio_rk.py - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                                return (None, None, None, None, None)
                                Severity: Major
                                Found in datanator/data_source/sabio_rk.py - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                          return None
                                  Severity: Major
                                  Found in datanator/data_source/sabio_rk.py - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                                    return (None, None, None, None, None)
                                    Severity: Major
                                    Found in datanator/data_source/sabio_rk.py - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                                      return (None, None, None, None, None)
                                      Severity: Major
                                      Found in datanator/data_source/sabio_rk.py - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                                        return (None, None, None, None, None)
                                        Severity: Major
                                        Found in datanator/data_source/sabio_rk.py - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                                      return parameters[0]
                                          Severity: Major
                                          Found in datanator/data_source/sabio_rk.py - About 30 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                                            return ('k_i', 261, value, error, 'M')
                                            Severity: Major
                                            Found in datanator/data_source/sabio_rk.py - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                              return ('k_m', 27, value, error, 'M')
                                              Severity: Major
                                              Found in datanator/data_source/sabio_rk.py - About 30 mins to fix

                                                Avoid too many return statements within this function.
                                                Open

                                                                return (None, None, None, None, None)
                                                Severity: Major
                                                Found in datanator/data_source/sabio_rk.py - About 30 mins to fix

                                                  Avoid too many return statements within this function.
                                                  Open

                                                                  return (None, None, None, None, None)
                                                  Severity: Major
                                                  Found in datanator/data_source/sabio_rk.py - About 30 mins to fix

                                                    Avoid too many return statements within this function.
                                                    Open

                                                                    return (None, None, None, None, None)
                                                    Severity: Major
                                                    Found in datanator/data_source/sabio_rk.py - About 30 mins to fix

                                                      Avoid too many return statements within this function.
                                                      Open

                                                                      return (None, None, None, None, None)
                                                      Severity: Major
                                                      Found in datanator/data_source/sabio_rk.py - About 30 mins to fix

                                                        Avoid too many return statements within this function.
                                                        Open

                                                                            return ('k_cat', 25, value * float(f) if value else None, error * float(f) if error else None, 's^(-1)')
                                                        Severity: Major
                                                        Found in datanator/data_source/sabio_rk.py - About 30 mins to fix

                                                          Avoid too many return statements within this function.
                                                          Open

                                                                          return ('k_cat', 25, value, error, 's^(-1)')
                                                          Severity: Major
                                                          Found in datanator/data_source/sabio_rk.py - About 30 mins to fix

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

                                                                def calc_inchi_formula_connectivity(self):
                                                                    """ Calculate a searchable structures
                                                            
                                                                    * InChI format
                                                                    * Core InChI format
                                                            Severity: Minor
                                                            Found in datanator/data_source/sabio_rk.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 parse_enzyme_name has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                            Open

                                                                def parse_enzyme_name(self, sbml):
                                                                    """ Parse the name of an enzyme in SBML for the enzyme name, wild type status, and variant
                                                                    description that it contains.
                                                            
                                                                    Args:
                                                            Severity: Minor
                                                            Found in datanator/data_source/sabio_rk.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

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                        if smiles_label_node:
                                                                            for node in list(smiles_label_node.parents)[1].find_all('span'):
                                                                                value = node.get_text()
                                                                                q = self.session.query(CompoundStructure).filter_by(format='smiles', value=value)
                                                                                if q.count():
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 1 other location - About 6 hrs to fix
                                                            datanator/data_source/sabio_rk.py on lines 1595..1603

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 104.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                        if inchi_label_node:
                                                                            for node in list(inchi_label_node.parents)[1].find_all('span'):
                                                                                value = node.get_text()
                                                                                q = self.session.query(CompoundStructure).filter_by(format='inchi', value=value)
                                                                                if q.count():
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 1 other location - About 6 hrs to fix
                                                            datanator/data_source/sabio_rk.py on lines 1606..1614

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 104.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                    for i_part in range(reactants.size()):
                                                                        part_sbml = reactants.get(i_part)
                                                                        compound, compartment = self.get_specie_reference_from_sbml(part_sbml.getSpecies())
                                                                        part = ReactionParticipant(
                                                                            compound=compound,
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 1 other location - About 5 hrs to fix
                                                            datanator/data_source/sabio_rk.py on lines 979..987

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 86.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                    for i_part in range(products.size()):
                                                                        part_sbml = products.get(i_part)
                                                                        compound, compartment = self.get_specie_reference_from_sbml(part_sbml.getSpecies())
                                                                        part = ReactionParticipant(
                                                                            compound=compound,
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 1 other location - About 5 hrs to fix
                                                            datanator/data_source/sabio_rk.py on lines 967..975

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 86.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Identical blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                        if not response.text:
                                                                            cache = session.cache
                                                                            key = cache.create_key(response.request)
                                                                            cache.delete(key)
                                                                            raise Exception('Unable to download kinetic laws with ids {}'.format(', '.join([str(id) for id in batch_ids])))
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 1 other location - About 3 hrs to fix
                                                            datanator/data_source/sabio_rk.py on lines 1370..1374

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 70.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Identical blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                        if not response.text:
                                                                            cache = session.cache
                                                                            key = cache.create_key(response.request)
                                                                            cache.delete(key)
                                                                            raise Exception('Unable to download kinetic laws with ids {}'.format(', '.join([str(id) for id in batch_ids])))
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 1 other location - About 3 hrs to fix
                                                            datanator/data_source/sabio_rk.py on lines 687..691

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 70.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Identical blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                        return (parameter.compound is None and parameter_properties['associatedSpecies'] is None) or \
                                                                            (parameter.compound is not None and parameter.compound.name == parameter_properties['associatedSpecies'])
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 1 other location - About 2 hrs to fix
                                                            datanator/data_source/sabio_rk.py on lines 1511..1512

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 60.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Identical blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                            ((parameter.compound is None and parameter_properties['associatedSpecies'] is None) or
                                                                             (parameter.compound is not None and parameter.compound.name == parameter_properties['associatedSpecies']))
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 1 other location - About 2 hrs to fix
                                                            datanator/data_source/sabio_rk.py on lines 1526..1527

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 60.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 4 locations. Consider refactoring.
                                                            Open

                                                            kinetic_law_resource = sqlalchemy.Table(
                                                                'kinetic_law_resource', Base.metadata,
                                                                sqlalchemy.Column('kinetic_law__id', sqlalchemy.Integer, sqlalchemy.ForeignKey('kinetic_law._id'), index=True),
                                                                sqlalchemy.Column('resource__id', sqlalchemy.Integer, sqlalchemy.ForeignKey('resource._id'), index=True),
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 3 other locations - About 2 hrs to fix
                                                            datanator/data_source/sabio_rk.py on lines 41..44
                                                            datanator/data_source/sabio_rk.py on lines 48..51
                                                            datanator/data_source/sabio_rk.py on lines 55..58

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 56.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 4 locations. Consider refactoring.
                                                            Open

                                                            entry_synonym = sqlalchemy.Table(
                                                                'entry_synonym', Base.metadata,
                                                                sqlalchemy.Column('entry__id', sqlalchemy.Integer, sqlalchemy.ForeignKey('entry._id'), index=True),
                                                                sqlalchemy.Column('synonym__id', sqlalchemy.Integer, sqlalchemy.ForeignKey('synonym._id'), index=True),
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 3 other locations - About 2 hrs to fix
                                                            datanator/data_source/sabio_rk.py on lines 48..51
                                                            datanator/data_source/sabio_rk.py on lines 55..58
                                                            datanator/data_source/sabio_rk.py on lines 62..65

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 56.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 4 locations. Consider refactoring.
                                                            Open

                                                            compound_compound_structure = sqlalchemy.Table(
                                                                'compound_compound_structure', Base.metadata,
                                                                sqlalchemy.Column('compound__id', sqlalchemy.Integer, sqlalchemy.ForeignKey('compound._id'), index=True),
                                                                sqlalchemy.Column('compound_structure__id', sqlalchemy.Integer, sqlalchemy.ForeignKey('compound_structure._id'), index=True),
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 3 other locations - About 2 hrs to fix
                                                            datanator/data_source/sabio_rk.py on lines 41..44
                                                            datanator/data_source/sabio_rk.py on lines 48..51
                                                            datanator/data_source/sabio_rk.py on lines 62..65

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 56.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 4 locations. Consider refactoring.
                                                            Open

                                                            entry_resource = sqlalchemy.Table(
                                                                'entry_resource', Base.metadata,
                                                                sqlalchemy.Column('entry__id', sqlalchemy.Integer, sqlalchemy.ForeignKey('entry._id'), index=True),
                                                                sqlalchemy.Column('resource__id', sqlalchemy.Integer, sqlalchemy.ForeignKey('resource._id'), index=True),
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 3 other locations - About 2 hrs to fix
                                                            datanator/data_source/sabio_rk.py on lines 41..44
                                                            datanator/data_source/sabio_rk.py on lines 55..58
                                                            datanator/data_source/sabio_rk.py on lines 62..65

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 56.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 3 locations. Consider refactoring.
                                                            Open

                                                                        if row['parameter.startValue'] in ['', '-']:
                                                                            parameter['startValue'] = None
                                                                        else:
                                                                            parameter['startValue'] = float(row['parameter.startValue'])
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 2 other locations - About 2 hrs to fix
                                                            datanator/data_source/sabio_rk.py on lines 1439..1442
                                                            datanator/data_source/sabio_rk.py on lines 1445..1448

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 52.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 3 locations. Consider refactoring.
                                                            Open

                                                                        if row['parameter.endValue'] in ['', '-']:
                                                                            parameter['endValue'] = None
                                                                        else:
                                                                            parameter['endValue'] = float(row['parameter.endValue'])
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 2 other locations - About 2 hrs to fix
                                                            datanator/data_source/sabio_rk.py on lines 1433..1436
                                                            datanator/data_source/sabio_rk.py on lines 1445..1448

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 52.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 3 locations. Consider refactoring.
                                                            Open

                                                                        if row['parameter.standardDeviation'] in ['', '-']:
                                                                            parameter['standardDeviation'] = None
                                                                        else:
                                                                            parameter['standardDeviation'] = float(row['parameter.standardDeviation'])
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 2 other locations - About 2 hrs to fix
                                                            datanator/data_source/sabio_rk.py on lines 1433..1436
                                                            datanator/data_source/sabio_rk.py on lines 1439..1442

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 52.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                        if row['parameter.unit'] in ['', '-']:
                                                                            parameter['unit'] = None
                                                                        else:
                                                                            parameter['unit'] = row['parameter.unit']
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 1 other location - About 1 hr to fix
                                                            datanator/data_source/sabio_rk.py on lines 1427..1430

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 48.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                        if row['parameter.associatedSpecies'] in ['', '-']:
                                                                            parameter['associatedSpecies'] = None
                                                                        else:
                                                                            parameter['associatedSpecies'] = row['parameter.associatedSpecies']
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 1 other location - About 1 hr to fix
                                                            datanator/data_source/sabio_rk.py on lines 1451..1454

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 48.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                    new_ids = list(set(ids).difference(set(l.id for l in self.session.query(KineticLaw).all())))
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 1 other location - About 1 hr to fix
                                                            datanator/data_source/sabio_rk.py on lines 546..546

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 45.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                    loaded_new_ids = list(set(new_ids).intersection(set(l.id for l in self.session.query(KineticLaw).all())))
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 1 other location - About 1 hr to fix
                                                            datanator/data_source/sabio_rk.py on lines 519..519

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 45.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 6 locations. Consider refactoring.
                                                            Open

                                                                        if self.verbose and (i_kinetic_law % 100 == 0):
                                                                            print('  Loading enzyme information for {} of {} kinetic laws'.format(i_kinetic_law + 1, len(kinetic_laws)))
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 5 other locations - About 1 hr to fix
                                                            datanator/data_source/metabolite_nosql.py on lines 94..96
                                                            datanator/data_source/sabio_rk.py on lines 581..583
                                                            datanator/data_source/sabio_rk.py on lines 1128..1129
                                                            datanator/data_source/sabio_rk.py on lines 1674..1675
                                                            datanator/data_source/sabio_rk.py on lines 1837..1838

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 43.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 6 locations. Consider refactoring.
                                                            Open

                                                                        if self.verbose and (i_compound_structure % 100 == 0):
                                                                            print('  Calculating searchable structure for compound {} of {}'.format(
                                                                                i_compound_structure + 1, len(compound_structures)))
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 5 other locations - About 1 hr to fix
                                                            datanator/data_source/metabolite_nosql.py on lines 94..96
                                                            datanator/data_source/sabio_rk.py on lines 1128..1129
                                                            datanator/data_source/sabio_rk.py on lines 1674..1675
                                                            datanator/data_source/sabio_rk.py on lines 1726..1727
                                                            datanator/data_source/sabio_rk.py on lines 1837..1838

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 43.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 6 locations. Consider refactoring.
                                                            Open

                                                                        if self.verbose and i_enzyme % 100 == 0:
                                                                            print('  Calculating molecular weight of enzyme {} of {}'.format(i_enzyme + 1, len(enzymes)))
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 5 other locations - About 1 hr to fix
                                                            datanator/data_source/metabolite_nosql.py on lines 94..96
                                                            datanator/data_source/sabio_rk.py on lines 581..583
                                                            datanator/data_source/sabio_rk.py on lines 1128..1129
                                                            datanator/data_source/sabio_rk.py on lines 1674..1675
                                                            datanator/data_source/sabio_rk.py on lines 1726..1727

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 43.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 6 locations. Consider refactoring.
                                                            Open

                                                                        if self.verbose and (i_compound % 100 == 0):
                                                                            print('  Trying to infer the structure of compound {} of {}'.format(i_compound + 1, len(compounds)))
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 5 other locations - About 1 hr to fix
                                                            datanator/data_source/metabolite_nosql.py on lines 94..96
                                                            datanator/data_source/sabio_rk.py on lines 581..583
                                                            datanator/data_source/sabio_rk.py on lines 1128..1129
                                                            datanator/data_source/sabio_rk.py on lines 1726..1727
                                                            datanator/data_source/sabio_rk.py on lines 1837..1838

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 43.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 6 locations. Consider refactoring.
                                                            Open

                                                                        if self.verbose and (i_law % 100 == 0):
                                                                            print('  Normalizing kinetic law {} of {}'.format(i_law + 1, len(ids)))
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 5 other locations - About 1 hr to fix
                                                            datanator/data_source/metabolite_nosql.py on lines 94..96
                                                            datanator/data_source/sabio_rk.py on lines 581..583
                                                            datanator/data_source/sabio_rk.py on lines 1674..1675
                                                            datanator/data_source/sabio_rk.py on lines 1726..1727
                                                            datanator/data_source/sabio_rk.py on lines 1837..1838

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 43.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Identical blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                        batch_ids = ids[i_batch * batch_size:min((i_batch + 1) * batch_size, len(ids))]
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 1 other location - About 1 hr to fix
                                                            datanator/data_source/sabio_rk.py on lines 1356..1356

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 40.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Identical blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                        batch_ids = ids[i_batch * batch_size:min((i_batch + 1) * batch_size, len(ids))]
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 1 other location - About 1 hr to fix
                                                            datanator/data_source/sabio_rk.py on lines 681..681

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 40.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                        n_value_entries = session \
                                                                            .query(Parameter) \
                                                                            .filter(Parameter.observed_type == sbo_id, Parameter.observed_value.isnot(None)) \
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 1 other location - About 1 hr to fix
                                                            datanator/data_source/sabio_rk.py on lines 1914..1916

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 38.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                        usable = session \
                                                                            .query(Parameter) \
                                                                            .filter(Parameter.observed_type == sbo_id, Parameter.value.isnot(None)) \
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 1 other location - About 1 hr to fix
                                                            datanator/data_source/sabio_rk.py on lines 1898..1900

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 38.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                        if query.count():
                                                                            specie = query.first()
                                                                        else:
                                                                            specie = Enzyme()
                                                                            self.session.add(specie)
                                                            Severity: Minor
                                                            Found in datanator/data_source/sabio_rk.py and 1 other location - About 50 mins to fix
                                                            datanator/data_source/sabio_rk.py on lines 838..842

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 36.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                        if query.count():
                                                                            specie = query.first()
                                                                        else:
                                                                            specie = Compound()
                                                                            self.session.add(specie)
                                                            Severity: Minor
                                                            Found in datanator/data_source/sabio_rk.py and 1 other location - About 50 mins to fix
                                                            datanator/data_source/sabio_rk.py on lines 848..852

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 36.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 4 locations. Consider refactoring.
                                                            Open

                                                                products = sqlalchemy.orm.relationship('ReactionParticipant', backref=sqlalchemy.orm.backref('product_kinetic_law'),
                                                                                                       foreign_keys=[ReactionParticipant.product_kinetic_law_id],
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 3 other locations - About 45 mins to fix
                                                            datanator/data_source/sabio_rk.py on lines 259..260
                                                            datanator/data_source/sabio_rk.py on lines 274..275
                                                            datanator/data_source/sabio_rk.py on lines 276..277

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 35.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 4 locations. Consider refactoring.
                                                            Open

                                                                modifiers = sqlalchemy.orm.relationship('ReactionParticipant', backref=sqlalchemy.orm.backref('modifier_kinetic_law'),
                                                                                                        foreign_keys=[ReactionParticipant.modifier_kinetic_law_id],
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 3 other locations - About 45 mins to fix
                                                            datanator/data_source/sabio_rk.py on lines 259..260
                                                            datanator/data_source/sabio_rk.py on lines 262..263
                                                            datanator/data_source/sabio_rk.py on lines 274..275

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 35.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 4 locations. Consider refactoring.
                                                            Open

                                                                reactants = sqlalchemy.orm.relationship('ReactionParticipant', backref=sqlalchemy.orm.backref('reactant_kinetic_law'),
                                                                                                        foreign_keys=[ReactionParticipant.reactant_kinetic_law_id],
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 3 other locations - About 45 mins to fix
                                                            datanator/data_source/sabio_rk.py on lines 262..263
                                                            datanator/data_source/sabio_rk.py on lines 274..275
                                                            datanator/data_source/sabio_rk.py on lines 276..277

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 35.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 4 locations. Consider refactoring.
                                                            Open

                                                                parameters = sqlalchemy.orm.relationship('Parameter', backref=sqlalchemy.orm.backref('kinetic_law'),
                                                                                                         foreign_keys=[Parameter.kinetic_law_id], cascade='all, delete-orphan')
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 3 other locations - About 45 mins to fix
                                                            datanator/data_source/sabio_rk.py on lines 259..260
                                                            datanator/data_source/sabio_rk.py on lines 262..263
                                                            datanator/data_source/sabio_rk.py on lines 276..277

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 35.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                    kinetic_law.taxon = next((int(float(x_ref.id)) for x_ref in reaction_x_refs if x_ref.namespace == 'taxonomy'), None)
                                                            Severity: Minor
                                                            Found in datanator/data_source/sabio_rk.py and 1 other location - About 40 mins to fix
                                                            datanator/data_source/sabio_rk.py on lines 954..954

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 34.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                def get_smiles_structures(self):
                                                                    """ Get SMILES-formatted structures
                                                            
                                                                    Returns:
                                                                        :obj:`list` of :obj:`str`: list of structures in SMILES format
                                                            Severity: Minor
                                                            Found in datanator/data_source/sabio_rk.py and 1 other location - About 40 mins to fix
                                                            datanator/data_source/sabio_rk.py on lines 358..364

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 34.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                    annotated_id = next((int(float(x_ref.id)) for x_ref in x_refs if x_ref.namespace == 'sabiork.kineticrecord'), None)
                                                            Severity: Minor
                                                            Found in datanator/data_source/sabio_rk.py and 1 other location - About 40 mins to fix
                                                            datanator/data_source/sabio_rk.py on lines 1070..1070

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 34.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                def get_inchi_structures(self):
                                                                    """ Get InChI-formatted structures
                                                            
                                                                    Returns:
                                                                        :obj:`list` of :obj:`str`: list of structures in InChI format
                                                            Severity: Minor
                                                            Found in datanator/data_source/sabio_rk.py and 1 other location - About 40 mins to fix
                                                            datanator/data_source/sabio_rk.py on lines 366..372

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 34.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 5 locations. Consider refactoring.
                                                            Open

                                                                enzyme = sqlalchemy.orm.relationship(
                                                                    'Enzyme', uselist=False,
                                                                    backref=sqlalchemy.orm.backref('parameters'),
                                                                    foreign_keys=[enzyme_id])
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 4 other locations - About 35 mins to fix
                                                            datanator/data_source/sabio_rk.py on lines 208..211
                                                            datanator/data_source/sabio_rk.py on lines 218..221
                                                            datanator/data_source/sabio_rk.py on lines 266..266
                                                            datanator/data_source/sabio_rk.py on lines 268..269

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 33.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 5 locations. Consider refactoring.
                                                            Open

                                                                compound = sqlalchemy.orm.relationship(
                                                                    'Compound', uselist=False, 
                                                                    backref=sqlalchemy.orm.backref('parameters'), 
                                                                    foreign_keys=[compound_id])
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 4 other locations - About 35 mins to fix
                                                            datanator/data_source/sabio_rk.py on lines 213..216
                                                            datanator/data_source/sabio_rk.py on lines 218..221
                                                            datanator/data_source/sabio_rk.py on lines 266..266
                                                            datanator/data_source/sabio_rk.py on lines 268..269

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 33.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 5 locations. Consider refactoring.
                                                            Open

                                                                enzyme_compartment = sqlalchemy.orm.relationship(
                                                                    'Compartment', uselist=False, backref=sqlalchemy.orm.backref('kinetic_laws'), foreign_keys=[enzyme_compartment_id])
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 4 other locations - About 35 mins to fix
                                                            datanator/data_source/sabio_rk.py on lines 208..211
                                                            datanator/data_source/sabio_rk.py on lines 213..216
                                                            datanator/data_source/sabio_rk.py on lines 218..221
                                                            datanator/data_source/sabio_rk.py on lines 266..266

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 33.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 5 locations. Consider refactoring.
                                                            Open

                                                                compartment = sqlalchemy.orm.relationship(
                                                                    'Compartment', uselist=False,
                                                                    backref=sqlalchemy.orm.backref('parameters'),
                                                                    foreign_keys=[compartment_id])
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 4 other locations - About 35 mins to fix
                                                            datanator/data_source/sabio_rk.py on lines 208..211
                                                            datanator/data_source/sabio_rk.py on lines 213..216
                                                            datanator/data_source/sabio_rk.py on lines 266..266
                                                            datanator/data_source/sabio_rk.py on lines 268..269

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 33.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Similar blocks of code found in 5 locations. Consider refactoring.
                                                            Open

                                                                enzyme = sqlalchemy.orm.relationship('Enzyme', uselist=False, backref=sqlalchemy.orm.backref('kinetic_laws'), foreign_keys=[enzyme_id])
                                                            Severity: Major
                                                            Found in datanator/data_source/sabio_rk.py and 4 other locations - About 35 mins to fix
                                                            datanator/data_source/sabio_rk.py on lines 208..211
                                                            datanator/data_source/sabio_rk.py on lines 213..216
                                                            datanator/data_source/sabio_rk.py on lines 218..221
                                                            datanator/data_source/sabio_rk.py on lines 268..269

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 33.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Identical blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                        if self.commit_intermediate_results and (i_compound % 100 == 99):
                                                                            self.session.commit()
                                                            Severity: Minor
                                                            Found in datanator/data_source/sabio_rk.py and 1 other location - About 30 mins to fix
                                                            datanator/data_source/sabio_rk.py on lines 1658..1659

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 32.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            Identical blocks of code found in 2 locations. Consider refactoring.
                                                            Open

                                                                        if self.commit_intermediate_results and (i_compound % 100 == 99):
                                                                            self.session.commit()
                                                            Severity: Minor
                                                            Found in datanator/data_source/sabio_rk.py and 1 other location - About 30 mins to fix
                                                            datanator/data_source/sabio_rk.py on lines 1708..1709

                                                            Duplicated Code

                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                            Tuning

                                                            This issue has a mass of 32.

                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                            Refactorings

                                                            Further Reading

                                                            There are no issues that match your filters.

                                                            Category
                                                            Status