Showing 296 of 296 total issues
Function activeScaffoldInit
has 1327 lines of code (exceeds 25 allowed). Consider refactoring. Open
var activeScaffoldInit = function($, undefined) {
jQuery(document).ready(function($) {
/* It should not be needed, latest chrome is caching by itself
if (ActiveScaffold.config.conditional_get) jQuery.ajaxSettings.ifModified = true;
jQuery(document).on('ajax:beforeSend', function(event, xhr, settings){
File active_scaffold.js
has 1336 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function() {
var activeScaffoldInit = function($, undefined) {
jQuery(document).ready(function($) {
/* It should not be needed, latest chrome is caching by itself
if (ActiveScaffold.config.conditional_get) jQuery.ajaxSettings.ifModified = true;
File form_column_helpers.rb
has 689 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveScaffold
module Helpers
# Helpers that assist with the rendering of a Form Column
module FormColumnHelpers
# This method decides which input to use for the given column.
File finder.rb
has 603 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveScaffold
module Finder
def self.like_operator
@@like_operator ||= ::ActiveRecord::Base.connection.adapter_name.in?(%w[PostgreSQL PostGIS]) ? 'ILIKE' : 'LIKE'
end
Class Column
has 70 methods (exceeds 20 allowed). Consider refactoring. Open
class Column
module ProxyableMethods
extend ActiveSupport::Concern
included do # rubocop:disable Metrics/BlockLength
File jquery.editinplace.js
has 543 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
A jQuery edit in place plugin
Version 2.2.0
File column.rb
has 493 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveScaffold::DataStructures
class Column
module ProxyableMethods
extend ActiveSupport::Concern
File core.rb
has 440 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveScaffold::Actions
module Core
def self.included(base)
base.class_eval do
before_action :set_vary_accept_header
Method column_numerical_constraints
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
def column_numerical_constraints(column, options)
validators = column.active_record_class.validators.select do |v|
v.is_a?(ActiveModel::Validations::NumericalityValidator) &&
v.attributes.include?(column.name) &&
!v.options[:if] && !v.options[:unless]
- 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_error_messages_for
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def active_scaffold_error_messages_for(*params)
options = params.extract_options!.symbolize_keys
options.reverse_merge!(container_tag: :div, list_type: :ul)
objects = Array.wrap(options.delete(:object) || params).map do |object|
- 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
File list_column_helpers.rb
has 393 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveScaffold
module Helpers
# Helpers that assist with the rendering of a List Column
module ListColumnHelpers
def list_record_view
File action_link_helpers.rb
has 391 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveScaffold
module Helpers
# All extra helpers that should be included in the View.
# Also a dumping ground for uncategorized helpers.
module ActionLinkHelpers
Method render
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def render(*args, &block)
if args.first.is_a?(Hash) && args.first[:active_scaffold]
render_embedded args.first
elsif args.first == :super
if @lookup_context # rails 6
- 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 format_column_value
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def format_column_value(record, column, value = nil)
value ||= record.send(column.name) unless record.nil?
if column.association.nil?
form_ui_options = column.form_ui_options || column.options if FORM_UI_WITH_OPTIONS.include?(column.form_ui)
if form_ui_options&.dig(:options)
- 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 apply_constraints_to_record
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def apply_constraints_to_record(record, options = {})
options[:allow_autosave] = false if options[:allow_autosave].nil?
constraints = options[:constraints] || active_scaffold_constraints
config = record.is_a?(active_scaffold_config.model) ? active_scaffold_config : active_scaffold_config_for(record.class)
- 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
Class Abstract
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
class Abstract
def initialize(association)
@association = association
end
File search_column_helpers.rb
has 347 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveScaffold
module Helpers
# Helpers that assist with the rendering of a Form Column
module SearchColumnHelpers
# This method decides which input to use for the given column.
Method active_scaffold_render_input
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def active_scaffold_render_input(column, options)
record = options[:object]
# first, check if the dev has created an override for this specific field
if (method = override_form_field(column))
- 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 display_action_links
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def display_action_links(action_links, record, options, &block)
options[:level_0_tag] ||= nil
options[:options_level_0_tag] ||= nil
options[:level] ||= 0
options[:first_action] = true
- 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 pagination_ajax_links
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def pagination_ajax_links(current_page, url_options, options, inner_window, outer_window)
start_number = current_page.number - inner_window
end_number = current_page.number + inner_window
start_number = 1 if start_number <= 0
if current_page.pager.infinite?
- 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"