QualiSystems/vCenterShell

View on GitHub

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):
Severity: Minor
Found in package/cloudshell/cp/vcenter/common/vcenter/vmomi_service.py - About 35 mins to fix

    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):
    Severity: Minor
    Found in package/cloudshell/cp/vcenter/common/vcenter/vmomi_service.py - About 35 mins to fix

      Function _validate_attribute has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def _validate_attribute(self, si, attributes, vim_type, name, prefix=''):
      Severity: Minor
      Found in package/cloudshell/cp/vcenter/common/vcenter/model_auto_discovery.py - About 35 mins to fix

        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):
        Severity: Minor
        Found in package/cloudshell/cp/vcenter/vm/deploy.py - About 35 mins to fix

          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):
          Severity: Minor
          Found in package/cloudshell/cp/vcenter/common/vcenter/model_auto_discovery.py - About 35 mins to fix

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

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

                Function save_snapshot has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def save_snapshot(self, si, logger, vm_uuid, snapshot_name, save_memory):
                Severity: Minor
                Found in package/cloudshell/cp/vcenter/commands/save_snapshot.py - About 35 mins to fix

                  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):
                  Severity: Minor
                  Found in package/cloudshell/cp/vcenter/common/vcenter/task_waiter.py - About 35 mins to fix

                    Function _rollback has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def _rollback(self, destroy_params, logger, results, results_before_deploy, thread_id):
                    Severity: Minor
                    Found in package/cloudshell/cp/vcenter/commands/save_sandbox.py - About 35 mins to fix

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

                        Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def __init__(self, vnic, requested_vnic, network, connect, mac):
                        Severity: Minor
                        Found in package/cloudshell/cp/vcenter/vm/portgroup_configurer.py - About 35 mins to fix

                          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):
                          Severity: Minor
                          Found in package/cloudshell/cp/vcenter/models/VCenterDetails.py - About 35 mins to fix

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

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

                                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:
                                Severity: Minor
                                Found in package/cloudshell/cp/vcenter/common/vcenter/vmomi_service.py - About 35 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 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

                                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)
                                Severity: Minor
                                Found in package/cloudshell/cp/vcenter/common/vcenter/vmomi_service.py - About 35 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 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,
                                Severity: Minor
                                Found in package/cloudshell/cp/vcenter/network/dvswitch/creator.py - About 35 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 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:
                                        """
                                Severity: Minor
                                Found in package/cloudshell/cp/vcenter/common/vcenter/vmomi_service.py - About 35 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