Showing 5 of 5 total issues
Class Document
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Document
#
# :section: 1. Options
#
Method parse_options
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.parse_options(doc, stdout, arguments)
OptionParser.new do |opts|
opts.banner = <<-BANNER.gsub(/^ /,'')
#{DataDoc::DESCRIPTION}
Method render_body_rows
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def render_body_rows(h)
h.tbody {
@rows.each do |r|
h.tr {
@column_order.each do |col|
- 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 write_in_format
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def write_in_format(html)
html_file = if @format == 'html'
@output_stream || File.new(@output_filename, 'w+')
else
Tempfile.new(['prince','.html'], '.')
- 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_missing
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def method_missing(name, *args, &block)
table_name = name.to_s
if @stores.has_key?(table_name)
if args.empty?
return @stores[table_name].arel
- 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"