Function delete_all
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def delete_all(self, controller_uuid: str, model_uuid: str):
for container in self.client.containers.all():
if (container.config['user.juju-controller-uuid'] == controller_uuid
or container.config['user.juju-model-uuid'] == model_uuid) \
and not Container.is_controller(container):
- 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 start_all
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def start_all(self, controller_uuid: str, model_uuid: str):
for container in self.client.containers.all():
if (container.config['user.juju-controller-uuid'] == controller_uuid
or container.config['user.juju-model-uuid'] == model_uuid) \
and not Container.is_controller(container):
- 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 stop_all
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def stop_all(self, controller_uuid: str, model_uuid: str):
for container in self.client.containers.all():
if (container.config['user.juju-controller-uuid'] == controller_uuid
or container.config['user.juju-model-uuid'] == model_uuid) \
and not Container.is_controller(container):
- 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 status_all
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def status_all(self):
for container in self.client.containers.all():
try:
to_print = self.base_line(container)
if self.VERBOSE == 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 start_controller
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def start_controller(self, controller_uuid: str):
for container in self.client.containers.all():
if container.config['user.juju-controller-uuid'] == controller_uuid\
and Container.is_controller(container):
if container.status != 'Running':
- 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 stop_controller
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def stop_controller(self, controller_uuid: str):
for container in self.client.containers.all():
if container.config['user.juju-controller-uuid'] == controller_uuid\
and Container.is_controller(container):
if container.status == 'Running':
- 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 status_controller
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def status_controller(self):
for container in self.client.containers.all():
if Container.is_controller(container):
to_print = self.base_line(container)
if self.VERBOSE:
- 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"