Showing 288 of 347 total issues
File driver.py
has 3977 lines of code (exceeds 250 allowed). Consider refactoring. Open
# coding=utf-8
"""
Drivers for Monte Carlo sampling of chemical states, such as tautomers and protomers.
"""
import copy
File ligands.py
has 2255 lines of code (exceeds 250 allowed). Consider refactoring. Open
# coding=utf-8
"""
Library for parametrizing small molecules for simulation
"""
Function addHydrogens
has a Cognitive Complexity of 186 (exceeds 5 allowed). Consider refactoring. Open
def addHydrogens(self, forcefield=None, pH=None, variants=None, platform=None):
"""Add missing hydrogens to the model.
This function automatically changes compatible residues into their constant-pH variant if no variant is specified.:
- 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
File versioneer.py
has 1326 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Version: 0.18
"""The Versioneer - like a rocketeer, but for versions.
The Versioneer
Function _update_forces
has a Cognitive Complexity of 129 (exceeds 5 allowed). Consider refactoring. Open
def _update_forces(
self,
titration_group_index,
final_titration_state_index,
initial_titration_state_index=None,
- 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
File amber_parser.py
has 1028 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python
"""
Adapted from openmoltools: https://github.com/choderalab/openmoltools.
Original license and copyright:
Function _add_isomers
has a Cognitive Complexity of 105 (exceeds 5 allowed). Consider refactoring. Open
def _add_isomers(self):
"""
Add all the isomer specific data to the xml template.
"""
log.debug("Add tautomer information ...")
- 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 run_prep_ffxml_main
has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring. Open
def run_prep_ffxml_main(jsonfile):
"""Main simulation loop."""
log.info(f"Preparing a run from '{jsonfile}'")
- 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 _create_chimera_template
has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring. Open
def _create_chimera_template(self):
"""
Start with atom types from the most populated state, and attempt to fill in the remaining atoms from the other
states.
- 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
File analysis.py
has 651 lines of code (exceeds 250 allowed). Consider refactoring. Open
# coding=utf-8
"""Tools for the analysis of standard data structure files."""
import numpy as np
from pymbar import bar
from .logger import log
Function prepare_mol2_for_parametrization
has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring. Open
def prepare_mol2_for_parametrization(
input_mol2: str,
output_mol2: str,
patch_bonds: bool = True,
keep_intermediate: bool = False,
- 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
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 _add_xml_titration_groups
has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring. Open
def _add_xml_titration_groups(
self,
topology: app.Topology,
system: mm.System,
forcefield: app.ForceField,
- 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 epik_results_to_mol2
has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring. Open
def epik_results_to_mol2(
epik_mae: str,
output_mol2: str,
patch_bonds: bool = True,
keep_intermediate: bool = False,
- 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 _create_hybrid_template
has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring. Open
def _create_hybrid_template(self):
"""
Interpolate differing atom types to create a single template state that has proper bonded terms for all atoms.
"""
- 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 process_dat_file
has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring. Open
def process_dat_file(self, inputfile):
"""Process an AMBER .dat file.
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
File forcefield_generators.py
has 513 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python
"""
OpenMM ForceField residue template generators.
Adapted from openmoltools: https://github.com/choderalab/openmoltools.
Function _cache_force
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
def _cache_force(self, titration_group_index, titration_state_index):
"""
Cache the force parameters for a single tautomer state.
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 generate_xml
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
def generate_xml(self):
"""Return the processed forcefield files as an XML stream.
Returns
-------
- 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
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