Showing 14 of 18 total issues
Function get_compose_project
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def get_compose_project(self):
"""Load compose file from repository"""
if self.compose_project is not None:
return
with open(self.compose_file) as stream:
- 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 command_interpreter
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def command_interpreter(self, command, argv):
if command == 'help':
argv.append('-h')
if len(argv) == 1:
docopt(self.get_full_doc() + "\n", argv=argv)
- 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 __init__
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self):
self.hierarchy = self.load_hierarchy()
StateHolder.compose_handler.get_compose_project()
self.project_compose = StateHolder.compose_handler.compose_project
- 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 run
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def run(self, cmd):
self.check_command(cmd)
plan = self.project_compose['plan'][self.plan]
command_list = self.hierarchy[cmd]
- 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 collect_commands
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def collect_commands(self):
try:
command_packages = importlib.import_module('poco_ops.commands', package='poco_ops')
for importer, modname, ispkg in pkgutil.iter_modules(command_packages.__path__):
if not ispkg:
- 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_args
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_args(self, command, classes, argv):
for cls in classes:
cmd = getattr(cls, 'command')
if not isinstance(cmd, list):
cmd = [cmd]
- 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 parse_environment_dict
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def parse_environment_dict(self, path, env):
"""Compose dictionary from environment variables."""
file_name = FileUtils.get_compose_file_relative_path(repo_dir=self.repo_dir,
working_directory=self.working_directory,
file_name=path)
- 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 build_command
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def build_command(cmd, dirs, files):
if "install" in cmd or "upgrade" in cmd:
if len(dirs) > 0:
cmd.append(str(dirs[0]))
for file in files:
- 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_environment_variables
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_environment_variables(self, plan):
"""Get all environment variables depends on selected plan"""
envs = list()
if isinstance(plan, dict):
if 'environment' in plan and 'include' in plan['environment']:
- 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 parse_version
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse_version(pip_content):
if "(from versions: " in pip_content:
first_line = pip_content.strip().splitlines()[0]
versions = first_line.split(",")
if len(versions[-1]) > 0:
- 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 check_base_class
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def check_base_class(self, cls):
for base_class in inspect.getmro(cls)[1:]:
if base_class == AbstractCommand:
sub_command = getattr(cls, 'sub_command')
if sub_command not in self.command_classes.keys():
- 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 exit_after_print_messages
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def exit_after_print_messages(message, doc=None, msg_type="error"):
if "error" is msg_type:
ColorPrint.print_error(message)
elif "warn" is msg_type:
ColorPrint.print_warning(message)
- 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 write_yaml_file
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def write_yaml_file(self, file, content, overwrite=True, create=False):
result = self.get_file(file)
if create:
if not os.path.exists(os.path.dirname(file)):
os.makedirs(os.path.dirname(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"
Further reading
Function get_backward_compatible_poco_file
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_backward_compatible_poco_file(directory=None, throw_exception=False, silent=False):
file = FileUtils.get_file_with_extension(file="poco", directory=directory)
if file is not None:
return 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"