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 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 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 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
unexpected token tCOLON
(Using Ruby 2.1 parser; configure using TargetRubyVersion
parameter, under AllCops
) Open
credentials:
- Exclude checks
unexpected token tCOLON
(Using Ruby 2.1 parser; configure using TargetRubyVersion
parameter, under AllCops
) Open
api_key: XXXX
- Exclude checks
unexpected token tCOLON
(Using Ruby 2.1 parser; configure using TargetRubyVersion
parameter, under AllCops
) Open
api_secret: YYYY'.cyan}
- Exclude checks
unexpected token tCOLON
(Using Ruby 2.1 parser; configure using TargetRubyVersion
parameter, under AllCops
) Open
api_secret: YYYY
- Exclude checks
unexpected token tCOLON
(Using Ruby 2.1 parser; configure using TargetRubyVersion
parameter, under AllCops
) Open
api_secret: WWWW'.cyan}
- Exclude checks
unexpected token tCOLON
(Using Ruby 2.1 parser; configure using TargetRubyVersion
parameter, under AllCops
) Open
default_account: true
- Exclude checks
unexpected token tCONSTANT
(Using Ruby 2.1 parser; configure using TargetRubyVersion
parameter, under AllCops
) Open
puts header 'Examples:'
- Exclude checks
unexpected token kIN
(Using Ruby 2.1 parser; configure using TargetRubyVersion
parameter, under AllCops
) Open
Store your credentials in a YAML file #{DnsMadeEasy::Credentials.default_credentials_path(user: ENV['USER']).blue}
- Exclude checks
unexpected token tCOLON
(Using Ruby 2.1 parser; configure using TargetRubyVersion
parameter, under AllCops
) Open
credentials:
- Exclude checks
unexpected $'
(Using Ruby 2.1 parser; configure using
TargetRubyVersionparameter, under
AllCops`) Open
$ dme domain moo.com
- Exclude checks
unexpected token tLABEL
(Using Ruby 2.1 parser; configure using TargetRubyVersion
parameter, under AllCops
) Open
- name: production
- Exclude checks
unexpected token tCOLON
(Using Ruby 2.1 parser; configure using TargetRubyVersion
parameter, under AllCops
) Open
encryption_key: my_key
- Exclude checks
unexpected token tLABEL
(Using Ruby 2.1 parser; configure using TargetRubyVersion
parameter, under AllCops
) Open
- name: development
- Exclude checks