matteoferla/Fragmenstein

View on GitHub

Showing 254 of 254 total issues

Function store_origin_colors_atomically has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def store_origin_colors_atomically(self):
        """
        Store the color of the origin in the mol as the private property _color
        :return:
        """
Severity: Minor
Found in fragmenstein/monster/_util_compare.py - About 55 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 _gpm_distance has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def _gpm_distance(cls, mols: List[Chem.Mol], confs: [Chem.Conformer], i, j, dummy_w_dummy=True) \
            -> Tuple[float, float, float]:
        """
        See get_positional_distance

Severity: Minor
Found in fragmenstein/monster/positional_mapping.py - About 55 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 _remove_negatives has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def _remove_negatives(self, map: Any) -> Any:
        """
        This is a hack to remove negative values from the map.
        It like flip_mapping is a tangle of options. The latter has been typing.overload'ed

Severity: Minor
Found in fragmenstein/monster/_place_modes/_no_blending.py - About 55 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 _get_novel_other_bonded_pairs has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def _get_novel_other_bonded_pairs(self, rings) -> List[Tuple[Chem.Atom, Chem.Atom]]:
        pairs = []
        for ring in rings:
            # ring: Dict[str, List[Any]]
            ringcore = ring['atom']  # Chem.Atom
Severity: Minor
Found in fragmenstein/monster/_collapse_ring.py - About 55 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 error_classify has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def error_classify(cls, text):
        if not text:
            return cls.error_classifications['SUCCESS']
        text = str(text)
        for key, value in cls.error_classifications.items():
Severity: Minor
Found in fragmenstein/laboratory/_extras.py - About 55 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 create_simulation has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def create_simulation(self,
                          model: Union[mma.PDBFile, mma.Modeller, None] = None,
                          restraint_k: float = 1_000,
                          restraining_atom_indices: Sequence[int] = (),
                          mobile_radius: float = 8.0,
Severity: Minor
Found in fragmenstein/openmm/fritz.py - About 55 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 _get_LINK_record has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def _get_LINK_record(self):
        if self.is_covalent:
            # get correct chain names.
            l_resi, l_chain = re.match('(\d+)(\D?)', str(self.ligand_resi)).groups()
            if self.covalent_resi:
Severity: Minor
Found in fragmenstein/victor/_victor_plonk.py - About 55 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 binarize has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def binarize(mol:Chem.Mol, ignore_errors:bool=True) -> bytes:
    """
    Wrapper for ``mol.ToBinary(propertyFlags=0b00010111)``, but with safeguards in case it's not a valid Chem.Mol.
    This is convoluted as None is a common error outcome with RDKit
    So making it less cryptic
Severity: Minor
Found in fragmenstein/laboratory/_base.py - About 55 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 create_polygon has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def create_polygon(n=6, radius=1.5,
                       x0=0., y0=0., z0=0.,
                       star=False,  # technical polygram?
                       bond_type: Chem.BondType = Chem.BondType.SINGLE,
                       starting_mol: Optional[Chem.Mol] = None,
Severity: Minor
Found in fragmenstein/walton/_polygon.py - About 55 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 preminimized_undummied_mol has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def preminimized_undummied_mol(self) -> Chem.Mol:
        """
        This method is called by the plonking into structure methods.
        Not "positioning" as intended by ``monster`` is done.
        Opening a PDB in RDKit is doable but gets exponentially slow with chain length
Severity: Minor
Found in fragmenstein/faux_victors/quick.py - About 55 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 correct_pdbinfo has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def correct_pdbinfo(mol: Chem.Mol, resn: str, resi: int, chain: str):
        """
        In Igor, RDKit to Params fixes it.
        In RDKit MolToPDBBlock https://github.com/rdkit/rdkit/blob/32655f5365e363ce13bd6b28e2e9e2544f8680bd/Code/GraphMol/FileParsers/PDBWriter.cpp#L66
        it is hidden.
Severity: Minor
Found in fragmenstein/openmm/fritz.py - About 55 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 mmff_minimize has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def mmff_minimize(self,
Severity: Major
Found in fragmenstein/monster/_ff.py - About 50 mins to fix

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

        def place(self,  smiles: str, number_runs: int= 10,
    Severity: Major
    Found in fragmenstein/multivictor/multivictor.py - About 50 mins to fix

      Function __call__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __call__(self,
      Severity: Major
      Found in fragmenstein/laboratory/_base.py - About 50 mins to fix

        Function replace_hits has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def replace_hits(cls,
        Severity: Major
        Found in fragmenstein/laboratory/_extras.py - About 50 mins to fix

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

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

            Avoid deeply nested control flow statements.
            Open

                                    if neigh not in morituri:
                                        mol.AddBond(center_i, neigh, bt)
                                        new_bond = mol.GetBondBetweenAtoms(center_i, neigh)
                                        BondProvenance.set_bond(new_bond, 'original')
                                    else:
            Severity: Major
            Found in fragmenstein/monster/_collapse_ring.py - About 45 mins to fix

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

                  def _merge_part(self, scaffold: Chem.Mol, fragmentanda: Chem.Mol, anchor_index: int,
              Severity: Minor
              Found in fragmenstein/monster/_merge.py - About 45 mins to fix

                Function _prevent_two_bonds_on_dummy has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _prevent_two_bonds_on_dummy(self, mol: Chem.RWMol):
                        """
                        The case '*(C)C' is seen legitimately in some warheads... but in most cases these are not.
                
                        :param mol:
                Severity: Minor
                Found in fragmenstein/monster/_merge.py - About 45 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 __call__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def __call__(self,  # noqa signature matches... it is just Boost being Boost
                Severity: Minor
                Found in fragmenstein/monster/mcs_mapping/compare_atom.py - About 45 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language