Showing 82 of 99 total issues
Function compare
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def compare(self, collection1, collection2, context): # pylint: disable=arguments-differ
diff = Diff()
for item1 in collection1:
item2 = next((i for i in collection2 if self.item_id_func(item1) == self.item_id_func(i)), None)
if not item2:
- 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 convert
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def convert(self, diff):
if isinstance(diff, set):
return list(diff)
if not isinstance(diff, Diff):
return diff
- 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 _parser_callback
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _parser_callback(args):
if args.instance_path and not path.isdir(args.instance_path):
raise argparse.ArgumentTypeError(f"Directory {args.instance_path} is not a valid path!")
if args.workers < 1:
- 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 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def run(host, primary, dependencies, artifacts, variables, verbose, workdir, validate):
Function diff_templates
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def diff_templates(
Function _parser_callback
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _parser_callback(args):
if not Path(args.service_template_folder).is_dir():
raise argparse.ArgumentTypeError(f"Directory {args.service_template_folder} is not a valid path!")
# this variable sets the default CLI packaging format, user can still change it (for example to tar) when using
- 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 prompt_yes_no_question
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def prompt_yes_no_question(
yes_responses=("y", "yes"),
no_responses=("n", "no"),
case_sensitive=False,
default_yes_response=True
- 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 diff_instances
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def diff_instances(
Function wait_results
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def wait_results(self):
proceed = bool(self.futures)
results = wait(
self.futures,
- 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, operation, host: OperationHost, verbose, workdir, validate):
# TODO: Respect the timeout option.
# TODO: Add host validation.
# TODO: Properly handle SELF - not even sure what this proper way would be at this time.
actual_host = self.get_host(operation.host or host)
- 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
Avoid deeply nested control flow statements. Open
if trigger_name_or_event in (trigger.name, trigger.event.data):
trigger_name_or_event_exists = True
break
Function _parser_callback
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _parser_callback(args):
if args.instance_path and not path.isdir(args.instance_path):
raise argparse.ArgumentTypeError(f"Directory {args.instance_path} is not a valid path!")
storage = Storage.create(args.instance_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 run_operation
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def run_operation(self,
Function deploy_compressed_csar
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def deploy_compressed_csar(
Function deploy_service_template
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def deploy_service_template(
Function eval
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def eval(self, instance, key):
if not self.present:
raise DataError(f"Cannot use an unset value: {key}")
if self.is_function:
- 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 validate_service_template
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def validate_service_template(service_template_path: PurePath, inputs: typing.Optional[dict], storage: Storage,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, template, topology, instance_id, source=None, target=None):
Function validate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def validate(csar_or_st_path: PurePath, inputs: typing.Optional[dict], storage: Storage, verbose: bool,
Function run
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def run(self, operation, host: OperationHost, verbose, workdir, validate):