Showing 248 of 460 total issues
Method slurp
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def self.slurp(error, service=nil)
major_error_code = nil
message = nil
minor_error_code = nil
stack_trace = nil
- 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_update_catalog_item_metadata
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def post_update_catalog_item_metadata(id, metadata={})
body = Nokogiri::XML::Builder.new do
attrs = {
:xmlns => 'http://www.vmware.com/vcloud/v1.5',
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance'
- 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_update_media_metadata
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def post_update_media_metadata(id, metadata={})
body = Nokogiri::XML::Builder.new do
attrs = {
:xmlns => 'http://www.vmware.com/vcloud/v1.5',
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance'
- 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 start
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def start
if is_running?
message="VNC server already running"
STDERR.puts message
@logger.info message
- 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 slurp
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.slurp(error, service=nil)
major_error_code = nil
message = nil
minor_error_code = nil
stack_trace = nil
Method parse_end_element
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_end_element(name, vm)
case name
when 'IpAddress'
vm[:ip_address] = value
when 'Description'
Method []
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def [](service)
@@connections ||= Hash.new do |hash, key|
hash[key] = case key
when :compute
Fog::Logger.warning("OpenStack[:compute] is not recommended, use Compute[:openstack] for portability")
Method class_for
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def class_for(key)
case key
when :auto_scale
Fog::Rackspace::AutoScale
when :block_storage
Method get_current_session
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_current_session
body =
{:href => make_href('session/'),
:type => 'application/vnd.vmware.vcloud.session+xml',
:org => data[:org][:name],
Method populate_images
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.populate_images
images = {}
images["20010001"] = {
"name"=>"SUSE Linux Enterprise Server 11 SP1 for x86",
"manifest"=>"https://www-147.ibm.com/cloud/enterprise/ram.ws/RAMSecure/artifact/{6CD09CE4-E99B-D72F-6C29-233C9B2A1676}/1.0/parameters.xml",
Method post_update_disk_metadata
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def post_update_disk_metadata(id, metadata={})
body = Nokogiri::XML::Builder.new do
attrs = {
:xmlns => 'http://www.vmware.com/vcloud/v1.5',
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance'
Method post_update_vapp_template_metadata
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def post_update_vapp_template_metadata(id, metadata={})
body = Nokogiri::XML::Builder.new do
attrs = {
:xmlns => 'http://www.vmware.com/vcloud/v1.5',
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance'
Method post_update_vapp_metadata
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def post_update_vapp_metadata(id, metadata={})
body = Nokogiri::XML::Builder.new do
attrs = {
:xmlns => 'http://www.vmware.com/vcloud/v1.5',
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance'
Method post_update_catalog_item_metadata
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def post_update_catalog_item_metadata(id, metadata={})
body = Nokogiri::XML::Builder.new do
attrs = {
:xmlns => 'http://www.vmware.com/vcloud/v1.5',
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance'
Method post_update_media_metadata
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def post_update_media_metadata(id, metadata={})
body = Nokogiri::XML::Builder.new do
attrs = {
:xmlns => 'http://www.vmware.com/vcloud/v1.5',
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance'
Method modify_hard_disk_size
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def modify_hard_disk_size(disk_number, new_size)
found = false
@items.each do |item|
if item[:resource_type] == 17
if item[:name] == "Hard disk #{disk_number}"
- 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 do_request
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def do_request(params)
headers = {
'Accept' => "application/*+xml;version=#{@api_version}",
'x-vcloud-authorization' => vcloud_token
}
- 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 validate_instantiate_vapp_template_options
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def validate_instantiate_vapp_template_options options
# :network_uri removed, if not specified will use template network config.
valid_opts = [:catalog_item_uri, :name, :vdc_uri]
unless valid_opts.all? { |opt| options.key?(opt) }
raise ArgumentError.new("Required data missing: #{(valid_opts - options.keys).map(&:inspect).join(", ")}")
- 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 container_action
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def container_action(options = {})
raise ArgumentError, "instance id is a required parameter" unless options.key? :id
raise ArgumentError, "action is a required parameter" unless options.key? :action
result = Docker::Container.get(options[:id], {}, @connection).send(options[:action], options[: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 mock_update
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def mock_update(data, obj_or_collection, status, key, &clean_before_update)
data = Fog::JSON.decode(Fog::JSON.encode(data))
if key
unless self.data[obj_or_collection][key]
raise Fog::CloudSigma::Errors::NotFound.new("Object with uuid #{key} does not exist", 'notexist')
- 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"