Showing 156 of 616 total issues
Method save
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def save(options = {})
requires :directory, :key
options['Cache-Control'] = cache_control if cache_control
options['Content-Type'] = content_type if content_type
options['Content-Disposition'] = content_disposition if content_disposition
- 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_stack
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def update_stack(arg1, arg2 = nil, arg3 = nil)
if arg1.kind_of?(Stack)
# Normal use, update_stack(stack, options = {})
stack = arg1
stack_name = stack.stack_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 request
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def request(params)
response = @connection.request(
params.merge(
:headers => {
'Content-Type' => 'application/json',
- 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 list_events
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def list_events(options = {})
if !options.key?(:stack) && !(options.key?(:stack_name) && options.key?(:stack_id))
raise(ArgumentError, "Missing required options keys: :stack or :stack_name and :stack_id, while calling "\
" .list_events(options)")
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_bay
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_bay(_uuid_or_name)
response = Excon::Response.new
response.status = 200
response.body = {
"status" => "CREATE_COMPLETE",
Method get_port
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_port(port_id)
response = Excon::Response.new
if data = self.data[:ports][port_id]
response.status = 200
response.body = {
Method update_ipsec_site_connection
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_ipsec_site_connection(ipsec_site_connection_id, options = {})
response = Excon::Response.new
ipsec_site_connection = list_ipsec_site_connections.body['ipsec_site_connections'].detect do |instance|
instance['id'] == ipsec_site_connection_id
end
Method delete_key_pair
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def delete_key_pair(key_name)
response = Excon::Response.new
response.status = 200
response.headers = {
"X-Compute-Request-Id" => "req-c373a42c-2825-4e60-8d34-99416ea850be",
Method patch_plan
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def patch_plan(_plan_uuid, _parameters)
response = Excon::Response.new
response.status = 201
response.body = {
"created_at" => "2014-09-26T20:23:14.222815",
Method request
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def request(params)
response = @connection.request(
params.merge(
:headers => {
'Content-Type' => 'application/json',
Method request
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def request(params, parse_json = true)
retried = false
begin
authenticate! if @expires && (@expires - Time.now.utc).to_i < 60
Method list_volumes_detailed
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def list_volumes_detailed(_options = {})
response = Excon::Response.new
response.status = 200
data[:volumes] ||= [
{"status" => "available",
Method list_stack_data_detailed
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def list_stack_data_detailed(_options = {})
Excon::Response.new(
:body => {
'stacks' =>
[{"parent" => nil,
Method list_volumes
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def list_volumes(_options = true, _options_deprecated = {})
response = Excon::Response.new
response.status = 200
data[:volumes] ||= [
{"status" => "available",
Method data
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.data
@data ||= Hash.new do |hash, key|
hash[key] = {
:vnfs => [
{
Method list_volumes
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def list_volumes(_options = true, _options_deprecated = {})
response = Excon::Response.new
response.status = 200
data[:volumes] ||= [
{"status" => "available",
Method list_volumes_detailed
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def list_volumes_detailed(_options = {})
response = Excon::Response.new
response.status = 200
data[:volumes] ||= [
{"status" => "available",
Method boot_from_snapshot
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def boot_from_snapshot(name, image_ref, flavor_ref, options = {})
data = {
'server' => {
'flavorRef' => flavor_ref,
'imageRef' => image_ref,
Method list_volumes_detailed
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def list_volumes_detailed(_options = {})
response = Excon::Response.new
response.status = 200
data[:volumes] ||= [
{"status" => "available",
Method list_volumes
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def list_volumes(_options = true, _options_deprecated = {})
response = Excon::Response.new
response.status = 200
data[:volumes] ||= [
{"status" => "available",