QualiSystems/vCenterShell

View on GitHub
package/cloudshell/cp/vcenter/common/utilites/savers/linked_clone_artifact_saver.py

Summary

Maintainability
B
5 hrs
Test Coverage

LinkedCloneArtifactHandler has 24 functions (exceeds 20 allowed). Consider refactoring.
Open

class LinkedCloneArtifactHandler(object):
    def __init__(self, pv_service, vcenter_data_model, si, logger, deployer, reservation_id,
                 resource_model_parser, snapshot_saver, task_waiter, folder_manager, port_configurer,
                 cancellation_service):
        self.SNAPSHOT_NAME = 'artifact'

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

        def __init__(self, pv_service, vcenter_data_model, si, logger, deployer, reservation_id,

      Function delete has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def delete(self, delete_saved_app_actions, cancellation_context, pool):
              self.logger.info('Delete saved sandbox started')
      
              tasks = self._get_delete_tasks(delete_saved_app_actions)
      
      

      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 _manage_power_during_save has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def _manage_power_during_save(self, save_action):
              # https://jeffknupp.com/blog/2016/03/07/python-with-context-managers/
      
              power_off_during_clone = self._should_vm_be_powered_off_during_clone(save_action)
      
      

      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

      There are no issues that match your filters.

      Category
      Status