Method has too many lines. [59/25] Open
def all_sub_headers(filtered = false)
unless filtered
ce_headers # generate the header structure (see CollectionObject.selected_column_names)
co_headers
bc_headers
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method all_sub_headers
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def all_sub_headers(filtered = false)
unless filtered
ce_headers # generate the header structure (see CollectionObject.selected_column_names)
co_headers
bc_headers
- 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 all_sub_headers
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
def all_sub_headers(filtered = false)
unless filtered
ce_headers # generate the header structure (see CollectionObject.selected_column_names)
co_headers
bc_headers
Method selected_headers
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def selected_headers
retval = []
%w(ce co bc).each { |column|
group = @selected_column_names[column.to_sym]
group.each_key { |type|
- 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 count_info
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def count_info(count)
term = 'Collection object'
if count < 25
if count == 0
retval = "No #{term}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
Do not use instance variables in helpers. Open
unless @selected_column_names[column_type.to_sym][:im].nil?
- Exclude checks
Do not use instance variables in helpers. Open
CollectionObject.ce_attributes(collection_object, @selected_column_names)
- Exclude checks
Do not use instance variables in helpers. Open
@c_o_table_store.set(table_string, @c_o_table_data.to_json)
- Exclude checks
Do not use instance variables in helpers. Open
if @list_collection_objects.any?
- Exclude checks
Do not use instance variables in helpers. Open
page_entries_info(@list_collection_objects)
- Exclude checks
Do not use instance variables in helpers. Open
@c_o_table_store = Redis.new
- Exclude checks
Do not use instance variables in helpers. Open
group = @selected_column_names[column.to_sym]
- Exclude checks
Do not use instance variables in helpers. Open
unless @selected_column_names[column_type.to_sym][:im].keys.empty?
- Exclude checks
Do not use instance variables in helpers. Open
@c_o_table_store = nil
- Exclude checks
Do not use instance variables in helpers. Open
stage = @selected_column_names[col_type.to_sym][sub_type.to_sym][item]
- Exclude checks
Do not use instance variables in helpers. Open
@c_o_table_data.count
- Exclude checks
Do not use instance variables in helpers. Open
items.push(@selected_column_names[column_type.to_sym][:in].keys)
- Exclude checks
Do not use instance variables in helpers. Open
if @list_collection_objects.any?
- Exclude checks
Do not use instance variables in helpers. Open
paginate(@list_collection_objects, remote: true)
- Exclude checks
Do not use instance variables in helpers. Open
CollectionObject.bc_attributes(collection_object, @selected_column_names)
- Exclude checks
Do not use instance variables in helpers. Open
items.push(@selected_column_names[column_type.to_sym][:im].keys) # stuff the headers for the import
- Exclude checks
Do not use instance variables in helpers. Open
@c_o_table_data = {}
- Exclude checks
Do not use instance variables in helpers. Open
} unless @selected_column_names.nil?
- Exclude checks
Do not use instance variables in helpers. Open
@c_o_table_store.ping
- Exclude checks
Do not use instance variables in helpers. Open
@c_o_table_data[c_o.id.to_s] = retval
- Exclude checks
Do not use instance variables in helpers. Open
unless @selected_column_names[column_type.to_sym][:in].nil?
- Exclude checks
Do not use instance variables in helpers. Open
@selected_column_names = CollectionObject.ce_headers(sessions_current_project_id)
- Exclude checks
Do not use instance variables in helpers. Open
@c_o_table_store
- Exclude checks
Do not use instance variables in helpers. Open
unless @c_o_table_store.nil?
- Exclude checks
Do not use instance variables in helpers. Open
@c_o_table_store.set(table_string, @c_o_table_data.to_json)
- Exclude checks
Do not use instance variables in helpers. Open
@selected_column_names = CollectionObject.co_headers(sessions_current_project_id)
- Exclude checks
Do not use instance variables in helpers. Open
CollectionObject.co_attributes(collection_object, @selected_column_names)
- Exclude checks
Do not use instance variables in helpers. Open
@selected_column_names = CollectionObject.bc_headers(sessions_current_project_id)
- Exclude checks