KarrLab/datanator_query_python

View on GitHub

Showing 101 of 190 total issues

Function __init__ has 10 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_intact_complex.py - About 1 hr to fix

    Function __init__ has 10 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_sabio_compound.py - About 1 hr to fix

      Function get_equivalent_species has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_equivalent_species(self, _id, max_distance, max_depth=float('inf')):
              '''
                  Get equivalent species of species with tax_id _id,
                  given the max taxonomic distances, for instance, given three species
                  {'tax_id': 8, 'anc_id': [5,4,3,2,6,7]}
      Severity: Minor
      Found in datanator_query_python/query/query_taxon_tree.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 __init__ has 10 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_protein.py - About 1 hr to fix

        Function __init__ has 10 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_xmdb.py - About 1 hr to fix

          Function get_metabolite_synonyms has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              def get_metabolite_synonyms(self, compounds):
                  ''' Find synonyms of a compound
          
                      Args:
                          compound (list): name(s) of the compound e.g. "ATP", ["ATP", "Oxygen", ...]
          Severity: Minor
          Found in datanator_query_python/query/query_metabolites_meta.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 __init__ has 10 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def __init__(self, cache_dirname=None, MongoDB=None, replicaSet=None, db='datanator',
          Severity: Major
          Found in datanator_query_python/query/query_sabiork.py - About 1 hr to fix

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

                def __init__(self, cache_dirname=None, MongoDB=None, replicaSet=None, db=None,
            Severity: Major
            Found in datanator_query_python/query/query_metabolites.py - About 1 hr to fix

              Function __init__ has 10 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_corum.py - About 1 hr to fix

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

                    def __init__(self, cache_dirname=None, MongoDB=None, replicaSet=None, db='test',
                Severity: Major
                Found in datanator_query_python/util/mongo_util.py - About 1 hr to fix

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

                      def __init__(self, server=None, username=None, password=None, verbose=False,
                  Severity: Major
                  Found in datanator_query_python/query/query_rna_halflife.py - About 1 hr to fix

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

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

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

                          def __init__(self, MongoDB=None, replicaSet=None, db='test',
                      Severity: Major
                      Found in datanator_query_python/util/motor_util.py - About 1 hr to fix

                        Function __init__ has 9 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_orthology.py - About 1 hr to fix

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

                              def get_canon_common_ancestor_fast(self, org1, org2, org_format='tax_id'):
                                  ''' 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 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 flatten_json has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def flatten_json(self, nested_json):
                                  '''
                                      Flatten json object with nested keys into a single level.
                                      e.g. 
                                      {a: b,                      {a: b,  
                          Severity: Minor
                          Found in datanator_query_python/util/file_util.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 get_info_by_entryid has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def get_info_by_entryid(self, entry_id, target_organism=None, size=10, last_id=0):
                                  """Find reactions by sabio entry id, return all information
                                  
                                  Args:
                                      entry_id (:obj:`int`): entry_id
                          Severity: Minor
                          Found in datanator_query_python/query/query_sabiork_old.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 get_conc_from_inchi has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def get_conc_from_inchi(self, inchi, inchi_key=False, consensus=False, projection={'_id': 0}):
                                  ''' Given inchi, find the metabolite's concentration
                                      values.
                          
                                      Args: 
                          Severity: Minor
                          Found in datanator_query_python/query/query_metabolites.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 __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, profile_name=None, credential_path=None,
                            Severity: Major
                            Found in datanator_query_python/query/full_text_search.py - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language