choderalab/yank

View on GitHub
Yank/restraints.py

Summary

Maintainability
F
6 days
Test Coverage

File restraints.py has 1924 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/local/bin/env python

# ==============================================================================
# FILE DOCSTRING
# ==============================================================================
Severity: Major
Found in Yank/restraints.py - About 5 days to fix

    Function _pick_restrained_atoms has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
    Open

        def _pick_restrained_atoms(self, sampler_state, topography):
            """Select atoms to be used in restraint.
    
            Parameters
            ----------
    Severity: Minor
    Found in Yank/restraints.py - About 6 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 __init__ has 14 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(self, restrained_receptor_atoms=None, restrained_ligand_atoms=None,
    Severity: Major
    Found in Yank/restraints.py - About 1 hr to fix

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

          def _numerical_torsion_integrand(self, phi, phi0, spring_constant, kt):
      Severity: Minor
      Found in Yank/restraints.py - About 35 mins to fix

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

            def __init__(self, restrained_receptor_atoms=None, restrained_ligand_atoms=None,
        Severity: Minor
        Found in Yank/restraints.py - About 35 mins to fix

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

              def _numerical_angle_integrand(self, theta, theta0, spring_constant, kt):
          Severity: Minor
          Found in Yank/restraints.py - About 35 mins to fix

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

                def _numerical_distance_integrand(self, r, r0, spring_constant, kt):
            Severity: Minor
            Found in Yank/restraints.py - About 35 mins to fix

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

                  def _determine_restraint_parameters(self, sampler_states, topography):
                      """Determine restraint parameters.
              
                      Currently, all equilibrium values are measured from the initial structure,
                      while spring constants are set to 20 kcal/(mol A**2) or 20 kcal/(mol rad**2)
              Severity: Minor
              Found in Yank/restraints.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