Showing 254 of 254 total issues
Function _get_atom_maps_OLD
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _get_atom_maps_OLD(self, molA, molB, **mode: Unpack[ExtendedFMCSMode]) -> Set[Tuple[Tuple[int, int]]]:
"""
The ``mode`` are FindMCS arguments.
"""
warnings.warn('`_get_atom_maps_OLD` is no longer used.', category=DeprecationWarning)
- 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 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 _embed
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _embed(self, trial=0, **embed_args) -> None:
"""
At trial 0, all fore atoms are okay
At trial 1, only fore atoms with bonds with original bonding are okay
At trial 2, only common atoms with bonds with original bonding are okay
- 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 is_valid
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def is_valid(self, atom: Chem.Atom, trial: int):
"""
Is this a constrainable atom?
"""
if atom.GetAtomicNum() == 1:
- 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 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
Function _atom_origin_to_xyz
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _atom_origin_to_xyz(cls, origins: List[str], atom: Chem.Atom, hits: List[Chem.Mol]):
points = []
if len(hits) == 0:
return # no hits
hitdex: Dict[str, Chem.Mol] = {hit.GetProp('_Name'): hit for hit in 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 from_postera_row
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def from_postera_row(cls, row: pd.Series, results:Optional=None):
if row.fragments == 'x0072' or str(row.fragments) == 'nan':
# these are not hit inspired.
cls.journal.error(f'No valid parent hits for {row.CID}.')
return 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
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return {k: self._remove_negatives(v) for k, v in map.items()}
Avoid too many return
statements within this function. Open
return self.mmff_minimize(mol,
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
Avoid too many return
statements within this function. Open
return super().__call__(parameters, hit, hit_atom_idx, followup, followup_atom_idx)
Avoid too many return
statements within this function. Open
return False # too bonded etc.
Avoid too many return
statements within this function. Open
return {name: flip_mapping(submapping) for name, submapping in mapping.items()}
Avoid too many return
statements within this function. Open
return True
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 {h: f for h, f in map.items() if f >= 0 and h >= 0}