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
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
File param_core.py
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
import click
import os
class AbstractParameter(object):
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
Function append
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def append(input_file, append_file, engine, cv, volume, network, scheme,
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 = []
- Read upRead up
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,
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,
Function equilibrate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def equilibrate(input_file, output_file, scheme, init_conds, multiplier,
Function ask_custom_eval
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def ask_custom_eval(self, question, options=None, default=None,
Function tps
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def tps(input_file, engine, state, init_traj, output_file, nsteps):
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:
- Read upRead up
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,
Function tps_main
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def tps_main(engine, states, init_traj, output_storage, n_steps):
Function visit_all
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def visit_all(input_file, output_file, state, engine, init_frame):
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)
- Read upRead up
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
----------
- Read upRead up
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
----------
- Read upRead up
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
----------
- Read upRead up
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)
- Read upRead up
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"