Showing 248 of 460 total issues
Method get_supported_versions
has 1129 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_supported_versions
body =
{:xmlns=>"http://www.vmware.com/vcloud/versions",
:xmlns_xsi=>xmlns_xsi,
:xsi_schemaLocation=>xsi_schema_location,
File get_supported_versions.rb
has 1150 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Fog
module Compute
class VcloudDirector
class Real
# List all supported versions.
Method build_source_items
has a Cognitive Complexity of 144 (exceeds 5 allowed). Consider refactoring. Open
def build_source_items(xml)
vms = @configuration[:source_vms]
vms.each do |vm|
xml.SourcedItem {
xml.Source(:name =>vm[:name], :href => vm[:href])
- Read upRead up
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 generate_xml
has a Cognitive Complexity of 140 (exceeds 5 allowed). Consider refactoring. Open
def generate_xml
body = Nokogiri::XML::Builder.new do
attrs = {
:xmlns => 'http://www.vmware.com/vcloud/v1.5',
:name => options[:name]
- Read upRead up
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 generate_xml
has a Cognitive Complexity of 108 (exceeds 5 allowed). Consider refactoring. Open
def generate_xml
body = Nokogiri::XML::Builder.new do |xml|
attrs = {
:xmlns => 'http://www.vmware.com/vcloud/v1.5',
'xmlns:ovf' => 'http://schemas.dmtf.org/ovf/envelope/1'
- Read upRead up
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 compute.rb
has 801 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'fog/vcloud_director/core'
require 'fog/vcloud_director/query'
class VcloudDirectorParser < Fog::Parsers::Base
def extract_attributes(attributes_xml)
Method all_types
has 328 lines of code (exceeds 25 allowed). Consider refactoring. Open
def all_types
{:xmlns=>xmlns,
:xmlns_xsi=>xmlns_xsi,
:type=>"application/vnd.vmware.vcloud.query.queryList+xml",
:href=>make_href('query'),
Method post_instantiate_vapp_template
has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring. Open
def post_instantiate_vapp_template(id, vapp_template_id, name, options={})
body = Nokogiri::XML::Builder.new do
attrs = {
'xmlns' => 'http://www.vmware.com/vcloud/v1.5',
'xmlns:ovf' => 'http://schemas.dmtf.org/ovf/envelope/1',
- Read upRead up
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 get_execute_query.rb
has 630 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Fog
module Compute
class VcloudDirector
class Real
# REST API General queries handler.
Method data
has 245 lines of code (exceeds 25 allowed). Consider refactoring. Open
def data
@@data ||= Hash.new do |hash, key|
vdc1_uuid = uuid
vdc2_uuid = uuid
Method generate_configure_vm_request
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
def generate_configure_vm_request(vm_data)
xmlns = 'http://schemas.dmtf.org/ovf/envelope/1'
xmlns_vcloud = 'http://www.vmware.com/vcloud/v1'
xmlns_rasd = 'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData'
xmlns_vssd = 'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData'
- Read upRead up
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 vm_allocate
has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring. Open
def vm_allocate(attr={ })
if(attr[:flavor].nil?)
raise(ArgumentError.new("Attribute flavor is nil! #{attr.inspect}"))
end
- Read upRead up
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 fetch_items
has 216 lines of code (exceeds 25 allowed). Consider refactoring. Open
def fetch_items(type, opts)
if opts.key?(:filter) && opts[:filter] =~ /^name==([^;,]+)$/
name = $1
elsif type == 'vAppTemplate' && opts.key?(:filter) &&
opts[:filter] =~ /^name==([^;,]+);catalogName==([^;,]+)$/ #TODO also match in other order
Method get_supported_systems_info
has 208 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_supported_systems_info
body = # this is a subset of the full list
{:xmlns=>xmlns,
:xmlns_xsi=>xmlns_xsi,
:type=>"application/vnd.vmware.vcloud.supportedSystemsInfo+xml",
Method build_firewall_service
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
def build_firewall_service(xml)
firewall_config = @configuration[:FirewallService]
return unless firewall_config
xml.FirewallService {
- Read upRead up
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 put_guest_customization_section_vapp
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
def put_guest_customization_section_vapp(id, options={})
options = options.dup
# Mutate options to new format.
deprecated = {
- Read upRead up
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 fetch_items
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
def fetch_items(type, opts)
if opts.key?(:filter) && opts[:filter] =~ /^name==([^;,]+)$/
name = $1
elsif type == 'vAppTemplate' && opts.key?(:filter) &&
opts[:filter] =~ /^name==([^;,]+);catalogName==([^;,]+)$/ #TODO also match in other order
- Read upRead up
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 template_pool
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
def template_pool(filter = { })
templates = ::OpenNebula::TemplatePool.new(client)
if filter[:id].nil?
templates.info!(-2,-1,-1)
- Read upRead up
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 list_vms
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def list_vms(filter={})
vms=[]
vmpool = ::OpenNebula::VirtualMachinePool.new(client)
if filter[:id].nil?
vmpool.info!(-2,-1,-1,-1)
- Read upRead up
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
Class Server
has 38 methods (exceeds 20 allowed). Consider refactoring. Open
class Server < Fog::Vcloud::Model
include Fog::Vcloud::Compute::Helpers::Status
identity :href, :aliases => :Href
attribute :links, :aliases => :Link, :type => :array