Method parse_header_footer
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def parse_header_footer(options)
r = []
unless options.blank?
%i[header footer].collect do |hf|
next if options[hf].blank?
- 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_others
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_others(options)
r = []
unless options.blank?
r += make_options(options, %i[proxy
username
Method parse_toc
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_toc(options)
return [] if options.nil?
r = [valid_option('toc')]
unless options.blank?
Method make_options
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def make_options(options, names, prefix = '', type = :string)
return [] if options.nil?
names.collect do |o|
if options[o].blank?
- 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 make_option
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def make_option(name, value, type = :string)
return value.collect { |v| make_option(name, v, type) } if value.is_a?(Array)
if type == :name_value
parts = value.to_s.split(' ')
- 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"