choderalab/yank

View on GitHub

Showing 120 of 121 total issues

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

Function apply_modeller has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

def apply_modeller(input_file_path, output_file_path, directives):
    """
    Apply Salilab Modeller to make changes to the specified molecule.

    Single mutants are supported in the form "T315I"
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 __init__ has 14 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, restrained_receptor_atoms=None, restrained_ligand_atoms=None,
Severity: Major
Found in Yank/restraints.py - About 1 hr to fix

    Function run_thermodynamic_trailblazing has 14 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def run_thermodynamic_trailblazing(
    Severity: Major
    Found in Yank/pipeline.py - About 1 hr to fix

      Function get_keyword_args has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      def get_keyword_args(function, try_mro_from_class=None):
          """Inspect function signature and return keyword args with their default values.
      
          Parameters
          ----------
      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

      Function run_experiments has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def run_experiments(self, write_status=False):
              """
              Set up and run all the Yank experiments.
      
              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 run has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def run(self):
              """Run script and return warning messages in leap log file."""
      
              def create_dirs_and_copy(path_to_copy, copied_path):
                  """Create directories before copying the file."""
      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

      Function _expand_state_cutoff has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def _expand_state_cutoff(thermodynamic_state, expanded_cutoff_distance,
                                   replace_reaction_field=False, switch_width=None):
              """Expand the thermodynamic state cutoff to the given one.
      
              If replace_reaction_field is True, the system will be modified
      Severity: Minor
      Found in Yank/yank.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_mixing_plot has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          def generate_mixing_plot(self, mixing_cutoff=0.05, mixing_warning_threshold=0.90, cmap_override=None):
              """
              Generate the state diffusion mixing map as an image instead of array of number
      
              Parameters
      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 _check_with_math_expressions_variables_are_given has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          def _check_with_math_expressions_variables_are_given(self, field, value):
              """Check that in the alchemical path math expressions and function variables are correctly configured."""
              if not ( (isinstance(value, dict) or isinstance(value, collections.OrderedDict)) ):
                  return
              # Check that there is at least one non-string value in the
      Severity: Minor
      Found in Yank/schema/validator.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_replica_mixing_plot has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          def generate_replica_mixing_plot(self, phase_stacked_replica_plots=False):
              """
              Generate the replica trajectory mixing plots. Show the state of each replica as a function of simulation time
      
              Parameters
      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 __init__ has 11 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(self, sampler, thermodynamic_state, sampler_states, topography,
      Severity: Major
      Found in Yank/experiment.py - About 1 hr to fix

        Function _find_automatic_protocol_phases has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            def _find_automatic_protocol_phases(protocol):
                """Return the list of phase names in the protocol whose alchemical
                path must be generated automatically."""
                assert isinstance(protocol, collections.OrderedDict)
                phases_to_generate = []
        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 create has 10 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def create(self, thermodynamic_state, sampler_states, topography, protocol,
        Severity: Major
        Found in Yank/yank.py - About 1 hr to fix

          Function run_all_analysis has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              def run_all_analysis(self, serialize_data=True, serial_data_path=None, **analyzer_kwargs):
                  """
                  Run all the automatic analysis through the :func:`ExperimentAnalyzer.auto_analyze`
          
                  Parameters
          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 load_parameters has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              def load_parameters(self, *args):
                  """
                  Load the LEaP parameters into the working TLEaP script if not already loaded
          
                  This adds to the script
          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

          Function extract_trajectory has 10 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def extract_trajectory(nc_path, nc_checkpoint_file=None, state_index=None, replica_index=None,
          Severity: Major
          Found in Yank/analyze.py - About 1 hr to fix

            Function run has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def run(self):
                    # check if raw html is supported
                    if not self.state.document.settings.raw_enabled:
                        raise self.warning('"%s" directive disabled.' % self.name)
            
            
            Severity: Minor
            Found in docs/sphinxext/notebook_sphinxext.py - About 1 hr to fix

              Function create has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def create(self, thermodynamic_state, sampler_states, topography, protocol,
                             storage, restraint=None, anisotropic_dispersion_cutoff=None,
                             alchemical_regions=None, alchemical_factory=None, metadata=None):
                      """Create a new AlchemicalPhase calculation for a specified protocol.
              
              
              Severity: Minor
              Found in Yank/yank.py - About 1 hr to fix

                Function _setup_system has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def _setup_system(self, system_file_path, pack, alchemical_charge,
                                      system_parameters, solvent_id, *molecule_ids, **kwargs):
                        """Setup a system and create its prmtop/inpcrd files.
                
                        IMPORTANT: This function does not check if it's about to overwrite
                Severity: Minor
                Found in Yank/pipeline.py - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language