Showing 80 of 109 total issues
Method forward_ports
has 74 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 call
has a Cognitive Complexity of 21 (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 read_ssh_info
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def read_ssh_info(env)
return nil if env[:machine].id.nil?
cfg = env[:machine].provider_config
cnx = cfg.vcloudair_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 vcloud_check_inventory
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def vcloud_check_inventory(env)
# Will check each mandatory config value against the vCloud Air
# Instance and will setup the global environment config values
cfg = env[:machine].provider_config
cnx = cfg.vcloudair_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 upload_file
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def upload_file(upload_url, upload_file, vapp_template, config = {})
# Set chunksize to 5M if not specified otherwise
chunk_size = (config[:chunksize] || 5_242_880)
@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
Method set_vm_hardware
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def set_vm_hardware(vm_id, cfg)
params = {
'method' => :get,
'command' => "/vApp/vm-#{vm_id}/virtualHardwareSection"
}
- 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 initialize
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def initialize(cloud_id, username, password, vdc_name)
# Setup the base
super()
@username = username
- 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_vcloudair_request
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def send_vcloudair_request(params, payload = nil, content_type = nil)
# Create a new HTTP client
clnt = HTTPClient.new
# Disable SSL cert verification
- 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 send_request
has 55 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 validate
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def validate(machine)
errors = _detected_errors
errors << I18n.t('vagrant_vcloudair.errors.config.username') if username.nil?
errors << I18n.t('vagrant_vcloudair.errors.config.password') if password.nil?
- Create a ticketCreate a ticket
File action.rb
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'pathname'
require 'vagrant/action/builder'
module VagrantPlugins
module VCloudAir
- Create a ticketCreate a ticket
Method send_vcloudair_request
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def send_vcloudair_request(params, payload = nil, content_type = nil)
# Create a new HTTP client
clnt = HTTPClient.new
# Disable SSL cert verification
- 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_vm
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_vm(vm_id)
params = {
'method' => :get,
'command' => "/vApp/vm-#{vm_id}"
}
- Create a ticketCreate a ticket
Method get_edge_gateway_rules
has 50 lines of code (exceeds 25 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,
- Create a ticketCreate a ticket
Method send_request
has a Cognitive Complexity of 15 (exceeds 5 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
- 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 remove_edge_gateway_rules
has 46 lines of code (exceeds 25 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 = {
- Create a ticketCreate a ticket
Method recompose_vapp_from_vm
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def recompose_vapp_from_vm(vapp_id, vm_list = {}, network_config = {})
original_vapp = get_vapp(vapp_id)
builder = Nokogiri::XML::Builder.new do |xml|
xml.RecomposeVAppParams(
- Create a ticketCreate a ticket
Method add_vapp_port_forwarding_rules
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_vapp_port_forwarding_rules(vapp_id, network_name, config = {})
builder = Nokogiri::XML::Builder.new do |xml|
xml.NetworkConfigSection(
'xmlns' => 'http://www.vmware.com/vcloud/v1.5',
'xmlns:ovf' => 'http://schemas.dmtf.org/ovf/envelope/1') {
- Create a ticketCreate a ticket
Method get_organization
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_organization(org_id)
params = {
'method' => :get,
'command' => "/org/#{org_id}"
}
- Create a ticketCreate a ticket