File _communal.py
has 379 lines of code (exceeds 250 allowed). Consider refactoring. Open
########################################################################################################################
__doc__ = \
"""
This is inherited by all three parents of the place/combine/other group
"""
_MonsterCommunal
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class _MonsterCommunal(_MonsterTracker):
# === Find closest =================================================================================================
# dep methods:
Function _is_connected_warhead
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def _is_connected_warhead(self, atom, anchor_atom):
if not atom.HasProp('_Warhead'):
return False
elif atom.GetBoolProp('_Warhead') == False:
return 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 _add_bond_if_possible
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def _add_bond_if_possible(self, mol, first: Chem.Atom, second: Chem.Atom, provenance='other_novel'):
"""
This method is used by _copy_bonding, but triggered when force=False
:param mol:
- 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 _copy_bonding
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def _copy_bonding(self, mol, keeper_idx: int, reject_idx: int, force: Optional[bool] = None):
"""
formerly called `absorb`. Preps for absorbing. remove reject_idx separately.
So copy bonding from reject_idx to keeper_idx.
- 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 _add_bond_regardlessly
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _add_bond_regardlessly(self, mol, first: Chem.Atom, second: Chem.Atom, bond_type, provenance='other_novel'):
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return False # too bonded etc.
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 # too bonded already!
Avoid too many return
statements within this function. Open
return False # if the warhead is not connected pretend it is not a warhead.
Function _closest__is_ring_atom
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _closest__is_ring_atom(atom):
if atom.GetIsAromatic():
return True
elif atom.HasProp('_ori_i') and atom.GetIntProp('_ori_i') == -1:
if atom.HasProp('_bonds') and 'AROMATIC' in atom.GetProp('_bonds'):
- 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"