Showing 4 of 4 total issues
Method parser
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def parser
OptionParser.new(nil, 35) do |opts|
opts.separator 'OPTIONS:'.bold.yellow
opts.on('-c', '--config [file]',
Method resolve_templates!
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
def resolve_templates!
self.templates ||= []
options.names.each_pair do |name, indexes|
if config.templates[name]
template_array = config.templates[name].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 parse_args!
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def parse_args!
pre_parse!
if options.indexes
override = {}
- 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
Open
def initialize(argv, stdin = STDIN, stdout = STDOUT, stderr = STDERR, kernel = Kernel)