Yank/restraints.py
File restraints.py
has 1924 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
#!/usr/local/bin/env python
# ==============================================================================
# FILE DOCSTRING
# ==============================================================================
Function _pick_restrained_atoms
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
Open
def _pick_restrained_atoms(self, sampler_state, topography):
"""Select atoms to be used in restraint.
Parameters
----------
- Read upRead up
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
Open
def __init__(self, restrained_receptor_atoms=None, restrained_ligand_atoms=None,
Function _numerical_torsion_integrand
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _numerical_torsion_integrand(self, phi, phi0, spring_constant, kt):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, restrained_receptor_atoms=None, restrained_ligand_atoms=None,
Function _numerical_angle_integrand
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _numerical_angle_integrand(self, theta, theta0, spring_constant, kt):
Function _numerical_distance_integrand
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _numerical_distance_integrand(self, r, r0, spring_constant, kt):
Function _determine_restraint_parameters
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
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)
- Read upRead up
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"