Function harmonize_warheads
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def harmonize_warheads(self, hits, warhead_harmonisation, covalent_form=True):
"""
Harmonises and marks the atoms with `_Warhead` Prop.
:param hits:
- 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
File _victor_common.py
has 358 lines of code (exceeds 250 allowed). Consider refactoring. Open
from ._victor_igor import _VictorIgor
from .minimalPDB import MinimalPDBParser
import os, re
from typing import *
from rdkit import Chem
Function make_coordinate_constraints_for_placement
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def make_coordinate_constraints_for_placement(self,
mol: Optional[Chem.Mol] = None,
origins: Optional[List[List[str]]] = None,
std: Optional[List[float]] = None,
mx: Optional[List[float]] = None) -> str:
- 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_attachment_from_pdbblock_via_pymol
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def _get_attachment_from_pdbblock_via_pymol(self) -> Union[None, Chem.Mol]:
"""
DEPRACATED. FORMER CODE FOR ``_get_attachment_from_pdbblock``
Yes, yes, I see the madness in using pymol to get an atom for rdkit to make a pose for pyrosetta.
- 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_attachment_from_pdbblock
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _get_attachment_from_pdbblock(self) -> Union[None, Chem.Mol]:
"""
``find_attachment`` finds the actual attachment atom not the stated one.
The historic code for this is now ``_get_attachment_from_pdbblock_via_pymol``
:return:
- 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 make_coordinate_constraints_for_combination
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def make_coordinate_constraints_for_combination(self):
"""
See also ``cls.make_coordinate_constraints_for_placement``.
This operates based on ``atom.HasProp('_Novel')``, not origins!
:return:
- 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 first is None:
first = warhead_name
new_hits.append(hit)
elif warhead_name == first:
new_hits.append(hit)
Function _get_war_def
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _get_war_def(self):
for war_def in self.warhead_definitions:
warhead = Chem.MolFromSmiles(war_def['covalent'])
if self.mol.HasSubstructMatch(warhead):
return war_def
- 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 inventorize_warheads
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def inventorize_warheads(cls, hits: List[Chem.Mol], covalent_form: bool = True) -> List[str]:
"""
Get the warhead types of the list of hits
:param hits:
- 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_constraint
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _get_constraint(self, extra_constraint: Optional[str] = None) -> Union[Constraints, None]:
# deal with covalent and non covalent separately
if self.is_covalent:
self.journal.debug(f'{self.long_name} - is covalent.')
constraint = self._fix_covalent()
- 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"