matteoferla/Fragmenstein

View on GitHub

Showing 254 of 254 total issues

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

    def create_simulation(self,
Severity: Minor
Found in fragmenstein/openmm/fritz.py - About 35 mins to fix

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

        def translate_parallel(self,
    Severity: Minor
    Found in fragmenstein/walton/_advmoves.py - About 35 mins to fix

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

          def experimental_rotate(self, mol_idx: int, angle_x: float, angle_y: float, angle_z: float, degrees: bool = True):
      Severity: Minor
      Found in fragmenstein/walton/_movements.py - About 35 mins to fix

        Function get_valid_matches has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def get_valid_matches(self,
                                  parameters: rdFMCS.MCSAtomCompareParameters,
                                  common: Chem.Mol,
                                  hit: Chem.Mol,
                                  followup: Chem.Mol) -> List[Dict[int, int]]:
        Severity: Minor
        Found in fragmenstein/monster/mcs_mapping/compare_atom.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

        Function keep_copies has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def keep_copies(self, mols: List[Chem.Mol], label=None):
                if isinstance(mols, Dict):
                    iterator = mols.items()
                else:
                    iterator = enumerate(mols)
        Severity: Minor
        Found in fragmenstein/monster/_modification_logging.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

        Function unmerge_inner has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def unmerge_inner(self,
                              combined: Chem.Mol,
                              combined_map: Dict[int, int],
                              others: List[Chem.Mol],
                              disregarded: List[Chem.Mol]) -> None:
        Severity: Minor
        Found in fragmenstein/monster/unmerge_mapper.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

        Function combine has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def combine(self, keep_all: bool = True, collapse_rings: bool = True, joining_cutoff: int = 5):
                """
                Merge/links the hits. (Main entrypoint)
        
                :param keep_all:
        Severity: Minor
        Found in fragmenstein/monster/_combine.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

        Function _get_merging_penalties has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def _get_merging_penalties(self, mol, shape: Tuple[int, int], indices_ring):
                """
                confusingly this is a different set of penalties to `_get_joining_penalties` which is for joining
                :param mol:
                :param shape:
        Severity: Minor
        Found in fragmenstein/monster/_collapse_ring.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

        Function _place_unmerger_expansions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def _place_unmerger_expansions(self, unmergers: List[Unmerge]) -> Tuple[Chem.Mol, List[Chem.Mol]]:
                scores: List[int] = []
                mol_options = []
                best_mol = None
                for unmerger in unmergers:
        Severity: Minor
        Found in fragmenstein/monster/_place_modes/_expand.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

        Function _place_ring_atoms has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def _place_ring_atoms(self, mol, rings: List[Dict[str, Union[Chem.Atom, List[Any]]]]):
                """
                Plase all atoms stored in rings.
        
                :param mol:
        Severity: Minor
        Found in fragmenstein/monster/_collapse_ring.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

        Function _get_unmerge_expansions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def _get_unmerge_expansions(self,
                                        primary_name: str,
                                        primary_maps: List[Dict[int, int]],
                                        positional_overlaps: Dict[Tuple[str, str], Dict[int, int]],
                                        min_mode_index: int) -> List[Unmerge]:
        Severity: Minor
        Found in fragmenstein/monster/_place_modes/_expand.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

        Function _merge_part has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def _merge_part(self, scaffold: Chem.Mol, fragmentanda: Chem.Mol, anchor_index: int,
                            attachment_details: List[Dict],
                            other_attachments: List[int],
                            other_attachment_details: List[List[Dict]]) -> Chem.Mol:
                """
        Severity: Minor
        Found in fragmenstein/monster/_merge.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

        Function color_in has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        def color_in(mols: List[Chem.Mol], color_scale=None, skip_feija=False):
            """
            assigns a color property to a mol based on color_scales of correct length
        
            In the `divergent_colors` first colour is the Fragmenstein colour (feijoa). Setting `color_in(False)` will skip it,
        Severity: Minor
        Found in fragmenstein/display.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

        Function expand_ring has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def expand_ring(self, mol: Chem.Mol) -> Chem.Mol:
                """
                Undoes collapse ring
        
                :param mol: untouched.
        Severity: Minor
        Found in fragmenstein/monster/_collapse_ring.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

        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

        Function _get_war_def has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def _get_war_def(self):
                for war_def in self.warhead_definitions:
                    warhead = Chem.MolFromSmiles(war_def['covalent'])
                    if self.mol.HasSubstructMatch(warhead):
                        return war_def
        Severity: Minor
        Found in fragmenstein/victor/_victor_common.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

        Function _get_new_index has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def _get_new_index(self, mol: Chem.Mol, old: int, search_collapsed=True,
                               name_restriction: Optional[str] = None) -> int:
                """
                Given an old index check in ``_ori_i`` for what the current one is.
                NB. ring placeholder will be -1 and these also have ``_ori_is``. a JSON of the ori_i they summarise.
        Severity: Minor
        Found in fragmenstein/monster/_collapse_ring.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

        Function MMFF_score has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def MMFF_score(self, mol: Optional[Chem.Mol] = None, delta: bool = False, mode: str = 'MMFF') -> float:
                """
                Merck force field. Chosen over Universal for no reason at all.
        
                :param mol: ligand
        Severity: Minor
        Found in fragmenstein/monster/_ff.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

        Function pick_best has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def pick_best(self) -> Tuple[Chem.Mol, int]:
                """
                Method for partial merging for placement
        
                :return: unrefined_scaffold, mode_index
        Severity: Minor
        Found in fragmenstein/monster/_place_modes/_partial.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

        Function _determine_mergers_novel_ringcore_pair has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def _determine_mergers_novel_ringcore_pair(self,
                                                       mol: Chem.RWMol,
                                                       ringcore_A: Chem.Atom,
                                                       ringcore_B: Chem.Atom) -> List[Tuple[int, int]]:
                """
        Severity: Minor
        Found in fragmenstein/monster/_collapse_ring.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

        Severity
        Category
        Status
        Source
        Language