KarrLab/datanator

View on GitHub

Showing 376 of 791 total issues

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

    def fill_species_name(self):
        ncbi_taxon_ids = self.collection.distinct('ncbi_taxonomy_id')
        start = 0
        for i, _id in enumerate(ncbi_taxon_ids[start:]):
            if i == self.max_entries:
Severity: Minor
Found in datanator/data_source/uniprot_nosql.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_nosql.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 download_content has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def download_content(self):
        """ Download data from FTP server """
        if not os.path.exists(os.path.join(self.cache_dirname, 'intact')):
            os.makedirs(os.path.join(self.cache_dirname, 'intact'))
        if not os.path.exists(os.path.join(self.cache_dirname, 'intact', 'complextab')):
Severity: Minor
Found in datanator/data_source/intact_nosql.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 replace_key_in_similar_compounds has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def replace_key_in_similar_compounds(self):
        query = {}
        projection = {'similar_compounds': 1}
        _, _, col = self.con_db('metabolites_meta')
        docs = col.find(filter=query, projection=projection)
Severity: Minor
Found in datanator/data_source/metabolites_meta_collection.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 fill_trna_primary has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def fill_trna_primary(self, file_location, sheet_name='tRNA', start_row=[0],
                        use_columns='A:H', column_names=['Amino_acid', 'aa_Code', 'aa_Name',
                        'kegg_orthology_id', 'kegg_gene_Name', 'Definition', 'kegg_Pathway_id',
                        'kegg_Pathway_name']):
        """
Severity: Minor
Found in datanator/data_source/rna_modification/rna_modification.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 fill_meta has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def fill_meta(self):
        """Fill exisiting metabolites with meta information.
        """
        query = {'inchikey': {'$exists': False}}
        count = self.collection.count_documents(query)

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

    def calc_inchi_formula_connectivity(self, structure):
        """ Calculate a searchable structures

        * InChI format
        * Core InChI format
Severity: Minor
Found in datanator/data_source/sabio_rk_nosql.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 fill_species_name has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def fill_species_name(self):
        """[summary]
        """
        query = {'halflives.ncbi_taxonomy_id': 10090}
        docs = self.rna_hl_collection.find(filter=query)
Severity: Minor
Found in datanator/data_source/rna_halflife/doi_10_1101_gr_131037_111.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 extract_enzyme_names has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def extract_enzyme_names(self, doc):
        """Extract enzyme names
        
        Args:
            doc (:obj:`dict`): sabio_rk_old document
Severity: Minor
Found in datanator/data_source/sabio_reaction.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

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

    def fill_rna_halflife(self, df):
        """Fill RNA Half life collection with relevant documents.

        Args:
            df (:obj:`pandas.DataFrame`): dataframe to be loaded.
Severity: Minor
Found in datanator/data_source/rna_halflife/doi_10_1016_j_cell_2013_12_026.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_fullname_taxid has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def parse_fullname_taxid(self):
        '''Parse fullnamelineage.dmp and taxidlineage.dmp store in MongoDB
           Always run first before loading anything else
           (insert_one)
        '''
Severity: Minor
Found in datanator/data_source/taxon_tree.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 calc_reactant_product_pairs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def calc_reactant_product_pairs(reaction):
    """ Get list of pairs of similar reactants and products using a greedy algorithm.

    Args:
        reaction (:obj:`data_model.Reaction`): reaction
Severity: Minor
Found in datanator/util/reaction_util.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 __init__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self, structure):
        """
        Args:
            structure (:obj:`str`): InChI-encoded structure of a molecule

Severity: Minor
Found in datanator/util/molecule_util.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 get_format has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def get_format(self):
        """ Get the format of the structure

        Returns:
            :obj:`str`: format
Severity: Minor
Found in datanator/util/molecule_util.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 build_entity has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

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

        Args:
Severity: Minor
Found in datanator/schema_2/transform_metabolites_meta.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

Severity
Category
Status
Source
Language