KarrLab/datanator_query_python

View on GitHub

Showing 101 of 190 total issues

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

    def __init__(self, MongoDB=None, db=None, username=None, password=None,
Severity: Major
Found in datanator_query_python/aggregate/tabu.py - About 1 hr to fix

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

        def __init__(self, username=None, password=None, server=None, authSource='admin',
    Severity: Major
    Found in datanator_query_python/query/query_kegg_organism_code.py - About 1 hr to fix

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

          def __init__(self, username=None, password=None, server=None, authSource='admin',
      Severity: Major
      Found in datanator_query_python/query/query_uniprot.py - About 1 hr to fix

        Function get_all_kegg has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def get_all_kegg(self, ko, anchor, max_distance):
                '''Get replacement abundance value by taxonomic distance
                    with the same kegg_orthology number.
        
                Args:
        Severity: Minor
        Found in datanator_query_python/query/query_protein.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 get_all_ortho has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def get_all_ortho(self, ko, anchor, max_distance):
                '''Get replacement abundance value by taxonomic distance
                    with the same OrthoDB group number.
        
                Args:
        Severity: Minor
        Found in datanator_query_python/query/query_protein.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 get_kinlaw_by_environment has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def get_kinlaw_by_environment(self, taxon=None, taxon_wildtype=None, ph_range=None, temp_range=None,
        Severity: Major
        Found in datanator_query_python/query/query_sabiork.py - About 50 mins to fix

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

              def get_entity_datatype(self, 
          Severity: Major
          Found in datanator_query_python/query_schema_2/query_observation.py - About 50 mins to fix

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

                def get_kinlaw_by_rxn(self, substrates, products, dof=0,
            Severity: Major
            Found in datanator_query_python/query/query_sabiork_old.py - About 50 mins to fix

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

                  def get_kinlaw_by_rxn_ortho(self, substrates, products, dof=0,
              Severity: Major
              Found in datanator_query_python/query/query_sabiork_old.py - About 50 mins to fix

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

                    def aggregate_taxon_distance(self, match, local_field, _as, 
                Severity: Major
                Found in datanator_query_python/aggregate/pipelines.py - About 50 mins to fix

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

                      def get_num_source(self, q, q_index, index, fields=['name', 'synonyms'], 
                  Severity: Major
                  Found in datanator_query_python/query/full_text_search.py - About 50 mins to fix

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

                        def get_kinlaw_by_environment(self, taxon=None, taxon_wildtype=None, ph_range=None, temp_range=None,
                    Severity: Major
                    Found in datanator_query_python/query/query_sabiork_old.py - About 50 mins to fix

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

                          def __init__(self, query, api='https://www.uniprot.org/uniprot/?', include='yes', compress='no',
                      Severity: Minor
                      Found in datanator_query_python/query/query_uniprot_org.py - About 45 mins to fix

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

                            def __init__(self, 
                        Severity: Minor
                        Found in datanator_query_python/config/query_schema_2_manager.py - About 45 mins to fix

                          Function get_kinlaw_by_rxn_name has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def get_kinlaw_by_rxn_name(self, substrates, products,
                          Severity: Minor
                          Found in datanator_query_python/query/query_sabiork_old.py - About 45 mins to fix

                            Function query_entity has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def query_entity(self, 
                            Severity: Minor
                            Found in datanator_query_python/query_schema_2/query_entity.py - About 45 mins to fix

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

                                  def get_ids_by_participant_inchikey(self, substrates, products, dof=1):
                                      ''' Find the kinlaw_id defined in sabio_rk using 
                                          rxn participants' inchikey
                              
                                          Args:
                              Severity: Minor
                              Found in datanator_query_python/query/query_sabio_reaction_entries.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

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

                                  def get_common_ancestor(self, org1, org2, org_format='name'):
                                      ''' Get the closest common ancestor between
                                          two organisms and their distances to the 
                                          said ancestor
                                          Args:
                              Severity: Minor
                              Found in datanator_query_python/query/query_taxon_tree.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

                              Function update_entity has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def update_entity(self,
                              Severity: Minor
                              Found in datanator_query_python/util/mongo_util.py - About 45 mins to fix

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

                                    def get_num_source(self, q, q_index, index, fields=['name', 'synonyms'], 
                                                        count=10, from_=0, batch_size=100):
                                        """Extract a count number of source (ecmdb, ymdb, metabolite_meta, etc) index
                                        from ftx search result
                                        
                                Severity: Minor
                                Found in datanator_query_python/query/full_text_search.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

                                Severity
                                Category
                                Status
                                Source
                                Language