choderalab/protons

View on GitHub

Showing 288 of 347 total issues

Function _perform_ncmc_protocol has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    def _perform_ncmc_protocol(
        self,
        titration_group_indices: List[int],
        initial_titration_states: List[int],
        final_titration_states: List[int],
Severity: Minor
Found in protons/app/driver.py - About 2 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 _parse_fortran_namelist has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    def _parse_fortran_namelist(filename, namelist_name):
        """
        Parse a fortran namelist generated by AMBER 11 constant-pH python scripts.

        Parameters
Severity: Minor
Found in protons/app/driver.py - About 2 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 get_versions has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

def get_versions(verbose=False):
    """Get the project version from whatever source is available.

    Returns dict with two keys: 'version' and 'full'.
    """
Severity: Minor
Found in versioneer.py - About 2 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 bar_all_states has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

def bar_all_states(
    dataset: Union[netCDF4.Dataset, List[netCDF4.Dataset]],
    bootstrap: bool = False,
    num_bootstrap_samples: int = 1000,
    to_first_state_only: bool = True,
Severity: Minor
Found in protons/app/analysis.py - About 2 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 gather_trajectories has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

def gather_trajectories(
    datasets: List[netCDF4.Dataset],
    from_state: int,
    to_state: int,
    cumulative: bool = True,
Severity: Minor
Found in protons/app/analysis.py - About 2 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 get_populations has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    def get_populations(self, pH, temperature=None, ionic_strength=None, strict=True):
        """Return the state populations for a given pH.

        Parameters
        ----------
Severity: Minor
Found in protons/app/driver.py - About 2 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 run_command has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env=None):
    """Call the given command(s)."""
    assert isinstance(commands, list)
    p = None
    for c in commands:
Severity: Minor
Found in protons/_version.py - About 2 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 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
        ----------
Severity: Minor
Found in protons/app/proposals.py - About 2 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 run_command has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False,
                env=None):
    """Call the given command(s)."""
    assert isinstance(commands, list)
    p = None
Severity: Minor
Found in versioneer.py - About 2 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

File schrodinger.py has 264 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/env python

"""Miscellaneous wrapper functions to Schrodinger's computational chemistry tools.

Adapted from openmoltools: https://github.com/choderalab/openmoltools.
Severity: Minor
Found in protons/app/schrodinger.py - About 2 hrs to fix

    _TitratableResidue has 22 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class _TitratableResidue:
        """Representation of a single residue with multiple titration states."""
    
        def __init__(self):
            """
    Severity: Minor
    Found in protons/app/driver.py - About 2 hrs to fix

      Function import_gk_values has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          def import_gk_values(self, gk_dict: Dict[str, np.ndarray], strict=False):
              """Import precalibrated gk values. Only use this if your simulation settings are exactly the same.
      
              If you changed any details, rerun calibrate instead!
      
      
      Severity: Minor
      Found in protons/app/driver.py - About 2 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 _find_all_potential_bond_types_to_atom has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          def _find_all_potential_bond_types_to_atom(
              self, atomname, final_types, potential_types
          ):
              """ Find all the atoms it is bonded to, and collect their types
      
      
      Severity: Minor
      Found in protons/app/ligands.py - About 2 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 git_get_keywords has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

      def git_get_keywords(versionfile_abs):
          """Extract version information from the given file."""
          # the code embedded in _version.py can just fetch the value of these
          # keywords. When used from setup.py, we don't want to import _version.py,
          # so we do it with a regexp instead. This function is not used from
      Severity: Minor
      Found in versioneer.py - About 2 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 adapt has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          def adapt(self):
              """
              Adapt the weights for the residue that is being calibrated.
              """
              if self.drive.calibration_state is None:
      Severity: Minor
      Found in protons/app/simulation.py - About 2 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 plot_heatmap has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

      def plot_heatmap(
          dataset: netCDF4.Dataset,
          ax: plt.Axes = None,
          color: str = "charge",
          residues: list = None,
      Severity: Minor
      Found in protons/app/analysis.py - About 2 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 git_get_keywords has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

      def git_get_keywords(versionfile_abs):
          """Extract version information from the given file."""
          # the code embedded in _version.py can just fetch the value of these
          # keywords. When used from setup.py, we don't want to import _version.py,
          # so we do it with a regexp instead. This function is not used from
      Severity: Minor
      Found in protons/_version.py - About 2 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 _get14exceptions has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          def _get14exceptions(self, system, particle_indices):
              """
              Return a list of all 1,4 exceptions involving the specified particles that are not exclusions.
      
              Parameters
      Severity: Minor
      Found in protons/app/driver.py - About 2 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 from_xml has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          def from_xml(cls, root: etree.Element):
              """Instantiate this object from xml."""
              if not root.tag == "SAMSState":
                  raise ValueError(
                      "Wrong XML element provided. Expected 'SAMSState', got '{}'".format(
      Severity: Minor
      Found in protons/app/driver.py - About 2 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 git_versions_from_keywords has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

      def git_versions_from_keywords(keywords, tag_prefix, verbose):
          """Get version information from git keywords."""
          if not keywords:
              raise NotThisMethod("no keywords at all, weird")
          date = keywords.get("date")
      Severity: Minor
      Found in versioneer.py - About 2 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

      Severity
      Category
      Status
      Source
      Language