Showing 1,279 of 1,807 total issues

File trix.js has 11910 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
Trix 2.1.8
Copyright © 2024 37signals, LLC
 */
(function (global, factory) {
Severity: Major
Found in actiontext/app/assets/javascripts/trix.js - About 1 mo to fix

    File @hotwired--turbo.js has 3850 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
    Turbo 7.2.5
    Copyright © 2023 37signals LLC
     */
    (function (global, factory) {
    Severity: Major
    Found in guides/assets/javascripts/@hotwired--turbo.js - About 1 wk to fix

      File query_methods.rb has 1062 lines of code (exceeds 250 allowed). Consider refactoring.
      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"
      
      
      Severity: Major
      Found in activerecord/lib/active_record/relation/query_methods.rb - About 2 days to fix

        Class ToSql has 118 methods (exceeds 20 allowed). Consider refactoring.
        Open

            class ToSql < Arel::Visitors::Visitor
              def initialize(connection)
                super()
                @connection = connection
              end
        Severity: Major
        Found in activerecord/lib/arel/visitors/to_sql.rb - About 2 days to fix

          File actiontext.js has 884 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          (function(factory) {
            typeof define === "function" && define.amd ? define(factory) : factory();
          })((function() {
            "use strict";
            var sparkMd5 = {
          Severity: Major
          Found in actiontext/app/assets/javascripts/actiontext.js - About 2 days to fix

            File actiontext.esm.js has 879 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            var sparkMd5 = {
              exports: {}
            };
            
            (function(module, exports) {
            Severity: Major
            Found in actiontext/app/assets/javascripts/actiontext.esm.js - About 2 days to fix

              File to_sql.rb has 854 lines of code (exceeds 250 allowed). Consider refactoring.
              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."
              Severity: Major
              Found in activerecord/lib/arel/visitors/to_sql.rb - About 2 days to fix

                File activestorage.js has 830 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.ActiveStorage = {}));
                })(this, (function(exports) {
                  "use strict";
                Severity: Major
                Found in activestorage/app/assets/javascripts/activestorage.js - About 1 day to fix

                  File schema_statements.rb has 827 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  module ActiveRecord
                    module ConnectionAdapters
                      module PostgreSQL
                        module SchemaStatements
                          # Drops the database specified on the +name+ attribute

                    File activestorage.esm.js has 817 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    var sparkMd5 = {
                      exports: {}
                    };
                    
                    (function(module, exports) {
                    Severity: Major
                    Found in activestorage/app/assets/javascripts/activestorage.esm.js - About 1 day to fix

                      Method load_defaults has a Cognitive Complexity of 94 (exceeds 5 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: Minor
                      Found in railties/lib/rails/application/configuration.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 abstract_mysql_adapter.rb has 764 lines of code (exceeds 250 allowed). Consider refactoring.
                      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 752 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        require "active_support/core_ext/string/access"
                        require "openssl"
                        
                        module ActiveRecord
                          module ConnectionAdapters # :nodoc:

                          Class AbstractMysqlAdapter has 91 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                              class AbstractMysqlAdapter < AbstractAdapter
                                include MySQL::DatabaseStatements
                                include MySQL::Quoting
                                include MySQL::SchemaStatements
                          
                          

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

                              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 AppBase has 77 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

                                  Method store_nested_param has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                        def store_nested_param(params, name, v, depth, encoding_template = nil)
                                          raise ParamsTooDeepError if depth >= param_depth_limit
                                  
                                          if !name
                                            # nil name, treat same as empty string (required by tests)
                                  Severity: Minor
                                  Found in actionpack/lib/action_dispatch/http/param_builder.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 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
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language