choderalab/yank

View on GitHub

Showing 120 of 121 total issues

Function named_combinations has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    def named_combinations(self, separator, max_name_length):
        """Generator to iterate over all possible combinations of trees and assign them unique names.

        The names are generated by gluing together the first letters of the values of
        the combinatorial leaves only, separated by the given separator. If the values
Severity: Minor
Found in Yank/utils.py - About 4 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 _validate_protocols has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    def _validate_protocols(protocols_description):
        """Validate protocols.

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

    def _validate_systems(self, systems_description):
        """Validate systems.

        Receptors, ligands, and solvents must be already loaded. If they are not
        found an exception is raised.
Severity: Minor
Found in Yank/experiment.py - About 3 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

YANKCerberusValidator has 28 functions (exceeds 20 allowed). Consider refactoring.
Open

class YANKCerberusValidator(cerberus.Validator):
    """
    Custom cerberus.Validator class for YANK extending the Validator to include all the methods needed
    by YANK
    """
Severity: Minor
Found in Yank/schema/validator.py - About 3 hrs to fix

    Function dispatch has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

    def dispatch(args):
    
        import collections
        from .. import experiment
    
    
    Severity: Minor
    Found in Yank/commands/status.py - About 3 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 apply_pdbfixer has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Confirmed

    def apply_pdbfixer(input_file_path, output_file_path, directives):
        """
        Apply PDBFixer to make changes to the specified molecule.
    
        Single mutants are supported in the form "T315I"
    Severity: Minor
    Found in Yank/pipeline.py - About 3 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 status has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        def status(self):
            """Iterate over the status of all experiments in dictionary form.
    
            The status of each experiment is set to "completed" if both phases
            in the experiments have been completed, "pending" if they are both
    Severity: Minor
    Found in Yank/experiment.py - About 3 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 _generate_experiment_protocol has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

        def _generate_experiment_protocol(self, experiment):
            """Generate auto alchemical paths for the given experiment.
    
            Creates a YAML script in the experiment folder with the found protocol.
    
    
    Severity: Minor
    Found in Yank/experiment.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 is_molecule_setup has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

        def is_molecule_setup(self, molecule_id):
            """Check whether the molecule has been processed previously.
    
            The molecule must be set up if it needs to be parametrize by antechamber
            (and the gaff.mol2 and frcmod files do not exist), if the molecule must be
    Severity: Minor
    Found in Yank/pipeline.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 _validate_molecules has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

        def _validate_molecules(cls, molecules_description):
            """Validate molecules syntax.
    
            Parameters
            ----------
    Severity: Minor
    Found in Yank/experiment.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 free_energy_trace has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

        def free_energy_trace(self, discard_from_start=1, n_trace=10):
            """
            Trace the free energy by keeping fewer and fewer samples in both forward and reverse direction
    
            Returns
    Severity: Minor
    Found in Yank/reports/notebook.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 expand_id_nodes has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

        def expand_id_nodes(self, id_nodes_path, update_nodes_paths):
            """Return a new :class:`CombinatorialTree` with id-bearing nodes expanded
            and updated in the rest of the script.
    
            Parameters
    Severity: Minor
    Found in Yank/utils.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 _expand_molecules has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        def _expand_molecules(self, yaml_content):
            """Expand combinatorial molecules.
    
            Generate new YAML content with no combinatorial molecules. The new content
            is identical to the old one but combinatorial molecules are substituted by
    Severity: Minor
    Found in Yank/experiment.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_experiments has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        def _parse_experiments(self, yaml_content):
            """Validate experiments.
    
            Perform dry run and validate system, protocol and options of every combination.
    
    
    Severity: Minor
    Found in Yank/experiment.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 create_system has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    def create_system(parameters_file, box_vectors, create_system_args, system_options):
        """Create and return an OpenMM system.
    
        Parameters
        ----------
    Severity: Minor
    Found in Yank/pipeline.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 config_root_logger has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    def config_root_logger(verbose, log_file_path=None):
        """
        Setup the the root logger's configuration.
    
        The log messages are printed in the terminal and saved in the file specified
    Severity: Minor
    Found in Yank/utils.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 read_system_files has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    def read_system_files(positions_file_path, parameters_file_path, system_options,
                          gromacs_include_dir=None, charmm_parameter_files=None):
        """Create a Yank arguments for a phase from system files.
    
        Parameters
    Severity: Minor
    Found in Yank/pipeline.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 _resolve_paths has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        def _resolve_paths(d, path):
            """Retrieve all the values of a nested key in a dictionary.
    
            Paths containing the string '*' are interpreted as any node and
            are yielded one by one.
    Severity: Minor
    Found in Yank/utils.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 restraint_distributions_plot has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def restraint_distributions_plot(self):
            ENERGIES_IDX = 0
            DISTANCES_IDX = 1
    
            # Find the phase that defines the restraint energies and distances.
    Severity: Minor
    Found in Yank/reports/notebook.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 validate_parameters has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    def validate_parameters(parameters, template_parameters, check_unknown=False,
                            process_units_str=False, float_to_int=False,
                            ignore_none=True, special_conversions=None):
        """
        Utility function for parameters and options validation.
    Severity: Minor
    Found in Yank/utils.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

    Severity
    Category
    Status
    Source
    Language