Showing 74 of 134 total issues
File ec2.rb
has 781 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Awscli
module EC2
require 'pp'
class EC2
Method create_job_flow
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
def create_job_flow(options)
# => BOOTSTRAP ACTIONS
boot_strap_actions = []
if options[:bootstrap_actions]
options[:bootstrap_actions].each do |step|
- 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_instance
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
def create_instance(options)
#validate required options
puts 'Validating Options ...'
abort "Invalid Key: #{options[:key_name]}" unless @conn.key_pairs.get(options[:key_name])
options[:groups].each do |sg|
- 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
File emr.rb
has 423 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Awscli
module Emr
class EMR
def initialize(connection)
@conn = connection
Method delete
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def delete(options)
username = options[:user_name]
user = @conn.users.get(username)
if user
if options[:force]
- 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
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def update(options)
opts = {}
key = {}
attribute_updates = {}
#Build and validate key
- 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
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def create(options)
#validate block device mapping and parse it to a hash understandable by fog
opts = Marshal.load(Marshal.dump(options))
block_device_mapping = Array.new
if options[:block_device_mappings]
- 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
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def put(options)
items = {}
opts = {}
options[:item].each do |item|
abort "invalid item format: #{item}" unless item =~ /(.*):(N|S|NS|SS|B|BS):(.*)/
- 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
File dynamo.rb
has 390 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Awscli
module DynamoDB
class Table
def initialize(connection)
@conn = connection
Method delete
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def delete(options)
key = {}
opts = {}
#Build and validate key
abort 'Invalid --hash-key format' unless options[:hash_key] =~ /(N|S|NS|SS|B|BS):(.*)/
- 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
File iam.rb
has 371 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'json'
module Awscli
module Iam
Method delete_rec
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def delete_rec(dir_name)
#Forked from https://gist.github.com/bdunagan/1383301
data_queue = Queue.new
semaphore = Mutex.new
threads = Array.new
- 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_job_flow
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_job_flow(options)
# => BOOTSTRAP ACTIONS
boot_strap_actions = []
if options[:bootstrap_actions]
options[:bootstrap_actions].each do |step|
Method query
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def query(options)
opts = {}
hash_key_type, hash_key_value = options[:hash_key_value].split(',')
hash_key = { hash_key_type => hash_key_value }
opts['AttributesToGet'] = options[:attrs_to_get] if options[:attrs_to_get]
- 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 query
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def query
unless options[:table_name] and options[:hash_key_value]
abort 'options --table-name and --hash-key-value are required'
end
abort 'invalid --hash-key-value format' unless options[:hash_key_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 scan
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def scan(options)
opts = {}
opts['AttributesToGet'] = options[:attrs_to_get] if options[:attrs_to_get]
opts['Limit'] = options[:limit] if options[:limit]
opts['ConsistentRead'] = options[:consistent_read] if options[:consistent_read]
- 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
Class EMR
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class EMR
def initialize(connection)
@conn = connection
end
Method create_instance
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_instance(options)
#validate required options
puts 'Validating Options ...'
abort "Invalid Key: #{options[:key_name]}" unless @conn.key_pairs.get(options[:key_name])
options[:groups].each do |sg|
Method create
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def create(options)
username = options[:user_name]
@conn.create_user(username, options[:path] ||= '/')
puts "Created User: #{username}"
if options[:password]
- 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
File s3.rb
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Awscli
module S3
require 'thread'
require 'digest/md5'
require 'base64'