Showing 248 of 460 total issues
Method stop
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def stop(force=false)
pid=get_pid
if pid
@logger.info "Killing VNC proxy"
- 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 auth_header
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def auth_header(type = :basic)
case type
when :basic
unless @username and @password
raise ArgumentError, 'Username and password required for basic auth'
- 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 configure_org_network
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def configure_org_network(vapp_id, vapp_network, vapp_network_uri, org_network, org_network_uri, enable_firewall=false, port_map=nil)
Method generate_configure_org_network_request
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def generate_configure_org_network_request(vapp_id, vapp_network, vapp_network_uri, org_network, org_network_uri, enable_firewall=false, portmap=nil)
Method linode_disk_createfromstackscript
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def linode_disk_createfromstackscript(linode_id, script_id, distro_id, name, size, password, options={})
Avoid deeply nested control flow statements. Open
if ipRange = ipRanges[:IpRange]
xml.IpRange {
xml.StartAddress ipRange[:StartAddress]
xml.EndAddress ipRange[:EndAddress]
}
Method put_media_metadata_item_metadata
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def put_media_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'
- 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
Avoid deeply nested control flow statements. Open
if h.key?(:IpRange)
IpRange {
StartAddress h[:IpRange][:StartAddress]
EndAddress h[:IpRange][:EndAddress]
}
Method put_vapp_template_metadata_item_metadata
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def put_vapp_template_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'
- 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_vpn
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def build_vpn(xml)
vpn_config = @configuration[:GatewayIpsecVpnService]
return unless vpn_config
xml.GatewayIpsecVpnService {
- 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_create_catalog_item
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def post_create_catalog_item(id, name, entity, options={})
body = Nokogiri::XML::Builder.new do
attrs = {
:xmlns => 'http://www.vmware.com/vcloud/v1.5',
:name => 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 put_catalog_item_metadata_item_metadata
has a Cognitive Complexity of 8 (exceeds 5 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'
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
def request(params)
params[:query] ||= {}
params[:query].merge!(:api_key => @linode_api_key)
response = @connection.request(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"
Further reading
Method linode_disk_createfromimage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def linode_disk_createfromimage(linode_id, image_id, label, size, password, sshkey)
Method post_reconfigure_vm
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def post_reconfigure_vm(id, options={})
unless vm = data[:vms][id]
raise Fog::Compute::VcloudDirector::Forbidden.new(
'This operation is denied.'
)
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
def request(params)
params[:query] ||= {}
params[:query].merge!(:api_key => @linode_api_key)
response = @connection.request(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"
Further reading
Avoid deeply nested control flow statements. Open
if controller >= max_ctlr
raise Fog::CloudSigma::Errors::Error.new("Max channel reached, cannot attach more")
end
Method put_vapp_metadata_item_metadata
has a Cognitive Complexity of 8 (exceeds 5 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'
- 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_create
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def mock_create(collection, status, data, key, defaults={}, &clean_before_store)
Method linode_disk_createfromimage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def linode_disk_createfromimage(linode_id, image_id, label, size, password, sshkey)