hackedteam/test-av2

View on GitHub
AVMaster/lib/core/VMRun.py

Summary

Maintainability
F
5 days
Test Coverage

VMRun has 26 functions (exceeds 20 allowed). Consider refactoring.
Open

class VMRun:
    def __init__(self, config_file):
        self.config = ConfigParser()
        self.config.read(config_file)

Severity: Minor
Found in AVMaster/lib/core/VMRun.py - About 3 hrs to fix

    Function refreshSnapshot has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def refreshSnapshot(self, vmx, delete=True):
            untouchables = [ "_datarecovery_"] #"ready", "activated",
    
            if config.verbose:
                logging.debug("[%s] Refreshing snapshot.\n" % vmx)
    Severity: Minor
    Found in AVMaster/lib/core/VMRun.py - About 1 hr 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 _run_cmd has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def _run_cmd(self, vmx, cmd, args=[], vmx_creds=[], popen=False, bg=False, timeout=40):
    Severity: Major
    Found in AVMaster/lib/core/VMRun.py - About 50 mins to fix

      Function _run_popen has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def _run_popen(self, pargs, timeout=40):
              if config.verbose:
                  logging.debug("_run_popen")
              p = subprocess.Popen(pargs, stdout=subprocess.PIPE)
      
      
      Severity: Minor
      Found in AVMaster/lib/core/VMRun.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 executeCmd has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def executeCmd(self, vmx, cmd, args=[], timeout=40, interactive=True, bg=False):
      Severity: Minor
      Found in AVMaster/lib/core/VMRun.py - About 45 mins to fix

        Function revertLastSnapshot has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def revertLastSnapshot(self, vmx):
                snap = self.listSnapshots(vmx)
                if len(snap) > 0:
        
                    for s in range(len(snap) - 1, -1, -1):
        Severity: Minor
        Found in AVMaster/lib/core/VMRun.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, vm_path, sdk_host, sdk_user, sdk_domain, sdk_passwd):
        Severity: Minor
        Found in AVMaster/lib/core/VMRun.py - About 35 mins to fix

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

              def _run_cmd(self, vmx, cmd, args=[], vmx_creds=[], popen=False, bg=False, timeout=40):
                  pargs = [self.path,
                           "-T", "vc",
                           "-h", self.host,
                           "-u", "%s\\%s" % (self.domain, self.user), "-p", self.passwd, cmd, vmx.path]
          Severity: Minor
          Found in AVMaster/lib/core/VMRun.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

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

              def __init__(self, config_file):
                  self.config = ConfigParser()
                  self.config.read(config_file)
          
                  self.path = self.config.get("vsphere", "path")
          Severity: Major
          Found in AVMaster/lib/core/VMRun.py and 1 other location - About 6 hrs to fix
          AVMaster/lib/core/VMManager.py on lines 36..44

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 107.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                  if vmx_creds != [] and len(vmx_creds) == 2:
                      idx = pargs.index("-p") + 2
                      cred = "-gu %s -gp %s" % (vmx_creds[0], vmx_creds[1])
                      pargs = pargs[0:idx] + cred.split() + pargs[idx:]
          Severity: Major
          Found in AVMaster/lib/core/VMRun.py and 1 other location - About 6 hrs to fix
          AVMaster/lib/core/VMManager.py on lines 52..55

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 103.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              def copyFileToGuest(self, vmx, src_file, dst_file):
                  if config.verbose:
                      logging.debug("[%s] Copying file from %s to %s.\n" %
                                   (vmx, src_file, dst_file))
                  return self._run_cmd(vmx, "CopyFileFromHostToGuest",
          Severity: Major
          Found in AVMaster/lib/core/VMRun.py and 1 other location - About 2 hrs to fix
          AVMaster/lib/core/VMRun.py on lines 213..218

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 56.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              def copyFileFromGuest(self, vmx, src_file, dst_file):
                  if config.verbose:
                      logging.debug("[%s] Copying file from %s to %s.\n" %
                                   (vmx, src_file, dst_file))
                  return self._run_cmd(vmx, "CopyFileFromGuestToHost",
          Severity: Major
          Found in AVMaster/lib/core/VMRun.py and 1 other location - About 2 hrs to fix
          AVMaster/lib/core/VMRun.py on lines 206..211

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 56.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              def deleteDirectoryInGuest(self, vmx, dir_path):
                  if config.verbose:
                      logging.debug("[%s] Delete directory %s.\n" % (vmx, dir_path))
                  self._run_cmd(
                      vmx, "deleteDirectoryInGuest", [dir_path], [vmx.user, vmx.passwd])
          Severity: Major
          Found in AVMaster/lib/core/VMRun.py and 1 other location - About 2 hrs to fix
          AVMaster/lib/core/VMRun.py on lines 189..193

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 53.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              def mkdirInGuest(self, vmx, dir_path):
                  if config.verbose:
                      logging.debug("[%s] Creating directory %s.\n" % (vmx, dir_path))
                  self._run_cmd(vmx, "CreateDirectoryInGuest", [
                      dir_path], [vmx.user, vmx.passwd])
          Severity: Major
          Found in AVMaster/lib/core/VMRun.py and 1 other location - About 2 hrs to fix
          AVMaster/lib/core/VMRun.py on lines 200..204

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 53.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

              def VMisRunning(self, vmx):
                  res = self._run_cmd(vmx, "list", popen=True)
                  if vmx.path[1:-1] in res:
                      return True
                  return False
          Severity: Major
          Found in AVMaster/lib/core/VMRun.py and 1 other location - About 1 hr to fix
          AVMaster/lib/core/VMManager.py on lines 201..205

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 49.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

              def revertSnapshot(self, vmx, snapshot):
                  if config.verbose:
                      logging.debug("[%s] Reverting snapshot %s.\n" % (vmx, snapshot))
                  self._run_cmd(vmx, "revertToSnapshot", [snapshot])
          Severity: Major
          Found in AVMaster/lib/core/VMRun.py and 2 other locations - About 1 hr to fix
          AVMaster/lib/core/VMRun.py on lines 135..138
          AVMaster/lib/core/VMRun.py on lines 140..143

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 45.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

              def createSnapshot(self, vmx, snapshot):
                  if config.verbose:
                      logging.debug("[%s] Creating snapshot %s.\n" % (vmx, snapshot))
                  self._run_cmd(vmx, "snapshot", [snapshot])
          Severity: Major
          Found in AVMaster/lib/core/VMRun.py and 2 other locations - About 1 hr to fix
          AVMaster/lib/core/VMRun.py on lines 140..143
          AVMaster/lib/core/VMRun.py on lines 145..148

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 45.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

              def deleteSnapshot(self, vmx, snapshot):
                  if config.verbose:
                      logging.debug("[%s] Deleting snapshot %s.\n" % (vmx, snapshot))
                  self._run_cmd(vmx, "deleteSnapshot", [snapshot])
          Severity: Major
          Found in AVMaster/lib/core/VMRun.py and 2 other locations - About 1 hr to fix
          AVMaster/lib/core/VMRun.py on lines 135..138
          AVMaster/lib/core/VMRun.py on lines 145..148

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 45.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              def reboot(self, vmx):
                  if config.verbose:
                      logging.debug("[%s] Rebooting!\r\n" % vmx)
                  self._run_cmd(vmx, "reset", ["hard"])
          Severity: Major
          Found in AVMaster/lib/core/VMRun.py and 1 other location - About 1 hr to fix
          AVMaster/lib/core/VMRun.py on lines 130..133

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 41.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              def suspend(self, vmx):
                  if config.verbose:
                      logging.debug("[%s] Suspending!\r\n" % vmx)
                  self._run_cmd(vmx, "suspend", ["soft"])
          Severity: Major
          Found in AVMaster/lib/core/VMRun.py and 1 other location - About 1 hr to fix
          AVMaster/lib/core/VMRun.py on lines 125..128

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 41.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

              def listSnapshots(self, vmx):
                  out = self._run_cmd(vmx, "listSnapshots", popen=True).split("\n")
                  return out[1:-1]
          Severity: Major
          Found in AVMaster/lib/core/VMRun.py and 1 other location - About 1 hr to fix
          AVMaster/lib/core/VMManager.py on lines 207..209

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 40.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              def shutdown(self, vmx):
                  if config.verbose:
                      logging.debug("[%s] Stopping!\r\n" % vmx)
                  self._run_cmd(vmx, "stop")
          Severity: Major
          Found in AVMaster/lib/core/VMRun.py and 1 other location - About 1 hr to fix
          AVMaster/lib/core/VMRun.py on lines 107..110

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 38.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                  pargs = [self.path,
                           "-T", "vc",
                           "-h", self.host,
                           "-u", "%s\\%s" % (self.domain, self.user), "-p", self.passwd, cmd, vmx.path]
          Severity: Major
          Found in AVMaster/lib/core/VMRun.py and 1 other location - About 1 hr to fix
          AVMaster/lib/core/VMManager.py on lines 47..50

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 38.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              def startup(self, vmx):
                  if config.verbose:
                      logging.debug("[%s] Starting!\r\n" % vmx)
                  self._run_cmd(vmx, "start")
          Severity: Major
          Found in AVMaster/lib/core/VMRun.py and 1 other location - About 1 hr to fix
          AVMaster/lib/core/VMRun.py on lines 112..115

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 38.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                          if snapshot != "_datarecovery_":
                              self.revertSnapshot(vmx, snap[s])
                              return "[%s] Reverted with snapshot %s" % (vmx, snap[s])
          Severity: Minor
          Found in AVMaster/lib/core/VMRun.py and 1 other location - About 45 mins to fix
          AVMaster/lib/core/VMManager.py on lines 150..152

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 35.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          There are no issues that match your filters.

          Category
          Status