File proposals.py
has 641 lines of code (exceeds 250 allowed). Consider refactoring. Open
# coding=utf-8
"""Residue selection moves for protons MC"""
from abc import ABCMeta, abstractmethod
from .logger import log
import copy
Function from_system
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def from_system(cls, system: openmm.System, indices: Dict[str, int]):
"""Instantiate a COOHDummyMover for a single C-COOH moiety in your system.
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 propose_swaps
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def propose_swaps(
self, swapper: Swapper, delta_cations: int, delta_anions: int
) -> Tuple[List[int], List[Tuple[int, int]], float]:
"""Propose ions/waters to swap.
- 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 e_dihedral
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def e_dihedral(
Function internal_to_cartesian
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def internal_to_cartesian(
Function e_angle
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def e_angle(
Function from_xml
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def from_xml(cls, xmltree: etree.Element):
"""Instantiate a COOHDummyMover class from an lxml Element."""
obj = cls()
if not xmltree.tag == "COOHDummyMover":
raise ValueError(
- 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"