Showing 397 of 397 total issues
Avoid deeply nested control flow statements. Open
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
Open
if modification['monomer'] not in code_freq:
code_freq[modification['monomer']] = 0
canonical_code_freq[modification['residue']] += n_mods
Avoid deeply nested control flow statements. Open
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
Open
for n in names:
monomer = name_to_monomer.get(n.lower(), None)
if monomer is not None:
same_names.append((id, monomer.id, n))
break
Avoid deeply nested control flow statements. Open
Open
if code not in code_freq:
code_freq[code] = 0
code_freq[code] += 1
Avoid deeply nested control flow statements. Open
Open
if monomer is None:
unsupported_codes.add(code)
monomer = bpforms.Monomer(id=code)
else:
monomer_codes[code] = monomer
Avoid deeply nested control flow statements. Open
Open
if numpy.isinf(start_position):
protein['modified_errors'].append('Sequence does not contain residues {} for modification {}'.format(
', '.join(origin), modification['monomer']))
else:
monomer2.start_position = start_position
Avoid deeply nested control flow statements. Open
Open
if modification['residue'] not in canonical_code_freq:
canonical_code_freq[modification['residue']] = 0
if modification['monomer'] not in code_freq:
Function _default
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def _default(self):
args = self.app.pargs
type = bpforms.util.get_form(args.alphabet)
try:
- 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
Open
if identifier.ns == 'pdb-ccd':
monomer = None
break
if monomer is not None and (
Avoid deeply nested control flow statements. Open
Open
if len(entry.org_taxid) == 1:
# does not include those whose taxid is 'unidentified' or 'synthetic'
taxid = list(entry.org_taxid)[0]
if taxid != 32630 and taxid != 32644:
Avoid deeply nested control flow statements. Open
Open
if key == 'comment' and value.startswith('Category=organism-modification.'):
proteins.append(protein)
# save PRO in pickle format
with open(pkl_filename, 'wb') as file:
Avoid deeply nested control flow statements. Open
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
Avoid deeply nested control flow statements. Open
Open
if key == 'Symbol':
id = child.text
elif key == 'Common name':
name = child.text
elif key == 'CA registry numbers' and child.text.startswith('ribonucleoside '):
Function build
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def build(self, ph=None, major_tautomer=False, dearomatize=False):
""" Build alphabet
Args:
ph (:obj:`float`, optional): pH at which to calculate the major protonation state of each monomeric form
- 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
Open
if monomer is None:
unsupported_codes.add(code)
monomer = bpforms.Monomer(id=code)
else:
monomer_codes[code] = monomer
Avoid deeply nested control flow statements. Open
Open
if monomer.comments:
monomer.comments += ' ' + comments
else:
monomer.comments = comments
Avoid deeply nested control flow statements. Open
Open
if identifier.ns == 'pdb-ccd':
monomer = None
break
if monomer is not None and (\
Avoid deeply nested control flow statements. Open
Open
if protein['processing'][-1]['end'] == len(form.seq):
seq_features[0]['positions'].pop(len(seq_features[0]['positions']) - 1)
Avoid deeply nested control flow statements. Open
Open
if name is not None:
names.append(name)