frapposelli/vagrant-vcloud

View on GitHub
lib/vagrant-vcloud/action/build_vapp.rb

Summary

Maintainability
F
3 days
Test Coverage

Method call has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring.
Open

        def call(env)
          # FIXME: we need to find a way to clean things up when a SIGINT get
          # called... see env[:interrupted] in the vagrant code

          cfg = env[:machine].provider_config
Severity: Minor
Found in lib/vagrant-vcloud/action/build_vapp.rb - About 1 day 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 243 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def call(env)
          # FIXME: we need to find a way to clean things up when a SIGINT get
          # called... see env[:interrupted] in the vagrant code

          cfg = env[:machine].provider_config
Severity: Major
Found in lib/vagrant-vcloud/action/build_vapp.rb - About 1 day to fix

File build_vapp.rb has 260 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'securerandom'
require 'etc'
require 'netaddr'

module VagrantPlugins
Severity: Minor
Found in lib/vagrant-vcloud/action/build_vapp.rb - About 2 hrs to fix

Avoid deeply nested control flow statements.
Open

                  if !net_id
                    raise 'vCloud User credentials has insufficient privileges'
                  end
Severity: Major
Found in lib/vagrant-vcloud/action/build_vapp.rb - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                  if !net_id
                    # TEMP FIX: permissions issues at the Org Level for vApp authors
                    #           to "view" Org vDC Networks but they can see them at the
                    #           Organization vDC level (tsugliani)
                    net_id = cfg.vdc[:networks][net[:vdc_network_name]]
Severity: Major
Found in lib/vagrant-vcloud/action/build_vapp.rb - About 45 mins to fix

There are no issues that match your filters.

Category
Status