choderalab/yank

View on GitHub

Showing 120 of 121 total issues

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

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

def process_tool_directive(directives, option, dispatch, allowed_values, yields_value=False):
    """Process a directive.

    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 previous_thermo_state is not None:
                        computed_thermo_states.append(previous_thermo_state)
                else:
Severity: Major
Found in Yank/pipeline.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if v in combinatorial_id_nodes:
                                i = expanded_tree[update_node_key].index(v)
                                expanded_tree[update_node_key][i:i+1] = combinatorial_id_nodes[v]
                    elif update_node_val in combinatorial_id_nodes:
    Severity: Major
    Found in Yank/utils.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if len(line_fields) > 1:
                                  smiles_str = line_fields[1].strip()
                              else:
                                  smiles_str = line_fields[0].strip()
      
      
      Severity: Major
      Found in Yank/pipeline.py - About 45 mins to fix

        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 create has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def create(self, thermodynamic_state, sampler_states, storage,
        Severity: Minor
        Found in Yank/yank.py - About 45 mins to fix

          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

            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 call_constructor has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def call_constructor(parent_cls, constructor_description, special_conversions=None,
            Severity: Minor
            Found in Yank/schema/validator.py - About 35 mins to fix

              Function process_tool_directive has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def process_tool_directive(directives, option, dispatch, allowed_values, yields_value=False):
              Severity: Minor
              Found in Yank/pipeline.py - About 35 mins to fix

                Function read_system_files has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def read_system_files(positions_file_path, parameters_file_path, system_options,
                Severity: Minor
                Found in Yank/pipeline.py - About 35 mins to fix

                  Function _numerical_torsion_integrand has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def _numerical_torsion_integrand(self, phi, phi0, spring_constant, kt):
                  Severity: Minor
                  Found in Yank/restraints.py - About 35 mins to fix

                    Function _cache_trailblaze_data has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def _cache_trailblaze_data(checkpoint_dir_path, optimal_protocol, states_stds,
                    Severity: Minor
                    Found in Yank/pipeline.py - About 35 mins to fix

                      Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def __init__(self, restrained_receptor_atoms=None, restrained_ligand_atoms=None,
                      Severity: Minor
                      Found in Yank/restraints.py - About 35 mins to fix

                        Function _numerical_angle_integrand has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def _numerical_angle_integrand(self, theta, theta0, spring_constant, kt):
                        Severity: Minor
                        Found in Yank/restraints.py - About 35 mins to fix

                          Function _numerical_distance_integrand has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def _numerical_distance_integrand(self, r, r0, spring_constant, kt):
                          Severity: Minor
                          Found in Yank/restraints.py - About 35 mins to fix

                            Function create_alchemical_phase has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def create_alchemical_phase(self):
                                    """
                                    Create the alchemical phase based on all the options
                            
                                    This only creates it, but does nothing else to prepare for simulations. The ``initialize_alchemical_phase``
                            Severity: Minor
                            Found in Yank/experiment.py - About 35 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_free_energy has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def generate_free_energy(self):
                                    fe_data = self.get_experiment_free_energy_data()
                                    delta_f = fe_data['free_energy_diff']
                                    delta_h = fe_data['enthalpy_diff']
                                    delta_f_err = fe_data['free_energy_diff_error']
                            Severity: Minor
                            Found in Yank/reports/notebook.py - About 35 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 _build_default_alchemical_region has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def _build_default_alchemical_region(system, topography, protocol):
                                    """Create a default AlchemicalRegion if the user hasn't provided one."""
                                    # TODO: we should probably have a second region that annihilate sterics of counterions.
                                    alchemical_region_kwargs = {}
                            
                            
                            Severity: Minor
                            Found in Yank/yank.py - About 35 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

                            Severity
                            Category
                            Status
                            Source
                            Language