Showing 1,823 of 1,823 total issues

Class Blob has 43 methods (exceeds 20 allowed). Consider refactoring.
Open

class ActiveStorage::Blob < ActiveStorage::Record
  MINIMUM_TOKEN_LENGTH = 28

  has_secure_token :key, length: MINIMUM_TOKEN_LENGTH
  store :metadata, accessors: [ :analyzed, :identified, :composed ], coder: ActiveRecord::Coders::JSON
Severity: Minor
Found in activestorage/app/models/active_storage/blob.rb - About 5 hrs to fix

    Class AssociationReflection has 43 methods (exceeds 20 allowed). Consider refactoring.
    Open

        class AssociationReflection < MacroReflection # :nodoc:
          def compute_class(name)
            if polymorphic?
              raise ArgumentError, "Polymorphic associations do not support computing the class."
            end
    Severity: Minor
    Found in activerecord/lib/active_record/reflection.rb - About 5 hrs to fix

      Class Association has 43 methods (exceeds 20 allowed). Consider refactoring.
      Open

          class Association # :nodoc:
            attr_accessor :owner
            attr_reader :target, :reflection, :disable_joins
      
            delegate :options, to: :reflection
      Severity: Minor
      Found in activerecord/lib/active_record/associations/association.rb - About 5 hrs to fix

        Class PluginGenerator has 43 methods (exceeds 20 allowed). Consider refactoring.
        Open

            class PluginGenerator < AppBase # :nodoc:
              add_shared_options_for "plugin"
        
              alias_method :plugin_path, :app_path
        
        
        Severity: Minor
        Found in railties/lib/rails/generators/rails/plugin/plugin_generator.rb - About 5 hrs to fix

          Similar blocks of code found in 5 locations. Consider refactoring.
          Open

          function dispatchEvent(element, type, eventInit = {}) {
            const {disabled: disabled} = element;
            const {bubbles: bubbles, cancelable: cancelable, detail: detail} = eventInit;
            const event = document.createEvent("Event");
            event.initEvent(type, bubbles || true, cancelable || true);
          Severity: Major
          Found in actiontext/app/assets/javascripts/actiontext.esm.js and 4 other locations - About 5 hrs to fix
          actiontext/app/assets/javascripts/actiontext.js on lines 481..494
          activestorage/app/assets/javascripts/activestorage.esm.js on lines 485..498
          activestorage/app/assets/javascripts/activestorage.js on lines 482..495
          activestorage/app/javascript/activestorage/helpers.js on lines 25..41

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 150.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 5 locations. Consider refactoring.
          Open

          function dispatchEvent(element, type, eventInit = {}) {
            const {disabled: disabled} = element;
            const {bubbles: bubbles, cancelable: cancelable, detail: detail} = eventInit;
            const event = document.createEvent("Event");
            event.initEvent(type, bubbles || true, cancelable || true);
          Severity: Major
          Found in activestorage/app/assets/javascripts/activestorage.esm.js and 4 other locations - About 5 hrs to fix
          actiontext/app/assets/javascripts/actiontext.esm.js on lines 485..498
          actiontext/app/assets/javascripts/actiontext.js on lines 481..494
          activestorage/app/assets/javascripts/activestorage.js on lines 482..495
          activestorage/app/javascript/activestorage/helpers.js on lines 25..41

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 150.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 5 locations. Consider refactoring.
          Open

          export function dispatchEvent(element, type, eventInit = {}) {
            const { disabled } = element
            const { bubbles, cancelable, detail } = eventInit
            const event = document.createEvent("Event")
          
          
          Severity: Major
          Found in activestorage/app/javascript/activestorage/helpers.js and 4 other locations - About 5 hrs to fix
          actiontext/app/assets/javascripts/actiontext.esm.js on lines 485..498
          actiontext/app/assets/javascripts/actiontext.js on lines 481..494
          activestorage/app/assets/javascripts/activestorage.esm.js on lines 485..498
          activestorage/app/assets/javascripts/activestorage.js on lines 482..495

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 150.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 5 locations. Consider refactoring.
          Open

            function dispatchEvent(element, type, eventInit = {}) {
              const {disabled: disabled} = element;
              const {bubbles: bubbles, cancelable: cancelable, detail: detail} = eventInit;
              const event = document.createEvent("Event");
              event.initEvent(type, bubbles || true, cancelable || true);
          Severity: Major
          Found in activestorage/app/assets/javascripts/activestorage.js and 4 other locations - About 5 hrs to fix
          actiontext/app/assets/javascripts/actiontext.esm.js on lines 485..498
          actiontext/app/assets/javascripts/actiontext.js on lines 481..494
          activestorage/app/assets/javascripts/activestorage.esm.js on lines 485..498
          activestorage/app/javascript/activestorage/helpers.js on lines 25..41

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 150.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 5 locations. Consider refactoring.
          Open

            function dispatchEvent(element, type, eventInit = {}) {
              const {disabled: disabled} = element;
              const {bubbles: bubbles, cancelable: cancelable, detail: detail} = eventInit;
              const event = document.createEvent("Event");
              event.initEvent(type, bubbles || true, cancelable || true);
          Severity: Major
          Found in actiontext/app/assets/javascripts/actiontext.js and 4 other locations - About 5 hrs to fix
          actiontext/app/assets/javascripts/actiontext.esm.js on lines 485..498
          activestorage/app/assets/javascripts/activestorage.esm.js on lines 485..498
          activestorage/app/assets/javascripts/activestorage.js on lines 482..495
          activestorage/app/javascript/activestorage/helpers.js on lines 25..41

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 150.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          const preventInsignificantClick = function(e) {
            const link = this;
            const method = (link.getAttribute("data-method") || "GET").toUpperCase();
            const data = link.getAttribute("data-params");
            const metaClick = e.metaKey || e.ctrlKey;
          Severity: Major
          Found in actionview/app/assets/javascripts/rails-ujs.esm.js and 1 other location - About 5 hrs to fix
          actionview/app/assets/javascripts/rails-ujs.js on lines 510..520

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 149.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

            const preventInsignificantClick = function(e) {
              const link = this;
              const method = (link.getAttribute("data-method") || "GET").toUpperCase();
              const data = link.getAttribute("data-params");
              const metaClick = e.metaKey || e.ctrlKey;
          Severity: Major
          Found in actionview/app/assets/javascripts/rails-ujs.js and 1 other location - About 5 hrs to fix
          actionview/app/assets/javascripts/rails-ujs.esm.js on lines 562..572

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 149.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          File application.rb has 397 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require "yaml"
          require "active_support/core_ext/hash/keys"
          require "active_support/core_ext/object/blank"
          require "active_support/key_generator"
          require "active_support/message_verifiers"
          Severity: Minor
          Found in railties/lib/rails/application.rb - About 5 hrs to fix

            Class Dot has 41 methods (exceeds 20 allowed). Consider refactoring.
            Open

                class Dot < Arel::Visitors::Visitor
                  class Node # :nodoc:
                    attr_accessor :name, :id, :fields
            
                    def initialize(name, id, fields = [])
            Severity: Minor
            Found in activerecord/lib/arel/visitors/dot.rb - About 5 hrs to fix

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                const enableElement = e => {
                  let element;
                  if (e instanceof Event) {
                    if (isXhrRedirect(e)) {
                      return;
              Severity: Major
              Found in actionview/app/assets/javascripts/rails-ujs.js and 1 other location - About 5 hrs to fix
              actionview/app/assets/javascripts/rails-ujs.esm.js on lines 341..361

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 143.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

              const enableElement = e => {
                let element;
                if (e instanceof Event) {
                  if (isXhrRedirect(e)) {
                    return;
              Severity: Major
              Found in actionview/app/assets/javascripts/rails-ujs.esm.js and 1 other location - About 5 hrs to fix
              actionview/app/assets/javascripts/rails-ujs.js on lines 302..322

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 143.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Class ExceptionWrapper has 40 methods (exceeds 20 allowed). Consider refactoring.
              Open

                class ExceptionWrapper
                  cattr_accessor :rescue_responses, default: Hash.new(:internal_server_error).merge!(
                    "ActionController::RoutingError"                     => :not_found,
                    "AbstractController::ActionNotFound"                 => :not_found,
                    "ActionController::MethodNotAllowed"                 => :method_not_allowed,
              Severity: Minor
              Found in actionpack/lib/action_dispatch/middleware/exception_wrapper.rb - About 5 hrs to fix

                Function md5cycle has 133 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function md5cycle(x, k) {
                      var a = x[0], b = x[1], c = x[2], d = x[3];
                      a += (b & c | ~b & d) + k[0] - 680876936 | 0;
                      a = (a << 7 | a >>> 25) + b | 0;
                      d += (a & b | ~a & c) + k[1] - 389564586 | 0;
                Severity: Major
                Found in actiontext/app/assets/javascripts/actiontext.esm.js - About 5 hrs to fix

                  Function md5cycle has 133 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function md5cycle(x, k) {
                        var a = x[0], b = x[1], c = x[2], d = x[3];
                        a += (b & c | ~b & d) + k[0] - 680876936 | 0;
                        a = (a << 7 | a >>> 25) + b | 0;
                        d += (a & b | ~a & c) + k[1] - 389564586 | 0;
                  Severity: Major
                  Found in activestorage/app/assets/javascripts/activestorage.esm.js - About 5 hrs to fix

                    Function md5cycle has 133 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          function md5cycle(x, k) {
                            var a = x[0], b = x[1], c = x[2], d = x[3];
                            a += (b & c | ~b & d) + k[0] - 680876936 | 0;
                            a = (a << 7 | a >>> 25) + b | 0;
                            d += (a & b | ~a & c) + k[1] - 389564586 | 0;
                    Severity: Major
                    Found in activestorage/app/assets/javascripts/activestorage.js - About 5 hrs to fix

                      Function md5cycle has 133 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                            function md5cycle(x, k) {
                              var a = x[0], b = x[1], c = x[2], d = x[3];
                              a += (b & c | ~b & d) + k[0] - 680876936 | 0;
                              a = (a << 7 | a >>> 25) + b | 0;
                              d += (a & b | ~a & c) + k[1] - 389564586 | 0;
                      Severity: Major
                      Found in actiontext/app/assets/javascripts/actiontext.js - About 5 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language