matteoferla/Fragmenstein

View on GitHub
fragmenstein/extraction_funs.py

Summary

Maintainability
A
3 hrs
Test Coverage

Function combine_for_bondorder has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

def combine_for_bondorder(template: Chem.Mol, target: Chem.Mol) -> Chem.Mol:
    target2template = {}
    for template_ai, template_atom in enumerate(template.GetAtoms()):
        target_atom: Chem.Atom = get_equivalent(template_atom, target)
        target_ai: int = target_atom.GetIdx()
Severity: Minor
Found in fragmenstein/extraction_funs.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

Function find_attachment has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def find_attachment(pdb: Chem.Mol, ligand_resn: str) -> Tuple[Union[Chem.Atom, None], Union[Chem.Atom, None]]:
    """
    Finds the two atoms in a crosslink bond without looking at LINK record

    :param pdb: a rdkit Chem object
Severity: Minor
Found in fragmenstein/extraction_funs.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 add_dummy_to_mol has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def add_dummy_to_mol(ligand: Chem.Mol,
                     ligand_resn: str,
                     holo: Chem.Mol,
                     dummy_name: str = 'CONN') -> Chem.Mol:
    """
Severity: Minor
Found in fragmenstein/extraction_funs.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