matteoferla/Fragmenstein

View on GitHub
fragmenstein/igor/_igor_init.py

Summary

Maintainability
B
4 hrs
Test Coverage

Function _parse_residue has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    def _parse_residue(self, residue: Union[int, str, Tuple[int, str], pyrosetta.Vector1]) -> List[int]:
        """
        Parse a residue into a list of pose residue indices.
        This will be called to fill ``self.ligand_residue`` and ``self.key_residues``.

Severity: Minor
Found in fragmenstein/igor/_igor_init.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

Consider simplifying this complex logical expression.
Open

        if residue is None:
            ## assuming it is LIG then.
            ligand_selector = pyrosetta.rosetta.core.select.residue_selector.ResidueNameSelector()
            ligand_selector.set_residue_name3('LIG')
            m = self._vector2residues(ligand_selector.apply(self.pose))  # noqa its in Igor_min
Severity: Major
Found in fragmenstein/igor/_igor_init.py - About 1 hr to fix

    Function from_pdbblock has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def from_pdbblock(cls,
    Severity: Minor
    Found in fragmenstein/igor/_igor_init.py - About 35 mins to fix

      Function from_pdbfile has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def from_pdbfile(cls,
      Severity: Minor
      Found in fragmenstein/igor/_igor_init.py - About 35 mins to fix

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

            def _parse_key_residues(self,
                                    key_residues: Union[None, Sequence[Union[int, str, Tuple[int, str]]],
                                                        pyrosetta.Vector1]):
                """
                Parse a list of residues into a list of pose residue indices that will be filling ``self.key_residues``.
        Severity: Minor
        Found in fragmenstein/igor/_igor_init.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