Class Application
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Application
attr_accessor :opts,
:opts_slop,
:args,
Method provided_options
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def provided_options(**opts)
provided_opts = self.opts.clone
provided_opts.delete_if { |k, v| !v }
if opts[:safe]
provided_options.map do |k, v|
- 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 execute!
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def execute!
initialize_key_source
unless command
raise Sym::Errors::InsufficientOptionsError,
" Can not determine what to do
- 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 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(opts, stdin = $stdin, stdout = $stdout, stderr = $stderr, kernel = nil)
Method initialize_key_source
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def initialize_key_source
detect_key_source
if args.require_key? && !self.key
log :error, 'Unable to determine the key, which appears to be required with current args'
raise Sym::Errors::NoPrivateKeyFound, "Private key is required when #{self.action ? "#{self.action.to_s}ypting" : provided_flags.join(', ')}"
- 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"