Function get_completed
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def get_completed(self, futures: pebble.ProcessMapFuture) -> pd.DataFrame:
"""
A pebble.ProcessMapFuture cannot be stored as an instance attribute as it's not picklable
as it handles the lock. As a result it must be passed.
- 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 categorize
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def categorize(self,
row: pd.Series,
size_tolerance: int=0,
move_cutoff:float=1.,
ddG_cutoff:float=0.,
- 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 binarize
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def binarize(mol:Chem.Mol, ignore_errors:bool=True) -> bytes:
"""
Wrapper for ``mol.ToBinary(propertyFlags=0b00010111)``, but with safeguards in case it's not a valid Chem.Mol.
This is convoluted as None is a common error outcome with RDKit
So making it less cryptic
- 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 __call__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __call__(self,
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, pdbblock: str,
Function unbinarize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def unbinarize(bin: bytes, ignore_errors:bool=True) -> Union[Chem.Mol, None]:
"""
This is just a wrapper for ``Chem.Mol(bin)``, with safeguards in case it's not a bytes.
"""
exception = Exception if ignore_errors else ()
- 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 'too moved'
Avoid too many return
statements within this function. Open
return 100 - int(single_origin[sorted_names[0]] / sum(single_origin.values()) * 100)
Avoid too many return
statements within this function. Open
return 'equally sized'
Avoid too many return
statements within this function. Open
return 'too contorted'
Avoid too many return
statements within this function. Open
return 'acceptable'
Function __call__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __call__(self,
iterator: Iterator,
fun: Callable,
n_cores: int = -1,
timeout: int = 240,
- 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"