matteoferla/Fragmenstein

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

Summary

Maintainability
A
2 hrs
Test Coverage

Function posthoc_refine has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def posthoc_refine(self,
                       scaffold: Chem.Mol,
                       indices: Optional[List[int]] = None) -> Chem.Mol:
        """
        Given a scaffold and a list of indices, refine the scaffold.
Severity: Minor
Found in fragmenstein/monster/_place_modes/_refine.py - About 1 hr 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 propagate_alternatives has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def propagate_alternatives(self, fewer: List[Chem.Mol]) -> int:
        """
        Given the alt atoms strored in the Chem.Atom property ``_AltSymbol`` try those
        """
        pt = Chem.GetPeriodicTable()
Severity: Minor
Found in fragmenstein/monster/_place_modes/_refine.py - About 25 mins 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 sample_new_conformation has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def sample_new_conformation(self, random_seed=None):
        """This method is intended for Multivictor.
        It generates a new conformation based on different random seeds.
        """
        scaffold = self.modifications["chimera"]
Severity: Minor
Found in fragmenstein/monster/_place_modes/_refine.py - About 25 mins 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