Function _add_warhead_mapping
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def _add_warhead_mapping(self, custom_map: Dict[str, IndexMap]) -> Dict[str, IndexMap]:
"""
Add the warhead mapping to the custom_map.
Does not use the warhead definition as it may be missing.
- 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 place
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def place(self,
mol: Chem.Mol,
attachment: Optional[Chem.Mol] = None,
custom_map: Optional[Dict[str, Dict[int, int]]] = None,
merging_mode: str = 'expansion',
- 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
Consider simplifying this complex logical expression. Open
if len(followup_hetero_neighs) == 1 and len(hit_hetero_neighs) == 1:
followup_old, hit_old = followup_atom, hit_atom
followup_atom = followup_hetero_neighs[0]
hit_atom = hit_hetero_neighs[0]
custom_map[hit_name][hit_atom.GetIdx()] = followup_atom.GetIdx()
Function place
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def place(self,
Function _validate_custom_map
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _validate_custom_map(self):
"""
What on earth has the user submitted as custom_map?
: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"