choderalab/protons

View on GitHub
protons/app/openeye.py

Summary

Maintainability
D
2 days
Test Coverage

File openeye.py has 493 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""Adapted from openmoltools: https://github.com/choderalab/openmoltools.

Original license and copyright:
Copyright 2017 Kyle A. Beauchamp, John D. Chodera, David L. Mobley

Severity: Minor
Found in protons/app/openeye.py - About 7 hrs to fix

    Function get_charges has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

    def get_charges(
        molecule,
        max_confs=800,
        strictStereo=True,
        normalize=True,
    Severity: Minor
    Found in protons/app/openeye.py - About 3 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 assignELF10charges has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    def assignELF10charges(molecule, max_confs: int = -1, strictStereo=True):
        """
         This function computes atomic partial charges for an OEMol by
         using the ELF10 method
    
    
    Severity: Minor
    Found in protons/app/openeye.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 molecule_to_mol2 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def molecule_to_mol2(
        molecule,
        tripos_mol2_filename=None,
        conformer=0,
        residue_name="MOL",
    Severity: Minor
    Found in protons/app/openeye.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_charges has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def get_charges(
    Severity: Major
    Found in protons/app/openeye.py - About 50 mins to fix

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

      def generate_conformers(
      Severity: Minor
      Found in protons/app/openeye.py - About 45 mins to fix

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

        def smiles_to_antechamber(
        Severity: Minor
        Found in protons/app/openeye.py - About 35 mins to fix

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

          def molecule_to_mol2(
          Severity: Minor
          Found in protons/app/openeye.py - About 35 mins to fix

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

            def oemols_to_ffxml(molecules, base_molecule_name="lig"):
                """Generate an OpenMM ffxml object and MDTraj trajectories from multiple OEMols
            
                Parameters
                ----------
            Severity: Minor
            Found in protons/app/openeye.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