QualiSystems/vCenterShell

View on GitHub

Showing 133 of 222 total issues

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

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

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

        def save_app(self, si, logger, vcenter_data_model, reservation_id, save_app_actions, cancellation_context):
    Severity: Minor
    Found in package/cloudshell/cp/vcenter/commands/save_sandbox.py - About 45 mins to fix

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

          def deploy_from_template(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 _validate_vm_cluster has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def _validate_vm_cluster(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_shutdown_method has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def _validate_shutdown_method(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 find_item_in_path_by_type has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                def find_item_in_path_by_type(self, si, path, obj_type):
                    """
                    This function finds the first item of that type in path
                    :param ServiceInstance si: pyvmomi ServiceInstance
                    :param str path: the path to search in
            Severity: Minor
            Found in package/cloudshell/cp/vcenter/common/vcenter/vmomi_service.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 get_or_create_vcenter_folder has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                def get_or_create_vcenter_folder(self, si, logger, path, folder_name):
                    logger.info('Getting or creating {0} in {1}'.format(folder_name, path))
                    folder_parent = self.pv_service.get_folder(si, path)
                    if not folder_parent:
                        logger.error('Could not find {0}'.format(path))
            Severity: Minor
            Found in package/cloudshell/cp/vcenter/common/vcenter/folder_manager.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 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(self, connectivity, resource, remote_reservation, ports, remote_endpoints):
            Severity: Minor
            Found in package/cloudshell/cp/vcenter/models/QualiDriverModels.py - About 35 mins to fix

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

                  def __init__(self, pv_service, name_generator, ovf_service, resource_model_parser, vm_details_provider):
              Severity: Minor
              Found in package/cloudshell/cp/vcenter/vm/deploy.py - About 35 mins to fix

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

                    def disconnect_network(self, vm, network, default_network, reserved_networks, logger):
                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, vcenter_resource_name, vm_folder, template_name, app_name, default_datacenter):
                  Severity: Minor
                  Found in package/cloudshell/cp/vcenter/models/VCenterTemplateModel.py - About 35 mins to fix

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

                        def map_request_to_vnics(self, requests, vnics, existing_network, default_network, reserved_networks):
                    Severity: Minor
                    Found in package/cloudshell/cp/vcenter/vm/vnic_to_network_mapper.py - About 35 mins to fix

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

                          def disconnect_from_networks(self, si, logger, vcenter_data_model, vm_uuid, vm_network_remove_mappings):
                      Severity: Minor
                      Found in package/cloudshell/cp/vcenter/commands/disconnect_dvswitch.py - About 35 mins to fix

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

                            def _prepare_deployed_apps_folder(self, data_holder, si, logger, folder_manager, 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,
                          Severity: Minor
                          Found in package/cloudshell/cp/vcenter/commands/connect_dvswitch.py - About 35 mins to fix

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

                                def _get_vm_network_data(self, vm, reserved_networks, ip_regex, wait_for_ip, logger):
                            Severity: Minor
                            Found in package/cloudshell/cp/vcenter/vm/vm_details_provider.py - About 35 mins to fix

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

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

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

                                    def find_by_uuid(self, si, uuid, is_vm=True, path=None, data_center=None):
                                Severity: Minor
                                Found in package/cloudshell/cp/vcenter/common/vcenter/vmomi_service.py - About 35 mins to fix

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

                                      def power_on(self, si, logger, session, vm_uuid, resource_fullname):
                                  Severity: Minor
                                  Found in package/cloudshell/cp/vcenter/commands/power_manager_vm.py - About 35 mins to fix

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

                                        def connect_vnic_to_networks(self, vm, mapping, default_network, reserved_networks, logger):
                                    Severity: Minor
                                    Found in package/cloudshell/cp/vcenter/vm/portgroup_configurer.py - About 35 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language