matteoferla/Fragmenstein

View on GitHub
fragmenstein/victor/_victor_place.py

Summary

Maintainability
A
3 hrs
Test Coverage

Function _ has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _(self,
Severity: Minor
Found in fragmenstein/victor/_victor_place.py - About 45 mins to fix

    Function place has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def place(self,
    Severity: Minor
    Found in fragmenstein/victor/_victor_place.py - About 45 mins to fix

      Function _prepare_args_for_placement has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def _prepare_args_for_placement(self,
      Severity: Minor
      Found in fragmenstein/victor/_victor_place.py - About 45 mins to fix

        Function _ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def _(self,
                  mol: Chem.Mol,
                  long_name: str = 'ligand',
                  merging_mode='expansion',
                  atomnames: Optional[Dict[int, str]] = None,
        Severity: Minor
        Found in fragmenstein/victor/_victor_place.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 _assert_placement_inputs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def _assert_placement_inputs(self):
                if '*' in self.smiles and (self.covalent_resi is None or self.covalent_resn is None):
                    raise ValueError(f'{self.long_name} - is covalent but without known covalent residues')
                    # TODO '*' in self.smiles is bad. user might start with a mol file.
                elif '*' in self.smiles:
        Severity: Minor
        Found in fragmenstein/victor/_victor_place.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