Showing 273 of 362 total issues
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 initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(name, default, sql_type = nil, null = true, **)
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 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_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 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_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 links_for_associations
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def links_for_associations
return unless active_scaffold_config.actions.include?(:list) && active_scaffold_config.actions.include?(:nested)
active_scaffold_config.columns.each do |column|
next unless column.link.nil? && column.autolink?
# lazy load of action_link, cause it was really slowing down app in dev mode
- 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 stripe
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
stripe: function(tbody_id) {
var even = false;
var rows = this.records_for(tbody_id);
for (var i = 0; i < rows.length; i++) {
var child = rows[i];
- 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 update_respond_to_js
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def update_respond_to_js
if successful?
record_to_refresh_on_update if !render_parent? && active_scaffold_config.actions.include?(:list)
flash.now[:info] = as_(:updated_model, :model => ERB::Util.h((@updated_record || @record).to_label)) if active_scaffold_config.update.persistent
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 do_update_column
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def do_update_column
# delete from params so update :table won't break urls, also they shouldn't be used in sort links too
value = params.delete(:value)
column = params.delete(:column)
params.delete(:original_html)
- 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_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 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
Method render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def render(*args, &block)
if self.class.uses_active_scaffold? && params[:adapter] && @rendering_adapter.nil? && request.xhr?
@rendering_adapter = true # recursion control
# if we need an adapter, then we render the actual stuff to a string and insert it into the adapter template
opts = args.any? ? args.first : {}
- 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 read_inplace_edit_heading_attributes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
read_inplace_edit_heading_attributes: function(column_heading, options) {
if (column_heading.readAttribute('data-ie-cancel-text')) options.cancelText = column_heading.readAttribute('data-ie-cancel-text');
if (column_heading.readAttribute('data-ie-loading-text')) options.loadingText = column_heading.readAttribute('data-ie-loading-text');
if (column_heading.readAttribute('data-ie-saving-text')) options.savingText = column_heading.readAttribute('data-ie-saving-text');
if (column_heading.readAttribute('data-ie-save-text')) options.okText = column_heading.readAttribute('data-ie-save-text');
- 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 respond_to_action
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def respond_to_action(action)
return unless !conditional_get_support? || view_stale?
respond_to do |type|
action_formats.each do |format|
type.send(format) do
- 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 do_search
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def do_search
if search_params.is_a?(String) && search_params.present?
query = search_params.to_s.strip
columns = active_scaffold_config.search.columns.visible_columns
text_search = active_scaffold_config.search.text_search
- 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 datetime_options
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.datetime_options(locale)
rails_time_format = I18n.translate! 'time.formats.picker', :locale => locale, :default => '%a, %d %b %Y %H:%M:%S'
datetime_picker_options = {
:ampm => false,
:hourText => I18n.translate!('datetime.prompts.hour', :locale => locale),
- 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 replace
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Element.replace = function(element, html) {
element = $(element);
if (element.outerHTML) {
try {
element.outerHTML = html.stripScripts();
- 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"