Showing 248 of 460 total issues
Method get_nic
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_nic
# NIC=[MODEL="virtio",NETWORK="vlan17",NETWORK_UNAME="oneadmin"]
return "" if nic.nil?
ret = ""
if nic.is_a? Array
- 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 network_to_attributes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def network_to_attributes(net)
return if net.nil?
h = {
:id => net["VNET"]["ID"],
:name => net["VNET"]["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 unmount_volume
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def unmount_volume(volume_or_position)
if volume_or_position.kind_of? Fixnum
self.volumes.delete_at(volume_or_position)
# assign to update attributes
return self.volumes = self.volumes
- 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 post_clone_media
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def post_clone_media(vdc_id, source_id, options={})
body = Nokogiri::XML::Builder.new do
attrs = {
:xmlns => 'http://www.vmware.com/vcloud/v1.5'
}
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
def vm_allocate(attr={ })
response = Excon::Response.new
response.status = 200
id = rand(1000)
- 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 image_pool
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def image_pool(filter = { })
images = ::OpenNebula::ImagePool.new(client)
if filter[:mine].nil?
images.info!
- 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 all
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def all(options={})
[[:kvm, :isKVM], [:xen, :isXen]].each do |type, param|
options[param] = options[type] ? 1 : 0 if options.has_key?(type)
end
load kernels(options)
- 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 request
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def request(params)
params[:headers] ||= {}
params[:headers]['x-dnsme-apiKey'] = @dnsmadeeasy_api_key
params[:headers]['x-dnsme-requestDate'] = Fog::Time.now.to_date_header
params[:headers]['x-dnsme-hmac'] = signature(params)
- 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"