Showing 47 of 61 total issues
File theme.rb
has 1462 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'rubyXL/objects/ooxml_object'
require 'rubyXL/objects/extensions'
module RubyXL
# http://www.datypic.com/sc/ooxml/e-a_ext-1.html
Method default
has 317 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.default
default_theme = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme">
<a:themeElements>
<a:clrScheme name="Office">
File worksheet.rb
has 622 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'rubyXL/objects/ooxml_object'
require 'rubyXL/objects/simple_types'
require 'rubyXL/objects/extensions'
require 'rubyXL/objects/relationships'
require 'rubyXL/objects/sheet_common'
File worksheet.rb
has 543 lines of code (exceeds 250 allowed). Consider refactoring. Open
module RubyXL
module WorksheetConvenienceMethods
NAME = 0
SIZE = 1
COLOR = 2
File workbook.rb
has 445 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'date'
require 'rubyXL/objects/ooxml_object'
require 'rubyXL/objects/shared_strings'
require 'rubyXL/objects/stylesheet'
require 'rubyXL/objects/theme'
Method parse
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def parse(node, known_namespaces = nil)
case node
when String, IO, Zip::InputStream then node = Nokogiri::XML.parse(node)
end
- 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_xml
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def write_xml(xml = nil, node_name_override = nil)
if xml.nil? then
seed_xml = Nokogiri::XML('<?xml version = "1.0" standalone ="yes"?>')
seed_xml.encoding = 'UTF-8'
- 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 before_write_xml
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def before_write_xml # This method may need to be moved higher in the hierarchy
first_nonempty_row = nil
last_nonempty_row = 0
first_nonempty_column = nil
last_nonempty_column = 0
- 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 insert_row
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def insert_row(row_index = 0)
validate_workbook
ensure_cell_exists(row_index)
old_row = new_cells = nil
- 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
Class Workbook
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class Workbook < OOXMLTopLevelObject
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml'.freeze
CONTENT_TYPE_TEMPLATE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml'.freeze
CONTENT_TYPE_TEMPLATE_WITH_MACROS = 'application/vnd.ms-excel.template.macroEnabled.main+xml'.freeze
CONTENT_TYPE_WITH_MACROS = 'application/vnd.ms-excel.sheet.macroEnabled.main+xml'.freeze
Method before_write_xml
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def before_write_xml
content_types_by_ext = {}
# Collect all extensions and corresponding content types
root.rels_hash.each_pair { |klass, objects|
- 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
File ooxml_object.rb
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'nokogiri'
require 'pathname'
require 'rubyXL/objects/reference'
module RubyXL
Method add_cell
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def add_cell(row_index = 0, column_index = 0, data = '', formula = nil, overwrite = true)
validate_workbook
validate_nonnegative(row_index)
validate_nonnegative(column_index)
row = sheet_data.rows[row_index] || add_row(row_index)
- 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 load_related_files
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def load_related_files(zipdir_path, base_file_name)
self.related_files = {}
@@debug_indent += 2 if @@debug_indent
- 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
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse(node, known_namespaces = nil)
case node
when String, IO, Zip::InputStream then node = Nokogiri::XML.parse(node)
end
Method delete_cell
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def delete_cell(row_index = 0, column_index=0, shift=nil)
validate_workbook
validate_nonnegative(row_index)
validate_nonnegative(column_index)
- 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 insert_column
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def insert_column(column_index = 0)
validate_workbook
ensure_cell_exists(0, column_index)
old_range = cols.get_range(column_index)
- 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_xml
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def write_xml(xml = nil, node_name_override = nil)
if xml.nil? then
seed_xml = Nokogiri::XML('<?xml version = "1.0" standalone ="yes"?>')
seed_xml.encoding = 'UTF-8'
Method delete_row
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def delete_row(row_index=0)
validate_workbook
validate_nonnegative(row_index)
deleted = sheet_data.rows.delete_at(row_index)
- 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 delete_column
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def delete_column(column_index = 0)
validate_workbook
validate_nonnegative(column_index)
# Delete column
- 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"