Showing 284 of 371 total issues
File active_scaffold.js
has 1260 lines of code (exceeds 250 allowed). Consider refactoring. Open
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){
xhr.cacheUrl = settings.url;
File active_scaffold.js
has 1094 lines of code (exceeds 250 allowed). Consider refactoring. Open
if (typeof Prototype == 'undefined')
{
warning = "ActiveScaffold Error: Prototype could not be found. Please make sure that your application's layout includes prototype.js (e.g. <%= javascript_include_tag :defaults %>) *before* it includes active_scaffold.js (e.g. <%= active_scaffold_includes %>).";
alert(warning);
}
File form_column_helpers.rb
has 670 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 592 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 67 methods (exceeds 20 allowed). Consider refactoring. Open
class Column
include ActiveScaffold::Configurable
include ActiveScaffold::OrmChecks
NO_PARAMS = Set.new.freeze
NO_OPTIONS = {}.freeze
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 dhtml_history.js
has 476 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
Copyright (c) 2007 Brian Dillard and Brad Neuberg:
Brian Dillard | Project Lead | bdillard@pathf.com | http://blogs.pathf.com/agileajax/
Brad Neuberg | Original Project Creator | http://codinginparadise.org
File column.rb
has 471 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveScaffold::DataStructures
class Column
include ActiveScaffold::Configurable
include ActiveScaffold::OrmChecks
NO_PARAMS = Set.new.freeze
ActiveScaffold
has 51 functions (exceeds 20 allowed). Consider refactoring. Open
var ActiveScaffold = {
last_focus: null,
setup: function(container) {
/* setup some elements on page/form load */
ActiveScaffold.load_embedded(container);
Function in_place_editor_field_clicked
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
in_place_editor_field_clicked: function(span) {
// test editor is open
if (typeof(span.data('editInPlace')) === 'undefined') {
var options = {show_buttons: true,
hover_class: 'hover',
- 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 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
File core.rb
has 414 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 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
ActiveScaffold
has 43 functions (exceeds 20 allowed). Consider refactoring. Open
var ActiveScaffold = {
live_search: function(element) {
$$('form.search.live input[type=search]', element).each(function(item) {
new Form.Element.DelayedObserver(item, 0.5, function(element, value) {
if (!$(element.id)) return false; // because the element may have been destroyed
File list_column_helpers.rb
has 391 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 get_column_value(record, column)
File action_link_helpers.rb
has 377 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
Function create
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
create: function(options) {
/*
options - object to store initialization parameters
options.blankURL - string to override the default location of blank.html. Must end in "?"
- 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 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
Class Abstract
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class Abstract
def initialize(association)
@association = association
end
attr_writer :reverse