Showing 46 of 120 total issues
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, l_bond_atoms=None, r_bond_atoms=None, l_displaced_atoms=None, r_displaced_atoms=None,
Function get_genomic_image
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_genomic_image(self, seq_features=None, width=1200, cols=2, nt_per_track=80, **kwargs):
Function get_details
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_details(self):
""" Get the full details of the crosslink in a dictionary
Returns:
:obj:`dict`: detailed information of the crosslink
- 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 __init__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, l_bond_atoms=None, r_bond_atoms=None, l_displaced_atoms=None, r_displaced_atoms=None,
order=BondOrder.single, stereo=None,
comments=None):
"""
- 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 update_tab_name
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function update_tab_name() {
for (var i=0; i<num_subunits; i++) {
if ($('#panel'+i).length) {
name = $('#name'+i+'').val()
if (name != null && name != '') {
- 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 __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, id, stoichiometry, structure=None, formula=None, mol_wt=None, charge=None):
Function clean
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def clean(self):
""" Clean up the subunits and the crosslinks
For example, convert `1 * a + 1 * a` to `2 * a`
- 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 i_atom, atom in atom_type.items():
atom_type[i_atom] = mol.GetAtom(atom)
# mol.AddHydrogens()
Avoid deeply nested control flow statements. Open
if encoding == 'bpforms.ProteinForm':
try:
subunit_structure = bpforms.ProteinForm().from_str(subunit['structure'])
sum_length += len(subunit_structure) * bc_form.get_subunit_attribute(subunit_id, 'stoichiometry')
bc_form.set_subunit_attribute(subunit_id, 'structure', subunit_structure)
Avoid deeply nested control flow statements. Open
if 'formula' in subunit:
try:
bc_form.set_subunit_attribute(subunit_id, 'formula', subunit['formula'])
except Exception as error:
flask_restplus.abort(400, 'Unable to parse formula', errors={'formula': str(error)})
Avoid deeply nested control flow statements. Open
if next(subunit for subunit in self_subunits_subunits if subunit.id == atom.subunit).stoichiometry > 1:
errors.append("crosslink {} contains multiple subunit '{}', so the subunit_idx of atom '{}[{}]' cannot be None".format(
i_crosslink + 1, atom.subunit, atom_type, i_atom))
elif atom.subunit_idx > next(subunit for subunit in self_subunits_subunits if subunit.id == atom.subunit).stoichiometry:
Avoid deeply nested control flow statements. Open
for i_atom, atom in atom_type.items():
atom_type[i_atom] = atom+n_atoms[i_subunit]
atom_maps.append(atom_map)
Function structure
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def structure(self, value):
""" Set the structure of the subunit
* setting structure will automaticall set formula, mol_wt, charge
- 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 is_equal
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def is_equal(self, other):
""" Check if two atoms are semantically equal (belong to the same subunit/monomer and
have the same element, position, and charge)
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
for i_atom, atom in atom_type.items():
if atom is not None:
atom_type[i_atom] = atom.GetIdx()
Avoid deeply nested control flow statements. Open
if 'charge' in subunit:
try:
bc_form.set_subunit_attribute(subunit_id, 'charge', subunit['charge'])
except Exception as error:
flask_restplus.abort(400, 'Unable to parse charge', errors={'charge': str(error)})
Function from_set
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def from_set(self, subunits):
""" Set the subunits from a list of subunits
Note: this method does not support crosslinks
- 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 too many return
statements within this function. Open
return True
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return False