KarrLab/datanator

View on GitHub

Showing 376 of 791 total issues

Function download_cdna has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

def download_cdna(ref_genome, strain_name, url, temp_directory):
    CDNA_DIR = "{}/CDNA_FILES".format(temp_directory)
    if not os.path.isdir(CDNA_DIR):
        os.makedirs(CDNA_DIR)
    file_name = "{}/{}.cdna.all.fa.gz".format(CDNA_DIR, strain_name)
Severity: Minor
Found in datanator/data_source/process_rna_seq/core.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 reset_cellular_locations has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    def reset_cellular_locations(self, start=0):
        """Github (https://github.com/KarrLab/datanator_rest_api/issues/69)
        """
        query = {'cellular_locations': {'$ne': None}}
        count = self.collection.count_documents(query) - start
Severity: Minor
Found in datanator/data_source/metabolites_meta_collection.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_abundance_from_pax has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    def load_abundance_from_pax(self):
        '''
            Load protein abundance data but interating from pax collection.
        '''
        _, _, col_pax = self.mongo_manager.con_db('pax')
Severity: Minor
Found in datanator/data_source/protein_aggregate.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 calc_enzyme_molecular_weights has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    def calc_enzyme_molecular_weights(self, enzymes, length):
        """ Calculate the molecular weight of each enzyme

        Args:
            enzymes (:obj:`list` of :obj:`dict`): list of enzymes
Severity: Minor
Found in datanator/data_source/sabio_rk_nosql.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 quant has 15 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def quant(self, fastq_filenames, index_filename=None, output_dirname=None,
Severity: Major
Found in datanator/util/rna_seq_util.py - About 1 hr to fix

    Function fill_abundance_publication has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        def fill_abundance_publication(self, start=0):
            """(https://github.com/KarrLab/datanator/issues/51)
    
            Args:
                start(:obj:`int`, optional): beginning of documents.
    Severity: Minor
    Found in datanator/data_source/uniprot_nosql.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_abundance_from_pax has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        def load_abundance_from_pax(self):
            '''Load protein abundance data but interating from pax collection.
            '''
            _, _, col_pax = self.con_db('pax')
            query = {}
    Severity: Minor
    Found in datanator/data_source/uniprot_nosql.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_uniprot has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        def load_uniprot(self, query=False, msg='', species=None):
            """Build dataframe
            
            Args:
                query (:obj:`bool`, optional): Whether download all reviewed entries of perform individual queries. Defaults to False.
    Severity: Minor
    Found in datanator/data_source/uniprot_nosql.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_missing_enzyme_information_from_html has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        def load_missing_enzyme_information_from_html(self, ids, start=0):
            """ 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_nosql.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 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 fill_rna_halflife has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def fill_rna_halflife(self, df, species):
              """load data into rna_halflife collection
              
              Args:
                  df (:obj:`pandas.DataFrame`): dataframe to be loaded into the database
      Severity: Minor
      Found in datanator/data_source/rna_halflife/doi_10_1093_nar_gks1019.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 a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def __init__(self, name=None, cache_dirname=None, clear_content=False, load_content=False, max_entries=float('inf'),
                       commit_intermediate_results=False, download_backups=True, verbose=False,
                       quilt_owner=None, quilt_package=None):
              """
              Args:
      Severity: Minor
      Found in datanator/core/data_source.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 quant has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def quant(self, fastq_filenames, index_filename=None, output_dirname=None,
                    bias=False, bootstrap_samples=0, seed=42, plaintext=False, fusion=False,
                    single_end_reads=False, forward_stranded=False, reverse_stranded=False,
                    fragment_length=None, fragment_length_std=None,
                    threads=1, pseudobam=False):
      Severity: Minor
      Found in datanator/util/rna_seq_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 extract_values has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def extract_values(self, obj, key):
              """Pull all values of specified key from nested JSON.
              """
              arr = []
      
      
      Severity: Minor
      Found in datanator/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 process_docs has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def process_docs(self, skip=0):
              query = {}
              projection = {"_id": 0}
              docs = self.client["datanator-test"]["metabolite_concentrations"].find(filter=query, projection=projection)
              for i, doc in enumerate(docs):
      Severity: Minor
      Found in datanator/schema_2/transform_metabolite_concentrations.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 one_to_many has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def one_to_many(self, inchi, collection_str='metabolites_meta',
                          field='inchi', lookup='InChI_Key', num=100):
              ''' Calculate tanimoto coefficients between one
              metabolite and the rest of the 'collection_str'
              Args:
      Severity: Minor
      Found in datanator/util/calc_tanimoto.py - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function run has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def run(self):
              # create dict of MODOMICS single character monomer codes
              modomics_short_code_to_monomer = {}
              for monomer in bpforms.rna_alphabet.monomers.values():
                  for identifier in monomer.identifiers:
      Severity: Minor
      Found in datanator/data_source/modomics.py - About 1 hr to fix

        Function build_obs has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def build_obs(self, data, i, doc):
                """Build observation objects from obj.
                Go into observations collection.
                Args:
                    data (:obj:`Obj`): source object.

          Function _flatten_conc_obj has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              def _flatten_conc_obj(self, obj, ncbi_id, species_name, _id, source='ECMDB'):
                  """Flatten concentrations object in ec/ymdb.
          
                  Args:
                      obj(:obj:`Obj`): concentrations object.

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

          def get_ftp_url(url):
              ftp_url = None
              attempts = 0
              while attempts < 10:
                  try:
          Severity: Minor
          Found in datanator/data_source/array_express_tools/ensembl_tools.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

          Severity
          Category
          Status
          Source
          Language