choderalab/yank

View on GitHub

Showing 120 of 121 total issues

Function _validate_options has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def _validate_options(cls, options, validate_general_options):
        """Validate molecules syntax.

        Parameters
        ----------
Severity: Minor
Found in Yank/experiment.py - About 1 hr 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_equilibration_data has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def get_equilibration_data(self, discard_from_start=1):
        """
        Create the equilibration scatter plots showing the trend lines, correlation time,
        and number of effective samples

Severity: Minor
Found in Yank/analyze.py - About 1 hr 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_experiment_free_energy_data has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def get_experiment_free_energy_data(self):
        """
        Get the free Yank Experiment free energy, broken down by phase and total experiment

        Output is of the form:
Severity: Minor
Found in Yank/analyze.py - About 1 hr 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 initialize_alchemical_phase has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def initialize_alchemical_phase(self):
        """
        Create and set all the initial options for the alchemical phase

        This minimizes, randomizes_ligand, and equilibrates the alchemical_phase on top of creating it, if the various
Severity: Minor
Found in Yank/experiment.py - About 1 hr 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 compute_net_charge has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def compute_net_charge(system, atom_indices):
    """Compute the total net charge of a subset of atoms in the system.

    Parameters
    ----------
Severity: Minor
Found in Yank/pipeline.py - About 1 hr 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 dispatch_extract_trajectory has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def dispatch_extract_trajectory(args):

    import os
    from .. import analyze

Severity: Minor
Found in Yank/commands/analyze.py - About 1 hr 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 generate_decorrelation_plots has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def generate_decorrelation_plots(self, decorrelation_threshold=0.1):
        """

        Parameters
        ----------
Severity: Minor
Found in Yank/reports/notebook.py - About 55 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

Function print_analysis_data has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def print_analysis_data(analysis_data, header=None):
    """
    Helper function of printing the analysis data payload from a :func:`ExperimentAnalyzer.auto_analyze` call

    Parameters
Severity: Minor
Found in Yank/analyze.py - About 55 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

Function pull_close has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def pull_close(fixed_mol_pos, translated_mol_pos, min_bound, max_bound):
    """Heuristic algorithm to quickly translate the ligand close to the receptor.

    The distance of the ligand from the receptor here is defined as the shortest
    Euclidean distance between an atom of the ligand and one of the receptor.
Severity: Minor
Found in Yank/pipeline.py - About 55 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

Function quantity_from_string has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def quantity_from_string(expression, compatible_units=None):
    """Create a Quantity object from a string expression.

    All the functions in the standard module math are available together
    with most of the methods inside the ``simtk.unit`` module.
Severity: Minor
Found in Yank/utils.py - About 55 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

Function generate_development_feature has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def generate_development_feature(feature_dict):
    """
    Helper function for generating a class which can flag classes, tests, and functions that are developmental.

    Output class not quite a mixin because it has to be the first class due to the `__init__` flag
Severity: Minor
Found in Yank/utils.py - About 55 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

Function generate_signature_schema has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def generate_signature_schema(func, update_keys=None, exclude_keys=frozenset()):
    """Generate a dictionary to test function signatures with Cerberus' Schema.

    Parameters
    ----------
Severity: Minor
Found in Yank/schema/validator.py - About 55 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

Function dispatch_report has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def dispatch_report(args):

    import io
    import os
    import re
Severity: Minor
Found in Yank/commands/analyze.py - About 55 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

Function _setup_system has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _setup_system(self, system_file_path, pack, alchemical_charge,
Severity: Major
Found in Yank/pipeline.py - About 50 mins to fix

    Function validate_parameters has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def validate_parameters(parameters, template_parameters, check_unknown=False,
    Severity: Major
    Found in Yank/utils.py - About 50 mins to fix

      Function parse has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def parse(self, script):
              """Parse the given YAML configuration file.
      
              Validate the syntax and load the script into memory. This does not build
              the actual experiment.
      Severity: Minor
      Found in Yank/experiment.py - About 45 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

      Function _minimize_sampler_state has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def _minimize_sampler_state(sampler_state_id, sampler_states, thermodynamic_state,
                                      tolerance, max_iterations):
              """Minimize the specified sampler state at the given thermodynamic state.
              """
              sampler_state = sampler_states[sampler_state_id]
      Severity: Minor
      Found in Yank/yank.py - About 45 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

      Function _expand_experiments has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def _expand_experiments(self):
              """Generates all possible combinations of experiment.
      
              Each generated experiment is uniquely named. If job_id and n_jobs are
              set, this returns only the experiments assigned to this particular job.
      Severity: Minor
      Found in Yank/experiment.py - About 45 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

      Function get_system_files_paths has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_system_files_paths(self, system_id):
              """Return the paths to the systems files.
      
              Parameters
              ----------
      Severity: Minor
      Found in Yank/pipeline.py - About 45 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

      Avoid deeply nested control flow statements.
      Open

                              if not utils.is_openeye_installed(oetools=('oechem',)):
                                  err_msg = 'Molecule {}: Cannot "select" from {} file without OpenEye toolkit'
                                  raise RuntimeError(err_msg.format(comb_mol_name, extension))
                              n_models = len(utils.load_oe_molecules(comb_molecule['filepath']))
      Severity: Major
      Found in Yank/experiment.py - About 45 mins to fix
        Severity
        Category
        Status
        Source
        Language