rapid7/metasploit-framework

View on GitHub
lib/msf/core/exploit/remote/vim_soap.rb

Summary

Maintainability
F
4 days
Test Coverage

File vim_soap.rb has 597 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module Msf

module Exploit::Remote::VIMSoap
  include Msf::Exploit::Remote::HttpClient

Severity: Major
Found in lib/msf/core/exploit/remote/vim_soap.rb - About 1 day to fix

    Method vim_take_screenshot has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

      def vim_take_screenshot(vm, user, pass)
        soap_data = vim_soap_envelope(vim_soap_create_screenshot(vm['ref']))
        res = vim_send_soap_request(soap_data)
        if res.class == Hash
          task_id = res['CreateScreenshot_TaskResponse']['returnval']
    Severity: Minor
    Found in lib/msf/core/exploit/remote/vim_soap.rb - About 2 hrs 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

    Method vim_get_hosts has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

      def vim_get_hosts(datacenter)
        dc_hosts = []
        soap_data = vim_soap_envelope(vim_soap_retrieve_properties('hostFolder', 'Datacenter' , datacenter))
        res = vim_send_soap_request(soap_data)
        if res.class == Hash
    Severity: Minor
    Found in lib/msf/core/exploit/remote/vim_soap.rb - 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

    Method vim_take_screenshot has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def vim_take_screenshot(vm, user, pass)
        soap_data = vim_soap_envelope(vim_soap_create_screenshot(vm['ref']))
        res = vim_send_soap_request(soap_data)
        if res.class == Hash
          task_id = res['CreateScreenshot_TaskResponse']['returnval']
    Severity: Minor
    Found in lib/msf/core/exploit/remote/vim_soap.rb - About 1 hr to fix

      Method vim_powerOFF_vm has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

        def vim_powerOFF_vm(vm_ref)
          soap_data = vim_soap_envelope(vim_soap_power_off_vm(vm_ref))
          res = vim_send_soap_request(soap_data)
          if res.class == Hash
            task_id = res['PowerOffVM_TaskResponse']['returnval']
      Severity: Minor
      Found in lib/msf/core/exploit/remote/vim_soap.rb - 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

      Method vim_find_vm_by_name has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

        def vim_find_vm_by_name(name)
          vim_setup_references
          @dcs.each do |dc|
            soap_data = vim_soap_envelope(vim_soap_retrieve_properties('vmFolder', 'Datacenter' , dc['ref']))
            res = vim_send_soap_request(soap_data)
      Severity: Minor
      Found in lib/msf/core/exploit/remote/vim_soap.rb - 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

      Method vim_powerON_vm has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

        def vim_powerON_vm(vm_ref)
          soap_data = vim_soap_envelope(vim_soap_power_on_vm(vm_ref))
          res = vim_send_soap_request(soap_data)
          if res.class == Hash
            task_id = res['PowerOnVM_TaskResponse']['returnval']
      Severity: Minor
      Found in lib/msf/core/exploit/remote/vim_soap.rb - 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

      Method vim_get_hosts has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def vim_get_hosts(datacenter)
          dc_hosts = []
          soap_data = vim_soap_envelope(vim_soap_retrieve_properties('hostFolder', 'Datacenter' , datacenter))
          res = vim_send_soap_request(soap_data)
          if res.class == Hash
      Severity: Minor
      Found in lib/msf/core/exploit/remote/vim_soap.rb - About 1 hr to fix

        Method vim_find_vm_by_name has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def vim_find_vm_by_name(name)
            vim_setup_references
            @dcs.each do |dc|
              soap_data = vim_soap_envelope(vim_soap_retrieve_properties('vmFolder', 'Datacenter' , dc['ref']))
              res = vim_send_soap_request(soap_data)
        Severity: Minor
        Found in lib/msf/core/exploit/remote/vim_soap.rb - About 1 hr to fix

          Method vim_get_vms has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

            def vim_get_vms
              vim_setup_references
              @vmrefs = []
              vmlist= []
              @dcs.each do |dc|
          Severity: Minor
          Found in lib/msf/core/exploit/remote/vim_soap.rb - 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

          Method vim_powerOFF_vm has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def vim_powerOFF_vm(vm_ref)
              soap_data = vim_soap_envelope(vim_soap_power_off_vm(vm_ref))
              res = vim_send_soap_request(soap_data)
              if res.class == Hash
                task_id = res['PowerOffVM_TaskResponse']['returnval']
          Severity: Minor
          Found in lib/msf/core/exploit/remote/vim_soap.rb - About 1 hr to fix

            Method vim_powerON_vm has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def vim_powerON_vm(vm_ref)
                soap_data = vim_soap_envelope(vim_soap_power_on_vm(vm_ref))
                res = vim_send_soap_request(soap_data)
                if res.class == Hash
                  task_id = res['PowerOnVM_TaskResponse']['returnval']
            Severity: Minor
            Found in lib/msf/core/exploit/remote/vim_soap.rb - About 1 hr to fix

              Method vim_get_dcs has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def vim_get_dcs
                  soap_data = vim_soap_envelope(vim_soap_retrieve_service_content)
                  res = vim_send_soap_request(soap_data)
                  if res.class == Hash
                    @server_objects.merge!(res['RetrieveServiceContentResponse']['returnval'])
              Severity: Minor
              Found in lib/msf/core/exploit/remote/vim_soap.rb - About 1 hr to fix

                Method vim_get_dc_vms has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                  def vim_get_dc_vms(datacenter)
                    soap_data = vim_soap_envelope(vim_soap_retrieve_properties('vmFolder', 'Datacenter', datacenter))
                    res = vim_send_soap_request(soap_data)
                    if res.class == Hash
                      vmfolder = res['RetrievePropertiesResponse']['returnval']['propSet']['val']
                Severity: Minor
                Found in lib/msf/core/exploit/remote/vim_soap.rb - 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

                Avoid too many return statements within this method.
                Open

                      return Hash.from_xml(res.body)['Envelope']['Body']
                Severity: Major
                Found in lib/msf/core/exploit/remote/vim_soap.rb - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                      return :error
                  Severity: Major
                  Found in lib/msf/core/exploit/remote/vim_soap.rb - About 30 mins to fix

                    Method vim_get_dcs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def vim_get_dcs
                        soap_data = vim_soap_envelope(vim_soap_retrieve_service_content)
                        res = vim_send_soap_request(soap_data)
                        if res.class == Hash
                          @server_objects.merge!(res['RetrieveServiceContentResponse']['returnval'])
                    Severity: Minor
                    Found in lib/msf/core/exploit/remote/vim_soap.rb - About 25 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

                    Method vim_get_session has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def vim_get_session
                        soap_data = vim_soap_envelope(vim_soap_retrieve_service_content)
                        res = send_request_cgi({
                          'uri'     => '/sdk',
                          'method'  => 'POST',
                    Severity: Minor
                    Found in lib/msf/core/exploit/remote/vim_soap.rb - About 25 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

                    Method vim_send_soap_request has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def vim_send_soap_request(soap_data)
                        res = send_request_cgi({
                          'uri'     => '/sdk',
                          'method'  => 'POST',
                          'agent'   => 'VMware VI Client',
                    Severity: Minor
                    Found in lib/msf/core/exploit/remote/vim_soap.rb - About 25 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

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

                      def vim_powerON_vm(vm_ref)
                        soap_data = vim_soap_envelope(vim_soap_power_on_vm(vm_ref))
                        res = vim_send_soap_request(soap_data)
                        if res.class == Hash
                          task_id = res['PowerOnVM_TaskResponse']['returnval']
                    Severity: Major
                    Found in lib/msf/core/exploit/remote/vim_soap.rb and 1 other location - About 2 hrs to fix
                    lib/msf/core/exploit/remote/vim_soap.rb on lines 544..571

                    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 93.

                    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 vim_powerOFF_vm(vm_ref)
                        soap_data = vim_soap_envelope(vim_soap_power_off_vm(vm_ref))
                        res = vim_send_soap_request(soap_data)
                        if res.class == Hash
                          task_id = res['PowerOffVM_TaskResponse']['returnval']
                    Severity: Major
                    Found in lib/msf/core/exploit/remote/vim_soap.rb and 1 other location - About 2 hrs to fix
                    lib/msf/core/exploit/remote/vim_soap.rb on lines 512..539

                    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 93.

                    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 vim_get_session_list
                        soap_data = vim_soap_envelope(vim_soap_retrieve_properties('sessionList','SessionManager', @server_objects['sessionManager']))
                        res = vim_send_soap_request(soap_data)
                        if res.class == Hash
                          session_list = []
                    Severity: Major
                    Found in lib/msf/core/exploit/remote/vim_soap.rb and 2 other locations - About 45 mins to fix
                    lib/msf/core/exploit/remote/vim_soap.rb on lines 262..270
                    lib/msf/core/exploit/remote/vim_soap.rb on lines 317..325

                    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 3 locations. Consider refactoring.
                    Open

                      def vim_get_domains
                        soap_data = vim_soap_envelope(vim_soap_retrieve_properties('domainList', 'UserDirectory', @server_objects['userDirectory']))
                        res = vim_send_soap_request(soap_data)
                        if res.class == Hash
                          domains = []
                    Severity: Major
                    Found in lib/msf/core/exploit/remote/vim_soap.rb and 2 other locations - About 45 mins to fix
                    lib/msf/core/exploit/remote/vim_soap.rb on lines 222..230
                    lib/msf/core/exploit/remote/vim_soap.rb on lines 317..325

                    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 3 locations. Consider refactoring.
                    Open

                      def vim_get_roles
                        soap_data = vim_soap_envelope(vim_soap_retrieve_properties('roleList', 'AuthorizationManager', @server_objects['authorizationManager']))
                        res = vim_send_soap_request(soap_data)
                        if res.class == Hash
                          roles = []
                    Severity: Major
                    Found in lib/msf/core/exploit/remote/vim_soap.rb and 2 other locations - About 45 mins to fix
                    lib/msf/core/exploit/remote/vim_soap.rb on lines 222..230
                    lib/msf/core/exploit/remote/vim_soap.rb on lines 262..270

                    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 3 locations. Consider refactoring.
                    Open

                      def vim_soap_log_user_event_vm(vm_ref,msg)
                        soap_data = '<LogUserEvent xmlns="urn:vim25">'
                        soap_data << '<_this type="EventManager">' + @server_objects['eventManager'] + '</_this>'
                        soap_data << '<entity type="VirtualMachine">' + vm_ref + '</entity>'
                        soap_data << '<msg>' + msg + '</msg>'
                    Severity: Minor
                    Found in lib/msf/core/exploit/remote/vim_soap.rb and 2 other locations - About 25 mins to fix
                    lib/msf/core/exploit/remote/vim_soap.rb on lines 63..68
                    lib/msf/core/exploit/remote/vim_soap.rb on lines 73..78

                    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 30.

                    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 vim_soap_login(user,pass)
                        soap_data = '<Login xmlns="urn:vim25">'
                        soap_data << '<_this type="SessionManager">' + @server_objects['sessionManager'] + '</_this>'
                        soap_data << '<userName>' + user + '</userName>'
                        soap_data << '<password>' + pass + '</password>'
                    Severity: Minor
                    Found in lib/msf/core/exploit/remote/vim_soap.rb and 2 other locations - About 25 mins to fix
                    lib/msf/core/exploit/remote/vim_soap.rb on lines 73..78
                    lib/msf/core/exploit/remote/vim_soap.rb on lines 103..108

                    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 30.

                    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 vim_soap_session_active?(key, user)
                        soap_data = '<SessionIsActive xmlns="urn:vim25">'
                        soap_data << '<_this type="SessionManager">' + @server_objects['sessionManager'] + '</_this>'
                        soap_data << '<sessionID>' + key+ '</sessionID>'
                        soap_data << '<userName>' + user + '</userName>'
                    Severity: Minor
                    Found in lib/msf/core/exploit/remote/vim_soap.rb and 2 other locations - About 25 mins to fix
                    lib/msf/core/exploit/remote/vim_soap.rb on lines 63..68
                    lib/msf/core/exploit/remote/vim_soap.rb on lines 103..108

                    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 30.

                    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 vim_get_dc_name(dc)
                        soap_data = vim_soap_envelope(vim_soap_retrieve_properties('name','Datacenter',dc))
                        res = vim_send_soap_request(soap_data)
                        if res.class == Hash
                          return res['RetrievePropertiesResponse']['returnval']['propSet']['val']
                    Severity: Minor
                    Found in lib/msf/core/exploit/remote/vim_soap.rb and 1 other location - About 20 mins to fix
                    lib/msf/core/exploit/remote/vim_soap.rb on lines 425..431

                    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 28.

                    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 vim_get_host_hw(host)
                        soap_data = vim_soap_envelope(vim_soap_retrieve_properties('hardware', 'HostSystem' , host))
                        res = vim_send_soap_request(soap_data)
                        if res.class == Hash
                          return res['RetrievePropertiesResponse']['returnval']['propSet']['val']
                    Severity: Minor
                    Found in lib/msf/core/exploit/remote/vim_soap.rb and 1 other location - About 20 mins to fix
                    lib/msf/core/exploit/remote/vim_soap.rb on lines 331..337

                    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 28.

                    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