File _victor_utils.py
has 510 lines of code (exceeds 250 allowed). Consider refactoring. Open
from __future__ import annotations
########################################################################################################################
__doc__ = \
"""
Function extract_mols
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def extract_mols(cls,
folder: str,
smilesdex: Dict[str, str],
ligand_resn: str = 'LIG',
regex_name: Optional[str]= 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 extract_mol
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def extract_mol(cls,
name: str,
filepath: Optional[str] = None,
block: Optional[str] = None,
smiles: Optional[str] = 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 from_files
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def from_files(cls, folder: str) -> _VictorUtils: # future.annotation is active, so no cyclical.
"""
This creates an instance form the output files. Likely to be unstable.
Assumes the checkpoints were not altered.
And is basically for analysis only.
- 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 from_files
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def from_files(cls, folder: str) -> _VictorUtils: # future.annotation is active, so no cyclical.
"""
This creates an instance form the output files. Likely to be unstable.
Assumes the checkpoints were not altered.
And is basically for analysis only.
Function extract_mol
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def extract_mol(cls,
Function extract_mols
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def extract_mols(cls,
Function closest_hit
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def closest_hit(cls, pdb_filenames: List[str],
Function distance_hits
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def distance_hits(cls, pdb_filenames: List[str],
Function guess_warhead
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def guess_warhead(cls, smiles: str) -> Tuple[str, str]:
"""
Going backwards by guessing what the warhead is.
Normally there'd be better data handling so no guessing
"""
- 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_covalent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def make_covalent(cls, smiles: str,
warhead_name: Optional[str] = None) -> Union[str, None]:
"""
Convert a unreacted warhead to a reacted one in the SMILES
- 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 summarize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def summarize(self):
if self.error_msg:
if self.monster is None:
N_constrained_atoms = float('nan')
N_unconstrained_atoms = float('nan')
- 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"