Showing 1,291 of 1,823 total issues
Function _regeneratorRuntime
has 299 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _regeneratorRuntime() {
"use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
_regeneratorRuntime = function () {
return e;
};
Class Parameters
has 76 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Parameters
include ActiveSupport::DeepMergeable
cattr_accessor :permit_all_parameters, instance_accessor: false, default: false
File rails-ujs.js
has 623 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
Unobtrusive JavaScript
https://github.com/rails/rails/blob/main/actionview/app/javascript
Released under the MIT license
*/
Class AppBase
has 72 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class AppBase < Base # :nodoc:
include Database
include Devcontainer
include AppName
File rails-ujs.esm.js
has 611 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
Unobtrusive JavaScript
https://github.com/rails/rails/blob/main/actionview/app/javascript
Released under the MIT license
*/
File app_base.rb
has 565 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "fileutils"
require "digest/md5"
require "rails/version" unless defined?(Rails::VERSION)
require "open-uri"
require "tsort"
Function _getDecoratorsApi
has 236 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _getDecoratorsApi() {
_getDecoratorsApi = function () {
return api;
};
var api = {
Method generate
has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring. Open
Open
def generate(owner, methods, location: nil, to: nil, prefix: nil, allow_nil: nil, nilable: true, private: nil, as: nil, signature: nil)
unless to
raise ArgumentError, "Delegation needs a target. Supply a keyword argument 'to' (e.g. delegate :hello, to: :greeter)."
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
File callbacks.rb
has 559 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "active_support/concern"
require "active_support/descendants_tracker"
require "active_support/core_ext/array/extract_options"
require "active_support/core_ext/class/attribute"
require "active_support/core_ext/string/filters"
File cache.rb
has 559 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "zlib"
require "active_support/core_ext/array/extract_options"
require "active_support/core_ext/enumerable"
require "active_support/core_ext/module/attribute_accessors"
require "active_support/core_ext/numeric/bytes"
File strong_parameters.rb
has 556 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "active_support/core_ext/hash/indifferent_access"
require "active_support/core_ext/array/wrap"
require "active_support/core_ext/string/filters"
require "active_support/core_ext/object/to_query"
require "active_support/deep_mergeable"
File schema_definitions.rb
has 539 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module ActiveRecord
module ConnectionAdapters # :nodoc:
# Abstract representation of an index definition on a table. Instances of
# this type are typically created and returned by methods in database
# adapters. e.g. ActiveRecord::ConnectionAdapters::MySQL::SchemaStatements#indexes
Function applyDecs2301Factory
has 214 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function applyDecs2301Factory() {
function createAddInitializerMethod(e, t) {
return function (r) {
!function (e, t) {
if (e.v) throw new Error("attempted to call " + t + " after decoration was finished");
Class Request
has 57 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Request
include Rack::Request::Helpers
include ActionDispatch::Http::Cache::Request
include ActionDispatch::Http::MimeNegotiation
include ActionDispatch::Http::Parameters
File action_cable.js
has 506 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.ActionCable = {}));
})(this, (function(exports) {
"use strict";
File actioncable.js
has 505 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.ActionCable = {}));
})(this, (function(exports) {
"use strict";
Method indexes
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
Open
def indexes(table_name)
indexes = []
current_index = nil
execute_and_free("SHOW KEYS FROM #{quote_table_name(table_name)}", "SCHEMA") do |result|
each_hash(result) do |row|
- 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 actioncable.esm.js
has 485 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var adapters = {
logger: typeof console !== "undefined" ? console : undefined,
WebSocket: typeof WebSocket !== "undefined" ? WebSocket : undefined
};
File persistence.rb
has 484 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "active_record/insert_all"
module ActiveRecord
# = Active Record \Persistence
module Persistence
Method load_defaults
has 188 lines of code (exceeds 25 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