matteoferla/Fragmenstein

View on GitHub
fragmenstein/monster/_utility.py

Summary

Maintainability
B
6 hrs
Test Coverage

File _utility.py has 270 lines of code (exceeds 250 allowed). Consider refactoring.
Open

########################################################################################################################
__doc__ = \
    """
These are extras for the Monster step
    """
Severity: Minor
Found in fragmenstein/monster/_utility.py - About 2 hrs to fix

    Function make_pse has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def make_pse(self, filename='test.pse', extra_mols: Optional[Iterable[Chem.Mol]] = None):
            """
            This is specifically for debugging the full fragment merging mode.
            For general use. Please use the Victor method ``make_pse``.
    
    
    Severity: Minor
    Found in fragmenstein/monster/_utility.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 origin_from_mol has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def origin_from_mol(self, mol: Chem.Mol = None):
            """
            these values are stored from Monster for scaffold, chimera and positioned_mol
            See `make_chimera` or `place_from_map` for more info on _Origin
    
    
    Severity: Minor
    Found in fragmenstein/monster/_utility.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 guess_origins has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        def guess_origins(self, mol: Chem.Mol = None, hits: Optional[List[Chem.Mol]] = None):
            """
            Given a positioned mol guess its origins...
    
            :param mol:
    Severity: Minor
    Found in fragmenstein/monster/_utility.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 get_combined_rmsd has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def get_combined_rmsd(cls, followup_moved: Chem.Mol, followup_placed: Optional[Chem.Mol] = None,
                              hits: Optional[List[Chem.Mol]] = None) -> float:
            """
            Depracated.
            The inbuilt RMSD calculations in RDKit align the two molecules, this does not align them.
    Severity: Minor
    Found in fragmenstein/monster/_utility.py - About 35 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