Showing 272 of 361 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 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 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 find_template
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def find_template(name, prefixes = [], partial = false, keys = [], options = {})
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(name, default, sql_type = nil, null = true, **)
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 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 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)
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"
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
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 parent_sti_controller
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def parent_sti_controller
return unless params[:parent_sti]
unless defined? @parent_sti_controller
controller = look_for_parent_sti_controller
@parent_sti_controller = controller.controller_path == params[:parent_sti] ? controller : false
- 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 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
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 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 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 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
Method update_view_paths
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def update_view_paths
last_view_path =
if @lookup_context # rails 6
File.expand_path(File.dirname(File.dirname(@lookup_context.last_template.short_identifier.to_s)), Rails.root)
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 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"