Showing 1,298 of 1,828 total issues

Function _regeneratorRuntime has 299 lines of code (exceeds 25 allowed). Consider refactoring.
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;
    };
Severity: Major
Found in actiontext/app/assets/javascripts/trix.js - About 1 day to fix

    Class Parameters has 76 methods (exceeds 20 allowed). Consider refactoring.
    Open

      class Parameters
        include ActiveSupport::DeepMergeable
    
        cattr_accessor :permit_all_parameters, instance_accessor: false, default: false
    
    
    Severity: Major
    Found in actionpack/lib/action_controller/metal/strong_parameters.rb - About 1 day to fix

      Class AppBase has 76 methods (exceeds 20 allowed). Consider refactoring.
      Open

          class AppBase < Base # :nodoc:
            include AppName
      
            NODE_LTS_VERSION = "20.11.1"
            BUN_VERSION = "1.0.1"
      Severity: Major
      Found in railties/lib/rails/generators/app_base.rb - About 1 day to fix

        File rails-ujs.js has 623 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*
        Unobtrusive JavaScript
        https://github.com/rails/rails/blob/main/actionview/app/javascript
        Released under the MIT license
         */
        Severity: Major
        Found in actionview/app/assets/javascripts/rails-ujs.js - About 1 day to fix

          File rails-ujs.esm.js has 611 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*
          Unobtrusive JavaScript
          https://github.com/rails/rails/blob/main/actionview/app/javascript
          Released under the MIT license
           */
          Severity: Major
          Found in actionview/app/assets/javascripts/rails-ujs.esm.js - About 1 day to fix

            File app_base.rb has 582 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require "fileutils"
            require "digest/md5"
            require "rails/version" unless defined?(Rails::VERSION)
            require "open-uri"
            require "tsort"
            Severity: Major
            Found in railties/lib/rails/generators/app_base.rb - About 1 day to fix

              Function _getDecoratorsApi has 236 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function _getDecoratorsApi() {
                  _getDecoratorsApi = function () {
                    return api;
                  };
                  var api = {
              Severity: Major
              Found in actiontext/app/assets/javascripts/trix.js - About 1 day to fix

                Method generate has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
                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
                
                
                Severity: Minor
                Found in activesupport/lib/active_support/delegation.rb - About 1 day to fix

                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

                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"
                Severity: Major
                Found in activesupport/lib/active_support/callbacks.rb - About 1 day to fix

                  File strong_parameters.rb has 556 lines of code (exceeds 250 allowed). Consider refactoring.
                  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"
                  Severity: Major
                  Found in actionpack/lib/action_controller/metal/strong_parameters.rb - About 1 day to fix

                    File schema_definitions.rb has 539 lines of code (exceeds 250 allowed). Consider refactoring.
                    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

                      File cache.rb has 537 lines of code (exceeds 250 allowed). Consider refactoring.
                      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"
                      Severity: Major
                      Found in activesupport/lib/active_support/cache.rb - About 1 day to fix

                        Function applyDecs2301Factory has 214 lines of code (exceeds 25 allowed). Consider refactoring.
                        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");
                        Severity: Major
                        Found in actiontext/app/assets/javascripts/trix.js - About 1 day to fix

                          Class Request has 57 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                            class Request
                              include Rack::Request::Helpers
                              include ActionDispatch::Http::Cache::Request
                              include ActionDispatch::Http::MimeNegotiation
                              include ActionDispatch::Http::Parameters
                          Severity: Major
                          Found in actionpack/lib/action_dispatch/http/request.rb - About 1 day to fix

                            File action_cable.js has 506 lines of code (exceeds 250 allowed). Consider refactoring.
                            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";
                            Severity: Major
                            Found in actioncable/app/assets/javascripts/action_cable.js - About 1 day to fix

                              File actioncable.js has 505 lines of code (exceeds 250 allowed). Consider refactoring.
                              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";
                              Severity: Major
                              Found in actioncable/app/assets/javascripts/actioncable.js - About 1 day to fix

                                Method indexes has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
                                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|

                                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

                                var adapters = {
                                  logger: typeof console !== "undefined" ? console : undefined,
                                  WebSocket: typeof WebSocket !== "undefined" ? WebSocket : undefined
                                };
                                
                                
                                Severity: Minor
                                Found in actioncable/app/assets/javascripts/actioncable.esm.js - About 7 hrs to fix

                                  Method load_defaults has 190 lines of code (exceeds 25 allowed). Consider refactoring.
                                  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
                                  Severity: Major
                                  Found in railties/lib/rails/application/configuration.rb - About 7 hrs to fix

                                    File transaction.rb has 480 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    require "active_support/core_ext/digest"
                                    
                                    module ActiveRecord
                                      module ConnectionAdapters
                                        # = Active Record Connection Adapters Transaction State
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language