Function mmff_minimize
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def mmff_minimize(self,
mol: Optional[Chem.Mol] = None,
neighborhood: Union[Chem.Mol, None] = None,
ff_max_displacement: float = 0.,
ff_constraint: int = 10,
- 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 _ff.py
has 291 lines of code (exceeds 250 allowed). Consider refactoring. Open
from ._utility import _MonsterUtil
from rdkit import Chem
from rdkit.Chem import AllChem, rdqueries, rdMolAlign
from rdkit import ForceField as FF
from typing import Optional, List, Union, Tuple, Dict
Function extract_atoms
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def extract_atoms(cls, protein: Chem.Mol, keepers: List[int], expand_aromatics: bool = True) -> Chem.Mol:
"""
Extract the given atom indices (``keepers``) from ``protein``.
Expanding to full aromatic ring and copying conformers
"""
- 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 mmff_minimize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def mmff_minimize(self,
Function MMFF_score
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def MMFF_score(self, mol: Optional[Chem.Mol] = None, delta: bool = False, mode: str = 'MMFF') -> float:
"""
Merck force field. Chosen over Universal for no reason at all.
:param mol: ligand
- 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 self.mmff_minimize(mol,
Avoid too many return
statements within this function. Open
return MinizationOutcome(success=success,