Showing 133 of 222 total issues
Function delete
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def delete(self, delete_saved_app_actions, cancellation_context, pool):
self.logger.info('Delete saved sandbox started')
tasks = self._get_delete_tasks(delete_saved_app_actions)
- 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 find_portgroup
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def find_portgroup(self, si, dv_switch_path, name):
"""
Returns the portgroup on the dvSwitch
:param name: str
:param dv_switch_path: str
- 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 str(vlan_id)
Avoid too many return
statements within this function. Open
return result
Avoid too many return
statements within this function. Open
return ''
Function _get_datastore
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _get_datastore(self, clone_params):
datastore = ''
parts = clone_params.datastore_name.split('/')
if not parts:
raise ValueError('Datastore could not be empty')
- 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 _manage_power_during_save
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _manage_power_during_save(self, save_action):
# https://jeffknupp.com/blog/2016/03/07/python-with-context-managers/
power_off_during_clone = self._should_vm_be_powered_off_during_clone(save_action)
- 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_error_message_from_exception
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_error_message_from_exception(ex):
error_message = '' # traceback.format_exc()
if hasattr(ex, 'message') and ex.message:
error_message += ex.message
elif hasattr(ex, 'msg') and ex.msg:
- 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 _set_vlan
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _set_vlan(self, action_mappings, si, vm_uuid, logger):
results = []
set_vlan_actions = action_mappings.action_tree[ACTION_TYPE_SET_VLAN]
try:
self.logger.info('connecting vm({0})'.format(vm_uuid))
- 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 _group_vm_action_type_by_mode
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _group_vm_action_type_by_mode(self, grouped_by_vm_by_requset):
grouped_by_vm_by_requset_by_mode = dict()
for machine, req_to_actions in grouped_by_vm_by_requset.items():
grouped_by_vm_by_requset_by_mode[machine] = dict()
for req_type, actions in req_to_actions.items():
- 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 print_attributes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def print_attributes(obj, skip_private=True):
for attr_name in dir(obj):
if skip_private and attr_name.startswith("_"):
continue
try:
- 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 remove_interfaces_from_vm_task
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def remove_interfaces_from_vm_task(self, virtual_machine, filter_function=None):
"""
Remove interface from VM
@see https://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/vim.VirtualMachine.html#reconfigure
:param virtual_machine: <vim.vm object>
- 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 _disconnect_all_my_connectors
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _disconnect_all_my_connectors(session, resource_name, reservation_id, logger):
"""
:param CloudShellAPISession session:
:param str resource_name:
:param str reservation_id:
- 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"