Class JExcelFile
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class JExcelFile
include RubyPoiTranslations
extend RubyPoiTranslations
Method activate_sheet
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def activate_sheet(term)
if @workbook
x = term.is_a?(String) ? @workbook.getSheetIndex(term.to_java(java.lang.String)) : term
@sheet = worksheet(x)
- 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_worksheet
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create_worksheet( options = {} )
sheet_name = options[:name]
@workbook = HSSFWorkbook.new if @workbook.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
Method write
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def write( file_name = nil )
file = file_name.nil? ? @filepath : file_name
out = FileOutputStream.new(file)
@workbook.write(out) unless @workbook.nil?
out.close
- 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 worksheet
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def worksheet( index )
if @workbook
x = index.is_a?(String) ? @workbook.getSheetIndex(index.to_java(java.lang.String)) : index
return @workbook.getSheetAt(x)
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
TODO found Open
# Currently ignores skip argument - TODO - this is how spreadsheet gem works
- Exclude checks
Replace class var @@maxrows with a class instance var. Open
@@maxrows = 65535
- Read upRead up
- Exclude checks
This cop checks for uses of class variables. Offenses are signaled only on assignment to class variables to reduce the number of offenses that would be reported.