matteoferla/Fragmenstein

View on GitHub
fragmenstein/monster/_place_modes/_make_chimera.py

Summary

Maintainability
B
6 hrs
Test Coverage

Function place_from_map has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    def place_from_map(self,
                       target_mol: Chem.Mol,
                       template_mol: Chem.Mol,
                       atom_map: Optional[Dict] = None,
                       random_seed=None) -> Chem.Mol:
Severity: Minor
Found in fragmenstein/monster/_place_modes/_make_chimera.py - About 4 hrs to fix

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_chimera has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    def make_chimera(self, template: Chem.Mol, min_mode_index=0) -> Chem.Mol:
        """
        This is to avoid extreme corner corner cases.
        E.g. here the MCS is ringMatchesRingOnly=True and AtomCompare.CompareAny,
        while for the positioning this is not the case.
Severity: Minor
Found in fragmenstein/monster/_place_modes/_make_chimera.py - About 2 hrs to fix

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

There are no issues that match your filters.

Category
Status