Showing 103 of 135 total issues
Method forward_ports
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
def forward_ports
ports = {}
edge_ports = []
cfg = @env[:machine].provider_config
- Create a ticketCreate a ticket
Method action_destroy
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def self.action_destroy
Vagrant::Action::Builder.new.tap do |b|
b.use Call, DestroyConfirm do |env, b2|
if env[:result]
b2.use ConfigValidate
- Read upRead up
- Create a ticketCreate a ticket
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 forward_ports
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def forward_ports
ports = {}
edge_ports = []
cfg = @env[:machine].provider_config
- Read upRead up
- Create a ticketCreate a ticket
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_file
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
def upload_file(upload_url, upload_file, vapp_template, config = {})
# Set chunksize to 1M if not specified otherwise
chunk_size = (config[:chunksize] || 1_048_576)
@logger.debug("Set chunksize to #{chunk_size} bytes")
- Create a ticketCreate a ticket
Method vcloud_check_inventory
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
def vcloud_check_inventory(env)
# Will check each mandatory config value against the vCloud Director
# Instance and will setup the global environment config values
cfg = env[:machine].provider_config
cnx = cfg.vcloud_cnx.driver
- Create a ticketCreate a ticket
Method vcloud_check_inventory
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def vcloud_check_inventory(env)
# Will check each mandatory config value against the vCloud Director
# Instance and will setup the global environment config values
cfg = env[:machine].provider_config
cnx = cfg.vcloud_cnx.driver
- Read upRead up
- Create a ticketCreate a ticket
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 recompose_vapp_from_vm
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
def recompose_vapp_from_vm(vapp_id, vm_list = {}, network_config = [], _cfg)
original_vapp = get_vapp(vapp_id)
builder = Nokogiri::XML::Builder.new do |xml|
xml.RecomposeVAppParams(
- Create a ticketCreate a ticket
Method call
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def call(env)
@logger.info('Detecting any forwarded port collisions...')
# Determine a list of usable ports for repair
usable_ports = Set.new(env[:machine].config.vm.usable_port_range)
- Read upRead up
- Create a ticketCreate a ticket
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 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
def call(env)
@logger.info('Detecting any forwarded port collisions...')
# Determine a list of usable ports for repair
usable_ports = Set.new(env[:machine].config.vm.usable_port_range)
- Create a ticketCreate a ticket
Method validate
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
def validate(machine)
errors = _detected_errors
# TODO: add blank?
errors << I18n.t('vagrant_vcloud.config.hostname') if hostname.nil?
- Create a ticketCreate a ticket
Method call
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
def call(env)
@app.call(env)
ssh_info = env[:machine].ssh_info
- Create a ticketCreate a ticket
File action.rb
has 275 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'pathname'
require 'vagrant/action/builder'
module VagrantPlugins
module VCloud
- Create a ticketCreate a ticket
Method call
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def call(env)
@app.call(env)
ssh_info = env[:machine].ssh_info
- Read upRead up
- Create a ticketCreate a ticket
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_edge_public_ip
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def get_vapp_edge_public_ip(vapp_id, network_name=nil)
return @cached_vapp_edge_public_ips["#{vapp_id}#{network_name}"] unless @cached_vapp_edge_public_ips["#{vapp_id}#{network_name}"].nil?
# Check the network configuration section
params = {
- Read upRead up
- Create a ticketCreate a ticket
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 send_request
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def send_request(params, payload = nil, content_type = nil)
# Create a new HTTP client
clnt = HTTPClient.new
# Set SSL proto to TLSv1
- Create a ticketCreate a ticket
Method execute
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def execute
options = {}
opts = OptionParser.new do |o|
o.banner = 'Usage: vagrant vcloud [options]'
- Create a ticketCreate a ticket
Method with_forwarded_ports
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def with_forwarded_ports(env)
env[:machine].config.vm.networks.each do |type, options|
# Ignore anything but forwarded ports
next if type != :forwarded_port
next if !options[:disabled].nil? && options[:disabled] == true
- Read upRead up
- Create a ticketCreate a ticket
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_file
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def upload_file(upload_url, upload_file, vapp_template, config = {})
# Set chunksize to 1M if not specified otherwise
chunk_size = (config[:chunksize] || 1_048_576)
@logger.debug("Set chunksize to #{chunk_size} bytes")
- Read upRead up
- Create a ticketCreate a ticket
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
File build_vapp.rb
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'securerandom'
require 'etc'
require 'netaddr'
module VagrantPlugins
- Create a ticketCreate a ticket
File base.rb
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'log4r'
require 'vagrant/util/busy'
require 'vagrant/util/platform'
require 'vagrant/util/retryable'
require 'vagrant/util/subprocess'
- Create a ticketCreate a ticket