Showing 133 of 222 total issues
Function destroy_vm_by_uuid
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def destroy_vm_by_uuid(self, si, vm_uuid, vm_path, logger):
Function destroy_vm_by_name
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def destroy_vm_by_name(self, si, vm_name, vm_path, logger):
Function _validate_attribute
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _validate_attribute(self, si, attributes, vim_type, name, prefix=''):
Function _safely_get_vm_details
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _safely_get_vm_details(self, vm, vm_name, vcenter_model, deploy_model, logger):
Function _validate_empty
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _validate_empty(si, all_items_in_vc, attributes, auto_attr, dc_name, key):
Function delete_sandbox
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def delete_sandbox(self, si, logger, vcenter_data_model, delete_sandbox_actions, cancellation_context):
Function disconnect_all
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def disconnect_all(self, si, logger, vcenter_data_model, vm_uuid, vm=None):
Function save_snapshot
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def save_snapshot(self, si, logger, vm_uuid, snapshot_name, save_memory):
Function wait_for_task
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def wait_for_task(self, task, logger, action_name='job', hide_result=False, cancellation_context=None):
Function _rollback
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _rollback(self, destroy_params, logger, results, results_before_deploy, thread_id):
Function _update_deploy_from_template_vm_location
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _update_deploy_from_template_vm_location(self, data_holder, folder_manager, logger, si, vcenter_resource_model):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, vnic, requested_vnic, network, connect, mac):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, vm_cluster, vm_storage, vm_resource_pool, vm_location, default_datacenter):
Function get_vm_details
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_vm_details(self, si, logger, resource_context, requests, cancellation_context):
Function _update_deploy_from_image_vm_location
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _update_deploy_from_image_vm_location(self, data_holder, folder_manager, logger, si, vcenter_resource_model):
Function get_folder_contents
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_folder_contents(self, folder, recursive=False):
vms = []
folders = []
for item in folder.childEntity:
- 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 create_logger_for_context
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create_logger_for_context(self, logger_name, context):
"""
Create QS Logger for command context AutoLoadCommandContext or ResourceCommandContext
:param logger_name:
:type logger_name: 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
Function connect
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def connect(self, address, user, password, port=443):
"""
Connect to vCenter via SSL and return SI object
:param address: vCenter address (host / ip address)
- 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_or_create_network
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_or_create_network(self,
si,
vm,
dv_port_name,
dv_switch_name,
- 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_vm_full_path
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_vm_full_path(self, si, vm):
"""
:param vm: vim.VirtualMachine
:return:
"""
- 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"