gosddc/vagrant-vcloudair

View on GitHub

Showing 80 of 109 total issues

Method set_vm_network_config has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        def set_vm_network_config(vm_id, network_name, config = {})
          builder = Nokogiri::XML::Builder.new do |xml|
            xml.NetworkConnectionSection(
              'xmlns' => 'http://www.vmware.com/vcloud/v1.5',
              'xmlns:ovf' => 'http://schemas.dmtf.org/ovf/envelope/1') {
Severity: Minor
Found in lib/vagrant-vcloudair/driver/version_5_1.rb - About 55 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 call has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        def call(env)
          config = env[:machine].provider_config

          if !config.vcloudair_cnx || !config.vcloudair_cnx.driver.auth_key
            @logger.info('Connecting to vCloud Air...')
Severity: Minor
Found in lib/vagrant-vcloudair/action/connect_vcloud.rb - About 55 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 set_vm_guest_customization has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        def set_vm_guest_customization(vm_id, computer_name, config = {})
          builder = Nokogiri::XML::Builder.new do |xml|
          xml.GuestCustomizationSection(
            'xmlns' => 'http://www.vmware.com/vcloud/v1.5',
            'xmlns:ovf' => 'http://schemas.dmtf.org/ovf/envelope/1') {
Severity: Minor
Found in lib/vagrant-vcloudair/driver/version_5_1.rb - About 55 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 action_up has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

      def self.action_up
        Vagrant::Action::Builder.new.tap do |b|
          b.use ConfigValidate
          b.use Call, IsCreated do |env, b2|
            b2.use HandleBox unless env[:result]
Severity: Minor
Found in lib/vagrant-vcloudair/action.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

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

        def check_edge_gateway_network(edge_gateway_name, vdc_id, vdc_network_name)
          edge_gateway_id = find_edge_gateway_id(edge_gateway_name, vdc_id)

          params = {
            'method'  => :get,
Severity: Minor
Found in lib/vagrant-vcloudair/driver/version_5_1.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

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

      def execute
        options = {}
        opts = OptionParser.new do |o|
          o.banner = 'Usage: vagrant vcloud [options]'

Severity: Minor
Found in lib/vagrant-vcloudair/command.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

Method upload_ovf has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        def upload_ovf(vdc_id, vapp_name, vapp_description, ovf_file,
                       catalog_id, upload_options = {})
Severity: Minor
Found in lib/vagrant-vcloudair/driver/base.rb - About 45 mins to fix

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

        def get_vapp_edge_public_ip(vapp_id)
          return @cached_vapp_edge_public_ips[vapp_id] unless @cached_vapp_edge_public_ips[vapp_id].nil?

          # Check the network configuration section
          params = {
Severity: Minor
Found in lib/vagrant-vcloudair/driver/version_5_1.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

Method upload_ovf has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        def upload_ovf(vdc_id, vapp_name, vapp_description, ovf_file, catalog_id, upload_options = {})
Severity: Minor
Found in lib/vagrant-vcloudair/driver/version_5_1.rb - About 45 mins to fix

Method create_vapp_from_template has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        def create_vapp_from_template(vdc, vapp_name, vapp_description,
                                      vapp_templateid, poweron = false)
Severity: Minor
Found in lib/vagrant-vcloudair/driver/base.rb - About 35 mins to fix

Method compose_vapp_from_vm has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        def compose_vapp_from_vm(vdc, vapp_name, vapp_description, vm_list = {}, network_config = {})
Severity: Minor
Found in lib/vagrant-vcloudair/driver/version_5_1.rb - About 35 mins to fix

Method compose_vapp_from_vm has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        def compose_vapp_from_vm(vdc, vapp_name, vapp_description,
                                 vm_list = {}, network_config = {})
Severity: Minor
Found in lib/vagrant-vcloudair/driver/base.rb - About 35 mins to fix

Method add_edge_gateway_rules has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        def add_edge_gateway_rules(edge_gateway_name, vdc_id, edge_gateway_ip, vapp_id, ports)
Severity: Minor
Found in lib/vagrant-vcloudair/driver/version_5_1.rb - About 35 mins to fix

Method create_vapp_from_template has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        def create_vapp_from_template(vdc, vapp_name, vapp_description, vapp_template_id, poweron = false)
Severity: Minor
Found in lib/vagrant-vcloudair/driver/version_5_1.rb - About 35 mins to fix

Method find_edge_gateway_network has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def find_edge_gateway_network(edge_gateway_name, vdc_id, edge_gateway_ip)
          edge_gateway_id = find_edge_gateway_id(edge_gateway_name, vdc_id)

          params = {
            'method'  => :get,
Severity: Minor
Found in lib/vagrant-vcloudair/driver/version_5_1.rb - 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

Method remove_edge_gateway_rules has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def remove_edge_gateway_rules(edge_gateway_name, vdc_id, edge_gateway_ip, vapp_id)
          edge_vapp_ip = get_vapp_edge_public_ip(vapp_id)
          edge_gateway_id = find_edge_gateway_id(edge_gateway_name, vdc_id)

          params = {
Severity: Minor
Found in lib/vagrant-vcloudair/driver/version_5_1.rb - 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

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

        def compile_forwarded_ports(config)
          mappings = {}

          config.vm.networks.each do |type, options|
            if type == :forwarded_port
Severity: Minor
Found in lib/vagrant-vcloudair/util/compile_forwarded_ports.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 get_edge_gateway_rules has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def get_edge_gateway_rules(edge_gateway_name, vdc_id)
          edge_gateway_id = find_edge_gateway_id(edge_gateway_name, vdc_id)

          params = {
            'method'  => :get,
Severity: Minor
Found in lib/vagrant-vcloudair/driver/version_5_1.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 get_catalog_id_by_name has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def get_catalog_id_by_name(organization, catalog_name)
          result = nil

          organization[:catalogs].each do |catalog|
            if catalog[0].downcase == catalog_name.downcase
Severity: Minor
Found in lib/vagrant-vcloudair/driver/version_5_1.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 get_vapp has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def get_vapp(vapp_id)
          params = {
            'method'  => :get,
            'command' => "/vApp/vapp-#{vapp_id}"
          }
Severity: Minor
Found in lib/vagrant-vcloudair/driver/version_5_1.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

Severity
Category
Status
Source
Language