Showing 893 of 1,587 total issues
Method on_associate_volume
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def on_associate_volume(instance, volume)
if instance.boot_volume_id == volume.canonical_uuid && volume.guest_device_name.nil?
# set device name as boot drive.
volume.guest_device_name =
if instance.image.features[:virtio]
- 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 hypervisor_driver
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def hypervisor_driver(driver_class)
if driver_class.is_a?(Class) && driver_class < (Drivers::Hypervisor)
# TODO: do not create here. the configuration object needs to be attached in earlier phase.
@config[:hypervisor_driver][driver_class] ||= driver_class.configuration_class.new(self)
elsif (c = Drivers::Hypervisor.driver_class(driver_class))
- 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 validate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate(errors)
unless self.amqp_server_uri
errors << "Unknown amqp_server_uri: #{self.amqp_server_uri}"
end
unless self.export_uri
- 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 issue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.issue(command_str,cmd)
dcmgr_path = DcmgrGui::Application.config.dcmgr_path
ssh = 'ssh root@`hostname`'
ruby_path = "#{dcmgr_path}/ruby/bin"
gem_home = "GEM_HOME=#{dcmgr_path}/.vender/bundle/ruby/1.9.1"
- 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 umount_root_image
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def umount_root_image(ctx, mount_path)
case ctx.inst[:image][:file_format]
when "raw"
# umount vm image directory
raise "root mount point does not exist #{mount_path}" unless File.directory?(mount_path)
- 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 credentials!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def credentials!
unless provided?
auth = Rack::Auth::Basic::Request.new(@app.request.env)
unless auth.provided? && auth.basic? && auth.credentials
@app.authorize!
- 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 create
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create
catch_error do
backup_object_ids = params[:ids]
display_name = params[:display_name]
if backup_object_ids
- 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 modify
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def modify(model,uuid,fields)
UnknownModelError.raise(model) unless model < Sequel::Model
raise ArgumentError unless fields.is_a? Hash
to_modify = model[uuid] || UnknownUUIDError.raise(uuid)
- 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 build_qemu_options
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def build_qemu_options(hc, monitor_tcp_port, opts={})
inst = hc.inst
cmd = ["-m %d",
"-smp %d",
"-name vdc-%s",
- 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 cgroup_set
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def cgroup_set(subsys, scope, &blk)
if driver_configuration.cgroup_blkio.enable_throttling == false
return
end
cgroup_mnt = `findmnt -n -t cgroup -O "#{subsys}"`.split("\n").first
- 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 terminate_instance
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def terminate_instance(hc)
poweroff_instance(hc)
# delete container folder
sh("vzctl destroy %s",[hc.inst_id])
- 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 attach_volume_to_host
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def attach_volume_to_host(ctx, volume_id)
vol = ctx.inst[:volume][volume_id]
raise "Unknown volume_id is specified: #{volume_id}" if vol.nil?
if vol[:volume_type] == 'Dcmgr::Models::IscsiVolume'
- 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 delete_alarm
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def delete_alarm(uuid)
raise ArgumentError unless uuid.is_a?(String)
if get_hash(uuid)
get_timer(uuid).cancel unless @timer.nil?
delete_hash(uuid)
- 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"