Showing 276 of 365 total issues
Method active_scaffold_refresh_link
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def active_scaffold_refresh_link(column, html_options, record, ui_options = {})
link_options = {:object => record}
if html_options['data-update_url']
link_options['data-update_send_form'] = html_options['data-update_send_form']
link_options['data-update_send_form_selector'] = html_options['data-update_send_form_selector']
- 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 cache_association_options
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def cache_association_options(association, conditions, klass, cache = true)
if active_scaffold_config.cache_association_options && cache
@_associations_cache ||= Hash.new { |h, k| h[k] = {} }
key = [association.name, association.inverse_klass.name, klass.respond_to?(:cache_key) ? klass.cache_key : klass.name].join('/')
@_associations_cache[key][conditions] ||= yield
- 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 active_scaffold_file_with_remove_link
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def active_scaffold_file_with_remove_link(column, options, content, remove_file_prefix, controls_class, ui_options: column.options, &block) # rubocop:disable Metrics/ParameterLists
Method setup_association_info
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def setup_association_info
assoc = active_record_class.reflect_on_association(name)
@association =
if assoc
if active_record?
- 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 reverse_association
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def reverse_association(klass = nil)
assoc =
if polymorphic?
get_reverse(klass) unless klass.nil?
else
- 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_group
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def delete_group(name)
@set.each do |group|
next unless group.is_a?(ActiveScaffold::DataStructures::ActionLinks)
if group.name == name
@set.delete group
- 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
Avoid deeply nested control flow statements. Open
if reverse&.singular? && !reverse.belongs_to? && options[:allow_autosave]
record.send(k).send("#{reverse.name}=", record)
end
Method add_association_columns
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_association_columns(association, *columns)
column = self[association]
raise ArgumentError, "unknown column #{association}" if column.nil?
raise ArgumentError, "column #{association} is not an association" if column.association.nil?
raise ArgumentError, "column #{association} is not singular association" unless column.association.singular?
- 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 usa_state_select
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def usa_state_select(object, method, priority_states = nil, options = {}, html_options = {})
Method active_scaffold_record_select
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def active_scaffold_record_select(record, column, options, value, multiple, ui_options: column.options)
Method find_template
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def find_template(name, prefixes = [], partial = false, keys = [], options = {})
Method pagination_ajax_links
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def pagination_ajax_links(current_page, url_options, options, inner_window, outer_window)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(name, default, sql_type = nil, null = true, **)
Method active_scaffold_file_with_content
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def active_scaffold_file_with_content(column, content, options, remove_file_prefix, controls_class)
Method active_scaffold_checkbox_option
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def active_scaffold_checkbox_option(option, label_method, associated_ids, checkbox_options, li_options = {})
Method form_attribute
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def form_attribute(column, record, scope = nil, only_value = false, col_class = nil)
Method active_scaffold_input_chosen
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def active_scaffold_input_chosen(column, html_options, ui_options: column.options)
html_options[:class] << ' chosen'
if column.association&.collection?
record = html_options.delete(:object)
associated_options, select_options = active_scaffold_plural_association_options(column, record)
- 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 each
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def each(options = {}, &block)
super(options) do |item|
item = __wrap__(item) || item unless item.is_a?(ActiveScaffold::DataStructures::ActionLinks)
if options[:include_set]
yield item, __getobj__.instance_variable_get(:@set)
- 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_outer_joins_for_search
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def set_outer_joins_for_search(columns) # rubocop:disable Naming/AccessorMethodName
references = []
outer_joins = []
columns.each do |column|
next if column.search_joins.blank?
- 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
Function create_associated_record_form
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
create_associated_record_form: function(element, content, options) {
var element = $(element);
if (options.singular == false) {
if (!(options.id && $(options.id))) {
element.insert(content);
- 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"