Showing 61 of 614 total issues
Method generate_formatter
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate_formatter(format)
# FIXME: numbers can be other colors besides red:
# [BLACK], [BLUE], [CYAN], [GREEN], [MAGENTA], [RED], [WHITE], [YELLOW], [COLOR n]
case format
when /^General$/i then '%.0f'
Method extract_html_r
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def extract_html_r(r_elem)
str = +""
xml_elems = {
sub: false,
sup: false,
Method initialize
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(filename_or_stream, options = {})
packed = options[:packed]
file_warning = options.fetch(:file_warning, :error)
cell_max = options.delete(:cell_max)
sheet_options = {}
Method extract_html_r
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def extract_html_r(r_elem)
str = +""
xml_elems = {
sub: false,
sup: false,
- 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 create_cell_from_value
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def create_cell_from_value(value_type, cell, formula, format, style, hyperlink, coordinate)
# NOTE: format.to_s can replace excelx_type as an argument for
# Cell::Time, Cell::DateTime, Cell::Date or Cell::Number, but
# it will break some brittle tests.
excelx_type = [:numeric_or_formula, format.to_s]
- 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 _to_type
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _to_type(format)
format = format.to_s.downcase
if (type = EXCEPTIONAL_FORMATS[format])
type
elsif format.include?('#')
- 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 decrypt
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def decrypt(content_entry, cipher)
# Zip::Entry.extract writes a 0-length file when trying
# to extract an encrypted stream, so we read the
# raw bytes based on the offset and lengths
decrypted = ''
- 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 set_cell_values
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def set_cell_values(sheet, x, y, i, v, value_type, formula, table_cell, str_v, style_name)
Method initialize
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(value, type, formula, excelx_type, excelx_value, style, hyperlink, base_date, coordinate)
Method extract_shared_strings
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def extract_shared_strings
return [] unless doc_exists?
document = fix_invalid_shared_strings(doc)
# read the shared strings xml document
- 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_zipfile_entries
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process_zipfile_entries(entries)
# NOTE: When Google or Numbers 3.1 exports to xlsx, the worksheet filenames
# are not in order. With Numbers 3.1, the first sheet is always
# sheet.xml, not sheet1.xml. With Google, the order of the worksheets is
# independent of a worksheet's filename (i.e. sheet6.xml can be the
Method initialize
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def initialize(filename, options = {})
packed = options[:packed]
file_warning = options[:file_warning] || :error
@only_visible_sheets = options[:only_visible_sheets]
- 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 read_table_styles
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def read_table_styles(styles)
styles.children.each do |style|
next unless style.name == 'style'
style_name = attribute(style, 'name')
style.children.each do |properties|
- 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 decrypt_if_necessary
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def decrypt_if_necessary(
zip_file,
content_entry,
roo_content_xml_path, options
)
- 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 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(value, formula, excelx_type, style, link, base_date, coordinate)
Method create_cell_from_value
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_cell_from_value(value_type, cell, formula, format, style, hyperlink, coordinate)
Method initialize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(value, formula, excelx_type, style, link, base_date, coordinate)
Method initialize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(value, formula, excelx_type, style, link, base_timestamp, coordinate)
Method each_row
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def each_row(options = {}, &block)
row_count = 0
options[:offset] ||= 0
@sheet.each_row_streaming do |row|
break if options[:max_rows] && row_count == options[:max_rows] + options[:offset] + 1
- 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 cell_from_xml
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def cell_from_xml(cell_xml, hyperlink, coordinate, empty_cell=true)
coordinate ||= ::Roo::Utils.extract_coordinate(cell_xml["r"])
cell_xml_children = cell_xml.children
return create_empty_cell(coordinate, empty_cell) if cell_xml_children.empty?
- 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"