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'),
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 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 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 get_execute_query
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def get_execute_query(type=nil, options={})
if type.nil?
response = request(
:expects => 200,
:idempotent => true,
- 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 get_execute_query
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def get_execute_query(type=nil, options={})
unless options[:fields].nil?
Fog::Mock.not_implemented("Fields are not yet implemented in get_execute_query Mock for #{type}")
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 get_execute_query
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_execute_query(type=nil, options={})
if type.nil?
response = request(
:expects => 200,
:idempotent => true,
Method get_execute_query
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_execute_query(type=nil, options={})
unless options[:fields].nil?
Fog::Mock.not_implemented("Fields are not yet implemented in get_execute_query Mock for #{type}")
end