Showing 133 of 222 total issues
Function execute_deploy_from_template
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def execute_deploy_from_template(self, si, logger, vcenter_data_model, reservation_id, deployment_params, cancellation_context, folder_manager):
Function refresh_ip
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def refresh_ip(self, si, logger, session, vcenter_data_model, resource_model, cancellation_context,
Function connect_by_mapping
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def connect_by_mapping(self, si, vm, mapping, default_network, reserved_networks, logger, promiscuous_mode):
Function _get_vm_network_data
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _get_vm_network_data(self, vm, reserved_networks, ip_regex, wait_for_ip, logger):
network_interfaces = []
if wait_for_ip == 'True':
primary_ip = self._get_primary_ip(vm, ip_regex, logger)
- 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 dv_port_group_create_task
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def dv_port_group_create_task(dv_port_name, dv_switch, spec, vlan_id, logger, promiscuous_mode, num_ports=32):
Function _validate_saved_sandbox_storage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _validate_saved_sandbox_storage(self, si, all_items_in_vc, auto_att, dc_name, attributes, key):
Function _get_default_from_vc_by_type_and_name
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _get_default_from_vc_by_type_and_name(items_in_vc, vim_type, name=None):
items = []
if not isinstance(vim_type, collections.Iterable):
vim_type = [vim_type]
for item in items_in_vc:
- 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 __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, mac_address, vnic_name, requested_vnic, vm_uuid, network_name, network_key):
Function deploy_clone_from_vm
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def deploy_clone_from_vm(self, si, logger, data_holder, vcenter_data_model, reservation_id, cancellation_context):
Function get_ip
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_ip(self, vm, default_network, match_function, cancellation_context, timeout, logger):
Function DeleteInstance
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def DeleteInstance(self, si, logger, session, vcenter_data_model, vm_uuid, vm_name):
Function deploy_from_linked_clone
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def deploy_from_linked_clone(self, si, logger, data_holder, vcenter_data_model, reservation_id,
Function _validate_holding_network
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _validate_holding_network(self, si, all_items_in_vc, auto_att, dc_name, attributes, key):
Function _validate_vm_location
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _validate_vm_location(self, si, all_items_in_vc, auto_att, dc_name, attributes, key):
Function restore_snapshot
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def restore_snapshot(self, si, logger, session, vm_uuid, resource_fullname, snapshot_name):
Function _validate_vm_resource_pool
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _validate_vm_resource_pool(self, si, all_items_in_vc, auto_att, dc_name, attributes, key):
Function _validate_attribute
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _validate_attribute(self, si, attributes, vim_type, name, prefix=''):
if name in attributes and attributes[name]:
att_value = self._get_attribute_value(attributes, name, prefix)
obj = self.pv_service.get_folder(si, att_value)
- 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
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def disconnect(self, si, logger, vcenter_data_model, vm_uuid, network_name=None, vm=None):
Function _validate_default_dvswitch
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _validate_default_dvswitch(self, si, all_items_in_vc, auto_att, dc_name, attributes, key):
Function _validate_vm_storage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _validate_vm_storage(self, si, all_items_in_vc, auto_att, dc_name, attributes, key):