QualiSystems/vCenterShell

View on GitHub

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

    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,
    Severity: Major
    Found in package/cloudshell/cp/vcenter/commands/refresh_ip.py - About 50 mins to fix

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

        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)
        Severity: Minor
        Found in package/cloudshell/cp/vcenter/vm/vm_details_provider.py - About 45 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 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):
        Severity: Minor
        Found in package/cloudshell/cp/vcenter/network/dvswitch/creator.py - About 45 mins to fix

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

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

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

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

                  Function DeleteInstance has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def DeleteInstance(self, si, logger, session, vcenter_data_model, vm_uuid, vm_name):
                  Severity: Minor
                  Found in package/cloudshell/cp/vcenter/commands/DeleteInstance.py - About 45 mins to fix

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

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

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

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

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

                              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)
                              Severity: Minor
                              Found in package/cloudshell/cp/vcenter/common/vcenter/model_auto_discovery.py - About 45 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 has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def disconnect(self, si, logger, vcenter_data_model, vm_uuid, network_name=None, vm=None):
                              Severity: Minor
                              Found in package/cloudshell/cp/vcenter/commands/disconnect_dvswitch.py - About 45 mins to fix

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

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