KarrLab/datanator

View on GitHub

Showing 376 of 791 total issues

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

    def fill_uniprot(self, url, sheet_name, usercols='B:D', skiprows=[0,1,2],
Severity: Minor
Found in datanator/data_source/rna_halflife/doi_10_1093_nar_gks1019.py - About 35 mins to fix

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

        def __init__(self, 
    Severity: Minor
    Found in datanator/data_source/protein_localization/database_demo.py - About 35 mins to fix

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

          def __init__(self, MongoDB=None,
      Severity: Minor
      Found in datanator/schema_2/transform_metabolites_meta.py - About 35 mins to fix

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

            def one_to_many(self, inchi, collection_str='metabolites_meta',
        Severity: Minor
        Found in datanator/util/calc_tanimoto.py - About 35 mins to fix

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

              def parse_pathway_disease(self, lines, category='pathway'):
                  """Parse parthway or disease or module information
                  
                  Args:
                      line (:obj:`readlines()`): pathway lines.
          Severity: Minor
          Found in datanator/data_source/kegg_orthology.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

          Function load_kinetic_laws has a Cognitive Complexity of 7 (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_nosql.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

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

              def remove_redudant_id(self):
                  """Remove redundant entries in uniprot collection.
                  Priority:
                      1. Has 'abundances' field
                      1. Has 'ko_name' field
          Severity: Minor
          Found in datanator/data_source/uniprot_nosql.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

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

              def bulk_load(self, bulk_size=100):
                  """Loading bulk data into MongoDB.
                  
                  Args:
                      bulk_size(:obj:`int`): number of entries per insertion. Defaults to 100.
          Severity: Minor
          Found in datanator/data_source/kegg_org_code.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

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

          def get_json_ends(tree):
              ends = []
              nodes = [tree]
              while nodes:
                  new_nodes = []
          Severity: Minor
          Found in datanator/data_source/array_express_tools/ensembl_tools.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

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

              def load_ko(self):
                  '''Load ko number for uniprot_id if such information
                     exists
                  '''
                  query = {}
          Severity: Minor
          Found in datanator/data_source/protein_aggregate.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

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

              def fill_trna_collection(self, file_location, start_row=0,
                                      column_names=[],
                                      reference={'doi': '10.1093/nar/gkx1030'},
                                      query='amino_acid'):
                  """
          Severity: Minor
          Found in datanator/data_source/rna_modification/rna_modification.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

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

              def update_directory(self):
                  data = pd.read_csv(self.dataset, delimiter='\t', nrows=10000)
                  data = data.where(pd.notnull(data), None)
          
                  for i in range(len(data)):

          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 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

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

              def createJSON(self):
                  data = pd.read_csv(self.dataset, delimiter='\t')
                  data = data.where(pd.notnull(data), None)
          
          

          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 _default has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def _default(self):
                  if self.app.pargs.by_name:
                      compounds = pubchempy.get_compounds(self.app.pargs.name_or_id, 'name')
                      results = [[compound.synonyms[0], 'pubchem.compound', compound.cid, compound.inchi] for compound in compounds]
                  else:
          Severity: Minor
          Found in datanator/__main__.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

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

              def add_taxon_info(self):
                  """Fill in taxonomic information
                  """
                  projection = {'_id': 0, 'kinlaw_id': 1, 'taxon_id': 1}
                  query = {}
          Severity: Minor
          Found in datanator/data_source/sabio_rk_json_mongo.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

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

              def build_entity(self, data, i):
                  """Build entity object from obj.
                  Go into entity collection
          
                  Args:

          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 label_existence has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def label_existence(self, start=0):
                  """Label reactant's existence in metabolites collections.
                  """
                  docs = self.metabolites_meta_manager.find({})
                  count = self.metabolites_meta_manager.count_documents({})
          Severity: Minor
          Found in datanator/data_source/sabio_reaction.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

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

              def stringify(self):
                  #TODO: Add the modifier
          
                  participants = self.get_ordered_participants()
                  result = ''
          Severity: Minor
          Found in datanator/core/data_model.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

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

              def process_docs(self, skip=0):
                  query = {}
                  projection = {"_id": 0}
                  docs = self.client["datanator-test"]["metabolites_meta"].find(filter=query, projection=projection)
                  for i, doc in enumerate(docs):
          Severity: Minor
          Found in datanator/schema_2/transform_metabolites_meta.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

          Severity
          Category
          Status
          Source
          Language