Showing 376 of 791 total issues
Function build_obs_peptide
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def build_obs_peptide(self, data, i, description):
"""Build observation objects from obj.
Go into observations collection.
Args:
data (:obj:`Obj`): source object.
- 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 seqs:
subunit.sequence = next((seq['Sequence'] for seq in seqs if seq['Entry'] == xref.id), seqs[0]['Sequence'])
iupac_seq = re.sub(r'[^' + Bio.Alphabet.IUPAC.IUPACProtein.letters + r']', '', subunit.sequence)
subunit.molecular_weight = \
+ Bio.SeqUtils.molecular_weight(iupac_seq, seq_type='protein') \
Function load_content
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def load_content(self):
'''Load kegg_reactions into MongoDB
'''
_, _, collection = self.con_db(self.collection)
- 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 doc is not None:
uniprot_id.append(doc)
yield {'org_gene': org_gene_str,
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, MongoDB, db, collection, username, password,
Function filter_comments
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def filter_comments(self, comments, enz_id):
filtered_comments = []
for comment in comments:
has_comment = False
for enz_ref_id in comment['enz_ref_ids']:
- 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 fill_ec_meta
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def fill_ec_meta(self, start=0):
"""Fill sabio documents with ec meta information.
"""
query = {}
docs = self.collection.find(filter=query)
- 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 "YMDB" in loc["reference"]:
values_y.append({"type": "cellular_location",
"value": l})
else:
values_e.append({"type": "cellular_location",
Avoid deeply nested control flow statements. Open
if re.search(pattern, k):
value["value"] = v * 3600.0
genotype["cellLine"] = k
value["units"] = "s"
elif k == "note":
Avoid deeply nested control flow statements. Open
if rel_dirname == '.':
rel_subdirname = subdirname
else:
rel_subdirname = os.path.join(rel_dirname, subdirname)
os.makedirs(os.path.join(root_tmp_path, rel_subdirname))
Avoid deeply nested control flow statements. Open
if isinstance(val, str):
entity["identifiers"].append({"namespace": key,
"value": val})
elif isinstance(val, list):
for _id in val:
Avoid deeply nested control flow statements. Open
for ref in val:
source.append({"namespace": list(ref.keys())[0],
"value": list(ref.values())[0]})
elif key == "gene_name":
Avoid deeply nested control flow statements. Open
if rel_dirname == '.':
rel_filename = filename
else:
rel_filename = os.path.join(rel_dirname, filename)
os.symlink(os.path.join(root_cache_path, rel_filename),
Consider simplifying this complex logical expression. Open
if other_part.specie.structure == part.specie.structure and \
other_part.specie.id == part.specie.id and \
((other_part.compartment is None and part.compartment is None) or
other_part.compartment.id == part.compartment.id) and \
numpy.sign(other_part.coefficient) == numpy.sign(part.coefficient):
Function fill_trna_primary
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def fill_trna_primary(self, file_location, sheet_name='tRNA', start_row=[0],
Function fill_trna_collection
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def fill_trna_collection(self, file_location, start_row=0,
Function create_kinetic_law_from_sbml
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_kinetic_law_from_sbml(self, id, sbml, specie_properties, functions, units):
Function _flatten_conc_obj
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _flatten_conc_obj(self, obj, ncbi_id, species_name, _id, source='ECMDB'):
Function run
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def run(self, in_obo_filename=None, in_tsv_filename=None, in_monomers_filename=None, max_num_proteins=None,