Showing 1,397 of 1,894 total issues
File trix.js
has 10471 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
Trix 2.0.4
Copyright © 2022 37signals, LLC
*/
var name = "trix";
File @hotwired--turbo.js
has 3850 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
Turbo 7.2.5
Copyright © 2023 37signals LLC
*/
(function (global, factory) {
File mapper.rb
has 1159 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "active_support/core_ext/hash/slice"
require "active_support/core_ext/enumerable"
require "active_support/core_ext/array/extract_options"
require "active_support/core_ext/regexp"
require "action_dispatch/routing/redirection"
Class AbstractAdapter
has 144 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class AbstractAdapter
ADAPTER_NAME = "Abstract"
include ActiveSupport::Callbacks
define_callbacks :checkout, :checkin
File query_methods.rb
has 932 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "active_record/relation/from_clause"
require "active_record/relation/query_attribute"
require "active_record/relation/where_clause"
require "active_support/core_ext/array/wrap"
Class ToSql
has 116 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class ToSql < Arel::Visitors::Visitor
def initialize(connection)
super()
@connection = connection
end
File actiontext.js
has 855 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var sparkMd5 = {
exports: {}
};
(function(module, exports) {
File migration.rb
has 847 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "benchmark"
require "set"
require "zlib"
require "active_support/core_ext/array/access"
require "active_support/core_ext/enumerable"
File to_sql.rb
has 843 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module Arel # :nodoc: all
module Visitors
class UnsupportedVisitError < StandardError
def initialize(object)
super "Unsupported argument type: #{object.class.name}. Construct an Arel node instead."
File activestorage.js
has 829 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
(function(global, factory) {
typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define([ "exports" ], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self,
factory(global.ActiveStorage = {}));
})(this, (function(exports) {
"use strict";
File activestorage.esm.js
has 817 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var sparkMd5 = {
exports: {}
};
(function(module, exports) {
File abstract_adapter.rb
has 811 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "set"
require "active_record/connection_adapters/sql_type_metadata"
require "active_record/connection_adapters/abstract/schema_dumper"
require "active_record/connection_adapters/abstract/schema_creation"
require "active_support/concurrency/null_lock"
File schema_statements.rb
has 779 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module ActiveRecord
module ConnectionAdapters
module PostgreSQL
module SchemaStatements
# Drops the database specified on the +name+ attribute
Class AbstractMysqlAdapter
has 91 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class AbstractMysqlAdapter < AbstractAdapter
include MySQL::DatabaseStatements
include MySQL::Quoting
include MySQL::SchemaStatements
File reflection.rb
has 734 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "active_support/core_ext/string/filters"
module ActiveRecord
# = Active Record Reflection
module Reflection # :nodoc:
File abstract_mysql_adapter.rb
has 720 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "active_record/connection_adapters/abstract_adapter"
require "active_record/connection_adapters/statement_pool"
require "active_record/connection_adapters/mysql/column"
require "active_record/connection_adapters/mysql/database_statements"
require "active_record/connection_adapters/mysql/explain_pretty_printer"
File schema_statements.rb
has 714 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "active_support/core_ext/string/access"
require "openssl"
module ActiveRecord
module ConnectionAdapters # :nodoc:
Class Mapper
has 85 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Mapper
URL_OPTIONS = [:protocol, :subdomain, :domain, :host, :port]
cattr_accessor :route_source_locations, instance_accessor: false, default: false
cattr_accessor :backtrace_cleaner, instance_accessor: false, default: ActiveSupport::BacktraceCleaner.new
Method load_defaults
has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring. Open
Open
def load_defaults(target_version)
# To introduce a change in behavior, follow these steps:
# 1. Add an accessor on the target object (e.g. the ActiveJob class for
# global Active Job config).
# 2. Set a default value there preserving existing behavior for existing
- 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 route_set.rb
has 690 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "action_dispatch/journey"
require "active_support/core_ext/object/to_query"
require "active_support/core_ext/module/redefine_method"
require "active_support/core_ext/module/remove_method"
require "active_support/core_ext/array/extract_options"