Showing 376 of 791 total issues
Avoid deeply nested control flow statements. Open
for i_monomer in range(monomer2.start_position, monomer2.end_position + 1):
if form.seq[i_monomer - 1] == monomers[seq[i_monomer - 1]]:
monomer2.base_monomers = [bpforms.protein_alphabet.monomers.get(seq[i_monomer - 1])]
form.seq[i_monomer - 1] = monomer2
set_monomer = True
Function create_kinetic_law_from_sbml
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_kinetic_law_from_sbml(self, id, sbml, root_species, specie_properties, functions, units):
Function normalize_parameter_value
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def normalize_parameter_value(self, name, type, value, error, units, enzyme_molecular_weight):
Function normalize_kinetic_laws
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def normalize_kinetic_laws(self, new_ids):
""" Normalize parameter values.
Args:
new_ids (:obj:`list` of :obj:`int`): list of IDs of kinetic laws to normalize
- Read upRead up
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
Avoid deeply nested control flow statements. Open
if characteristic.category.lower() == 'organism':
organism = characteristic.value
if characteristic.category.lower() in SYNONYMS_PRIORITY_LIST[i]:
Avoid deeply nested control flow statements. Open
if monomer['mod']:
codes.add(monomer['mod'].get_canonical_code(monomer_codes))
msg = 'Modified monomeric form {} potentially inconsistent with residue {} != {}'.format(
Avoid deeply nested control flow statements. Open
if start_position == 0:
protein['modified_errors'].append('Sequence does not contain residue {} for modification {}'.format(
canonical_code, modification['monomer']))
else:
monomer2.start_position = start_position
Avoid deeply nested control flow statements. Open
for base in origin:
start_pos = seq.find(base) + 1
if start_pos > 0:
start_position = min(start_position, start_pos)
Avoid deeply nested control flow statements. Open
if position >= processing['start'] and position <= processing['end']:
processed_position = seq_len + position - processing['start'] + 1
break
seq_len += processing['end'] - processing['start'] + 1
Function load_ko_from_uniprot
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def load_ko_from_uniprot(self):
"""loading ko number from uniprot collection into
aggregate collection (one shot after building new uniprot collection)
"""
query = {'ko_number': {'$exists': False}}
- Read upRead up
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 find_protein_gene
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def find_protein_gene(self, interactor, alias):
""" Parse the protein and gene identifiers from key-value pairs of interactors and their aliases
Args:
interactor (:obj:`str`): key-value pairs of interactor
- Read upRead up
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_processed_data_samples
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_processed_data_samples(samples, output_directory, temp_directory):
for sample in samples:
if sample.ensembl_info and sample.fastq_urls:
download_cdna(sample.ensembl_info[0].ref_genome, sample.ensembl_info[0].organism_strain, sample.ensembl_info[0].url, temp_directory)
fastq_urls = ""
- Read upRead up
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 gen_bpform
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def gen_bpform(self, protein, pro_ids_to_bpform_monomers, monomer_codes,
Avoid deeply nested control flow statements. Open
if form.seq[position - 1] == monomers[seq[position - 1]]:
if monomer not in bpforms.protein_alphabet.monomers.values():
monomer.base_monomers = [form.seq[position - 1]]
form.seq[position - 1] = monomer
else:
Avoid deeply nested control flow statements. Open
for k in range(len(cur_compound_compound_structure_list)):
compound_structure__id = cur_compound_compound_structure_list[
k]['compound_structure__id']
cur_compound_structure_dict = next(
item for item in compound_structure_list if item['_id'] == compound_structure__id)
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, MongoDB, db, entity_query_collection, taxon_query_collection, username, password):
Function fill_rna_halflife
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def fill_rna_halflife(self, df, start=0):
"""Fill rna_halflife collection with information parsed
from the publication
Args:
- Read upRead up
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
Avoid deeply nested control flow statements. Open
if val_type == 'ID':
ec_data = self.parse_ec_code(data, val_content)
else:
self.parse_content(ec_code, ec_data, val_type, val_content)
Function get_specie_reference_from_sbml
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_specie_reference_from_sbml(self, specie_id):
""" Get the compound/enzyme associated with an SBML species by its ID
Args:
specie_id (:obj:`str`): ID of an SBML species
- Read upRead up
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
Avoid deeply nested control flow statements. Open
for k in range(len(cur_entry_synonym_list)):
cur_entry_synonym_dict = cur_entry_synonym_list[k]
synonym__id = cur_entry_synonym_dict['synonym__id']
synonyms.append(
synonym_list[synonym__id-1]['name'])