Showing 248 of 460 total issues
Method put_vapp_metadata_item_metadata
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def put_vapp_metadata_item_metadata(id, key, value)
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_configure_edge_gateway_services
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def post_configure_edge_gateway_services(id, configuration)
unless data[:edge_gateways][id]
raise Fog::Compute::VcloudDirector::Forbidden.new(
"No access to entity \"(com.vmware.vcloud.entity.edgegateway:#{id})\"."
)
Method put_catalog_item_metadata_item_metadata
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def put_catalog_item_metadata_item_metadata(id, key, value)
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 proxy
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def proxy(vm_resource)
# Check configurations and VM attributes
#if !is_running?
# return error(400, "VNC Proxy is not running")
#end
Method get_catalog
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_catalog(id)
unless catalog = data[:catalogs][id]
raise Fog::Compute::VcloudDirector::Forbidden.new(
"No access to entity \"(com.vmware.vcloud.entity.catalog:#{id})\"."
)
Method post_clone_vapp
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def post_clone_vapp(vdc_id, name, source_id, options={})
body = Nokogiri::XML::Builder.new do
attrs = {
:xmlns => 'http://www.vmware.com/vcloud/v1.5',
:name => name
Method get_mock_vm_body
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_mock_vm_body(id)
unless vm = data[:vms][id]
raise Fog::Compute::VcloudDirector::Forbidden.new(
'This operation is denied.'
)
Method end_element
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name)
case name
when 'Enabled'
@response[:enabled] = (value == "true")
when 'ChangeSid'
Method get_edge_gateway
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_edge_gateway(id)
response = request(
:expects => 200,
:idempotent => true,
:method => 'GET',
Method available?
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def available?
availability = true
for service in services
begin
service = self.class_for(service)
Consider simplifying this complex logical expression. Open
if self.identity
options = {
:serverid => self.identity,
:disksize => disksize,
:memorysize => memorysize,
Method end_element
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
parse_end_element name, @response[:vm]
case name
when 'IpAddress'
@response[:vm][:ip_address] = value
- 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 update_record
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def update_record(record_id, name, content, type, options = {})
path = "/rapi/updaterecord/#{record_id}"
path << "?name=#{name}&content=#{content}&type=#{type}"
path << "&priority=#{options[:priority]}" if options[:priority]
- 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 create_record
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def create_record(domain_id, name, content, type, options = {})
path = "/rapi/createrecord/#{domain_id}"
path << "?name=#{name}&content=#{content}&type=#{type}"
path << "&priority=#{options[:priority]}" if options[:priority]
- 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 save
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def save
if self.identity
options = {
:serverid => self.identity,
:disksize => disksize,
- 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 create_server
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def create_server(image_id, options = {})
data = {
'server' => {
:vps_os => image_id,
:vps_hdd => options[:vps_hdd]?options[:vps_hdd]: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 parse_end_element
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def parse_end_element(name, vm)
case name
when 'IpAddress'
vm[:ip_address] = value
when 'Description'
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
def do_request(params)
# Convert the uri to a URI if it's a string.
if params[:uri].is_a?(String)
params[:uri] = URI.parse(params[:uri])
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 build_vapp_instantiation_params
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def build_vapp_instantiation_params(xml)
xml.Description @configuration[:Description] if @configuration[:Description]
vapp = @configuration[:InstantiationParams]
if vapp
- 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 save
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def save
requires :name, :type, :value
options = {}
options[:priority] = priority if priority
options[:ttl] = ttl if ttl
- 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"