QualiSystems/vCenterShell

View on GitHub

Showing 222 of 222 total issues

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>
Severity: Minor
Found in package/cloudshell/cp/vcenter/commands/disconnect_dvswitch.py - About 25 mins to fix

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:
Severity: Minor
Found in package/cloudshell/cp/vcenter/commands/DeleteInstance.py - About 25 mins to fix

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

Severity
Category
Status
Source
Language