choderalab/yank

View on GitHub

Showing 120 of 121 total issues

File experiment.py has 2390 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/env python

# =============================================================================
# MODULE DOCSTRING
# =============================================================================
Severity: Major
Found in Yank/experiment.py - About 6 days to fix

    File restraints.py has 1924 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    #!/usr/local/bin/env python
    
    # ==============================================================================
    # FILE DOCSTRING
    # ==============================================================================
    Severity: Major
    Found in Yank/restraints.py - About 5 days to fix

      File pipeline.py has 1832 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      #!/usr/bin/env python
      
      # =============================================================================================
      # MODULE DOCSTRING
      # =============================================================================================
      Severity: Major
      Found in Yank/pipeline.py - About 5 days to fix

        File utils.py has 1331 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        #!/usr/local/bin/env python
        
        # ==============================================================================
        # MODULE DOCSTRING
        # ==============================================================================
        Severity: Major
        Found in Yank/utils.py - About 3 days to fix

          File yank.py has 1051 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          #!/usr/local/bin/env python
          
          # ==============================================================================
          # MODULE DOCSTRING
          # ==============================================================================
          Severity: Major
          Found in Yank/yank.py - About 2 days to fix

            File analyze.py has 934 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            #!/usr/local/bin/env python
            
            # ==============================================================================
            # MODULE DOCSTRING
            # ==============================================================================
            Severity: Major
            Found in Yank/analyze.py - About 2 days to fix

              Function _setup_molecules has a Cognitive Complexity of 100 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _setup_molecules(self, *args):
                      """Set up the files needed to generate the system for all the molecules.
              
                      If OpenEye tools are installed, this generate the molecules when the source is
                      not a file. If two (or more) molecules generated by OpenEye have overlapping
              Severity: Minor
              Found in Yank/pipeline.py - About 2 days 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 notebook.py has 541 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              """
              YANK Health Report Notebook formatter
              
              This module handles all the figure formatting and processing to minimize the code shown in the Health Report Jupyter
              Notebook. All data processing and analysis is handled by the main multistate.analyzers package,
              Severity: Major
              Found in Yank/reports/notebook.py - About 1 day to fix

                Function _setup_system has a Cognitive Complexity of 53 (exceeds 5 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 day 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 select has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
                Open

                    def select(self, selection, as_set=False, sort_by='auto', subset=None) -> Union[List[int], Set[int]]:
                        """
                        Select atoms based on selection format which can be a number of formats:
                
                        * Single integer (a bit redundant)
                Severity: Minor
                Found in Yank/yank.py - About 1 day 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 a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
                Open

                def extract_trajectory(nc_path, nc_checkpoint_file=None, state_index=None, replica_index=None,
                                       start_frame=0, end_frame=-1, skip_frame=1, keep_solvent=True,
                                       discard_equilibration=False, image_molecules=False):
                    """Extract phase trajectory from the NetCDF4 file.
                
                
                Severity: Minor
                Found in Yank/analyze.py - About 7 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 dispatch has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                Open

                def dispatch(args):
                
                    import re
                    import doctest
                    import pkgutil
                Severity: Minor
                Found in Yank/commands/selftest.py - About 6 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 _pick_restrained_atoms has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _pick_restrained_atoms(self, sampler_state, topography):
                        """Select atoms to be used in restraint.
                
                        Parameters
                        ----------
                Severity: Minor
                Found in Yank/restraints.py - About 6 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 validator.py has 440 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import os
                import collections
                import copy
                import inspect
                import logging
                Severity: Minor
                Found in Yank/schema/validator.py - About 6 hrs to fix

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

                  def dispatch(args):
                      """
                      Set up and run YANK calculation from a script.
                  
                      Parameters
                  Severity: Minor
                  Found in Yank/commands/script.py - About 6 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

                  ExperimentBuilder has 41 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class ExperimentBuilder(object):
                      """Parse YAML configuration file and build the experiment.
                  
                      The relative paths indicated in the script are assumed to be relative to
                      the script directory. However, if ExperimentBuilder is initiated with a string
                  Severity: Minor
                  Found in Yank/experiment.py - About 5 hrs to fix

                    Function _configure_platform has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _configure_platform(cls, platform_name, platform_precision):
                            """
                            Configure the platform to be used for simulation for the given precision.
                    
                            Parameters
                    Severity: Minor
                    Found in Yank/experiment.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 create has a Cognitive Complexity of 31 (exceeds 5 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 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 _check_resume has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _check_resume(self, check_setup=True, check_experiments=True):
                            """Perform dry run to check if we are going to overwrite files.
                    
                            If we find folders that ExperimentBuilder should create we raise an exception
                            unless resume_setup or resume_simulation are found, in which case we
                    Severity: Minor
                    Found in Yank/experiment.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 run has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def run(self, n_iterations=None):
                            """
                            Run the experiment.
                    
                            Runs until either the maximum number of iterations have been reached or the sampler
                    Severity: Minor
                    Found in Yank/experiment.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

                    Severity
                    Category
                    Status
                    Source
                    Language