Showing 16 of 53 total issues
Class Client
has 51 methods (exceeds 20 allowed). Consider refactoring. Open
class Client
class << self
def public_operations
(new('a', 'b').methods - Object.methods).map(&:to_s).reject { |r| r =~ /[=]$|^(api_|on_|request)/ }.sort
end
File client.rb
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'time'
require 'openssl'
require 'json'
require 'uri'
require 'net/http'
Method print_help_message
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def print_help_message
print_usage_message
puts <<~EOF
#{header 'Credentials'}
Method credentials_from_array
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def credentials_from_array(accounts, account_name = nil)
account = if account_name
accounts.find { |a| a.name == account_name }
elsif accounts.size == 1
accounts.first
- 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_httpred_record
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_httpred_record(domain_name, name, value, redirectType = 'STANDARD - 302', description = '', keywords = '', title = '', options = {})
Method keys
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def keys(account: nil, encryption_key: nil)
return nil unless exist?
return nil if mash.nil?
creds = if mash.accounts.is_a?(Array)
- 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 print_formatted
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def print_formatted(result, format = nil)
if format
if format.to_sym == :json_pretty
puts JSON.pretty_generate(result)
elsif format.to_sym == :pp
- 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_srv_record
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_srv_record(domain_name, name, priority, weight, port, value, options = {})
Method update_record
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_record(domain, record_id, name, type, value, options = {})
Method create_record
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_record(domain_name, name, type, value, options = {})
Method create_mx_record
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_mx_record(domain_name, name, priority, value, options = {})
Method configure_authentication
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def configure_authentication
credentials_file = ENV['DNSMADEEASY_CREDENTIALS_FILE'] ||
DnsMadeEasy::Credentials.default_credentials_path(user: Etc.getlogin)
if ENV['DNSMADEEASY_API_KEY'] && ENV['DNSMADEEASY_API_SECRET']
- 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 process_flags_format
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def process_flags_format
if argv.first =~ /^op(erations)?$/i
print_supported_operations
elsif argv.include?('--help') || argv.include?('-h')
- 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 process_response!
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def process_response!(response)
response.value # raise Net::HTTPServerException unless response was 2xx
process_rate_limits(response)
unparsed_json = response.body.to_s.empty? ? '{}' : response.body
Hashie::Mash.new(JSON.parse(unparsed_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 method_signature
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def method_signature(e, method)
file, line, call_method = e.backtrace.first.split(':')
call_method = call_method.gsub(/[']/, '').split('`').last
if call_method && call_method.to_sym == method.to_sym
source_line = File.open(file).to_a[line.to_i - 1].chomp!
- 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 initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize(api_key, api_secret, sandbox = false, options = {})
fail 'api_key is undefined' unless api_key
fail 'api_secret is undefined' unless api_secret
@api_key = api_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"