openpathsampling/openpathsampling-cli

View on GitHub

Showing 24 of 53 total issues

File wizard.py has 413 lines of code (exceeds 250 allowed). Consider refactoring.
Confirmed

import shutil
import os
import textwrap

from paths_cli.wizard.tools import yes_no, a_an
Severity: Minor
Found in paths_cli/wizard/wizard.py - About 5 hrs to fix

    File plugin_classes.py has 351 lines of code (exceeds 250 allowed). Consider refactoring.
    Confirmed

    import textwrap
    from paths_cli.plugin_management import OPSPlugin
    from paths_cli.wizard.standard_categories import get_category_info
    from paths_cli.wizard.load_from_ops import load_from_ops
    from paths_cli.wizard.parameters import WizardParameter
    Severity: Minor
    Found in paths_cli/wizard/plugin_classes.py - About 4 hrs to fix

      File param_core.py has 292 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import click
      import os
      
      
      class AbstractParameter(object):
      Severity: Minor
      Found in paths_cli/param_core.py - About 3 hrs to fix

        File core.py has 254 lines of code (exceeds 250 allowed). Consider refactoring.
        Confirmed

        import json
        import logging
        
        from paths_cli.utils import import_thing
        from paths_cli.plugin_management import OPSPlugin
        Severity: Minor
        Found in paths_cli/compiling/core.py - About 2 hrs to fix

          Function append has 9 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def append(input_file, append_file, engine, cv, volume, network, scheme,
          Severity: Major
          Found in paths_cli/commands/append.py - About 1 hr to fix

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

                def format_commands(self, ctx, formatter):
                    sec_order = ['Simulation', 'Analysis', 'Miscellaneous', 'Workflow']
                    for sec in sec_order:
                        cmds = self._sections.get(sec, [])
                        rows = []
            Severity: Minor
            Found in paths_cli/cli.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 one_pot_tps has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def one_pot_tps(input_file, output_file, state, nsteps, engine, engine_hot,
            Severity: Major
            Found in example_plugins/one_pot_tps.py - About 50 mins to fix

              Function one_pot_tps_main has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def one_pot_tps_main(output_storage, states, engine, engine_hot,
              Severity: Minor
              Found in example_plugins/one_pot_tps.py - About 45 mins to fix

                Function equilibrate has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def equilibrate(input_file, output_file, scheme, init_conds, multiplier,
                Severity: Minor
                Found in paths_cli/commands/equilibrate.py - About 45 mins to fix

                  Function ask_custom_eval has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def ask_custom_eval(self, question, options=None, default=None,
                  Severity: Minor
                  Found in paths_cli/wizard/wizard.py - About 45 mins to fix

                    Function tps has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def tps(input_file, engine, state, init_traj, output_file, nsteps):
                    Severity: Minor
                    Found in example_plugins/tps.py - About 45 mins to fix

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

                      def _seek_parent_dirs_for_file(filename):
                          rel_directory = None
                          my_dir = os.path.dirname(os.path.abspath(__file__))
                          rel_directory_arr = []
                          while not rel_directory:
                      Severity: Minor
                      Found in paths_cli/version.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 equilibrate_main has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      def equilibrate_main(output_storage, scheme, init_conds, multiplier,
                      Severity: Minor
                      Found in paths_cli/commands/equilibrate.py - About 35 mins to fix

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

                        def tps_main(engine, states, init_traj, output_storage, n_steps):
                        Severity: Minor
                        Found in example_plugins/tps.py - About 35 mins to fix

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

                          def visit_all(input_file, output_file, state, engine, init_frame):
                          Severity: Minor
                          Found in paths_cli/commands/visit_all.py - About 35 mins to fix

                            Function ask has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Confirmed

                                def ask(self, question, options=None, default=None, helper=None,
                                        autohelp=False):
                                    """Ask the user a question."""
                                    if helper is None:
                                        helper = Helper(None)
                            Severity: Minor
                            Found in paths_cli/wizard/wizard.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 register_plugins has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Confirmed

                            def register_plugins(plugins):
                                """Register the given plugins for use with the wizard.
                            
                                Parameters
                                ----------
                            Severity: Minor
                            Found in paths_cli/wizard/plugin_registration.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 __call__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Confirmed

                                def __call__(self, help_args, context):
                                    """Get help based on user input ``help_args`` and context.
                            
                                    Parameters
                                    ----------
                            Severity: Minor
                            Found in paths_cli/wizard/plugin_classes.py - About 25 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 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def get(self, storage, name):
                                    """Load desired object from storage.
                            
                                    Parameters
                                    ----------
                            Severity: Minor
                            Found in paths_cli/param_core.py - About 25 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 append has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def append(input_file, append_file, engine, cv, volume, network, scheme,
                                       tag, save_tag):
                                """Append objects from INPUT_FILE to another file.
                                """
                                storage = INPUT_FILE.get(input_file)
                            Severity: Minor
                            Found in paths_cli/commands/append.py - About 25 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