Showing 82 of 99 total issues
Function run
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def run(self, operation, host: OperationHost, verbose, workdir, validate):
Function notify
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def notify(self, verbose: bool, workdir: str, trigger_name_or_event: Optional[str],
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 submit_operation
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def submit_operation(self, operation, node_id, verbose, workdir, *args):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, template, topology, instance_id, source=None, target=None):
Function undeploy
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def undeploy(self, verbose, workdir, num_workers=None):
# Currently, we are running a really stupid O(n^3) algorithm, but unless we get to the templates with
# millions of node instances, we should be fine.
with NodeExecutor(num_workers) as executor:
do_undeploy = 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 deploy
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def deploy(self, verbose, workdir, num_workers=None):
# Currently, we are running a really stupid O(n^3) algorithm, but unless we get to the templates with
# millions of node instances, we should be fine.
with NodeExecutor(num_workers) as executor:
do_deploy = 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 validate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def validate(self, verbose, workdir, num_workers=None):
# Currently, we are running a really stupid O(n^3) algorithm, but unless we get to the templates with
# millions of node instances, we should be fine.
with NodeExecutor(num_workers) as executor:
do_validate = 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 get_template
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_template(storage, workdir):
if storage.exists("inputs"):
inputs = storage.read_json("inputs")
else:
inputs = {}
- 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 too many return
statements within this function. Open
return 0
Avoid too many return
statements within this function. Open
return 1
Avoid too many return
statements within this function. Open
return 0
Avoid too many return
statements within this function. Open
return 0
Avoid too many return
statements within this function. Open
return 1
Avoid too many return
statements within this function. Open
return 1
Avoid too many return
statements within this function. Open
return 0
Avoid too many return
statements within this function. Open
return 1
Avoid too many return
statements within this function. Open
return 1
Avoid too many return
statements within this function. Open
return 0
Avoid too many return
statements within this function. Open
return 0