Showing 1,452 of 1,452 total issues

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

})(this, (function(exports) {
  "use strict";
  var sparkMd5 = {
    exports: {}
  };
Severity: Major
Found in activestorage/app/assets/javascripts/activestorage.js and 1 other location - About 2 mos to fix
actiontext/app/assets/javascripts/actiontext.js on lines 8..838

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 11613.

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

})(commonjsGlobal, (function(exports) {
  var sparkMd5 = {
    exports: {}
  };
  (function(module, exports) {
Severity: Major
Found in actiontext/app/assets/javascripts/actiontext.js and 1 other location - About 2 mos to fix
activestorage/app/assets/javascripts/activestorage.js on lines 4..835

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 11613.

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

Function trix has 5257 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var trix = createCommonjsModule(function(module) {
  (function() {
  }).call(commonjsGlobal), function() {
    var t;
    window.Set == null && (window.Set = t = function() {
Severity: Major
Found in actiontext/app/assets/javascripts/trix.js - About 3 wks to fix

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

    /*
    Trix 1.3.1
    Copyright © 2020 Basecamp, LLC
    http://trix-editor.org/
     */
    Severity: Major
    Found in actiontext/app/assets/javascripts/trix.js - About 2 wks to fix

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

        class ConnectionMonitor {
          constructor(connection) {
            this.visibilityDidChange = this.visibilityDidChange.bind(this);
            this.connection = connection;
            this.reconnectAttempts = 0;
      Severity: Major
      Found in actioncable/app/assets/javascripts/action_cable.js and 2 other locations - About 5 days to fix
      actioncable/app/assets/javascripts/actioncable.esm.js on lines 19..109
      actioncable/app/assets/javascripts/actioncable.js on lines 20..110

      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 933.

      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 3 locations. Consider refactoring.
      Open

      class ConnectionMonitor {
        constructor(connection) {
          this.visibilityDidChange = this.visibilityDidChange.bind(this);
          this.connection = connection;
          this.reconnectAttempts = 0;
      Severity: Major
      Found in actioncable/app/assets/javascripts/actioncable.esm.js and 2 other locations - About 5 days to fix
      actioncable/app/assets/javascripts/action_cable.js on lines 20..110
      actioncable/app/assets/javascripts/actioncable.js on lines 20..110

      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 933.

      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 3 locations. Consider refactoring.
      Open

        class ConnectionMonitor {
          constructor(connection) {
            this.visibilityDidChange = this.visibilityDidChange.bind(this);
            this.connection = connection;
            this.reconnectAttempts = 0;
      Severity: Major
      Found in actioncable/app/assets/javascripts/actioncable.js and 2 other locations - About 5 days to fix
      actioncable/app/assets/javascripts/action_cable.js on lines 20..110
      actioncable/app/assets/javascripts/actioncable.esm.js on lines 19..109

      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 933.

      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 3 locations. Consider refactoring.
      Open

      class Connection {
        constructor(consumer) {
          this.open = this.open.bind(this);
          this.consumer = consumer;
          this.subscriptions = this.consumer.subscriptions;
      Severity: Major
      Found in actioncable/app/assets/javascripts/actioncable.esm.js and 2 other locations - About 5 days to fix
      actioncable/app/assets/javascripts/action_cable.js on lines 132..226
      actioncable/app/assets/javascripts/actioncable.js on lines 132..226

      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 876.

      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 3 locations. Consider refactoring.
      Open

        class Connection {
          constructor(consumer) {
            this.open = this.open.bind(this);
            this.consumer = consumer;
            this.subscriptions = this.consumer.subscriptions;
      Severity: Major
      Found in actioncable/app/assets/javascripts/action_cable.js and 2 other locations - About 5 days to fix
      actioncable/app/assets/javascripts/actioncable.esm.js on lines 138..232
      actioncable/app/assets/javascripts/actioncable.js on lines 132..226

      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 876.

      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 3 locations. Consider refactoring.
      Open

        class Connection {
          constructor(consumer) {
            this.open = this.open.bind(this);
            this.consumer = consumer;
            this.subscriptions = this.consumer.subscriptions;
      Severity: Major
      Found in actioncable/app/assets/javascripts/actioncable.js and 2 other locations - About 5 days to fix
      actioncable/app/assets/javascripts/action_cable.js on lines 132..226
      actioncable/app/assets/javascripts/actioncable.esm.js on lines 138..232

      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 876.

      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 3 locations. Consider refactoring.
      Open

        class Subscriptions {
          constructor(consumer) {
            this.consumer = consumer;
            this.guarantor = new SubscriptionGuarantor(this);
            this.subscriptions = [];
      Severity: Major
      Found in actioncable/app/assets/javascripts/actioncable.js and 2 other locations - About 4 days to fix
      actioncable/app/assets/javascripts/action_cable.js on lines 350..424
      actioncable/app/assets/javascripts/actioncable.esm.js on lines 362..436

      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 732.

      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 3 locations. Consider refactoring.
      Open

        class Subscriptions {
          constructor(consumer) {
            this.consumer = consumer;
            this.guarantor = new SubscriptionGuarantor(this);
            this.subscriptions = [];
      Severity: Major
      Found in actioncable/app/assets/javascripts/action_cable.js and 2 other locations - About 4 days to fix
      actioncable/app/assets/javascripts/actioncable.esm.js on lines 362..436
      actioncable/app/assets/javascripts/actioncable.js on lines 350..424

      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 732.

      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 3 locations. Consider refactoring.
      Open

      class Subscriptions {
        constructor(consumer) {
          this.consumer = consumer;
          this.guarantor = new SubscriptionGuarantor(this);
          this.subscriptions = [];
      Severity: Major
      Found in actioncable/app/assets/javascripts/actioncable.esm.js and 2 other locations - About 4 days to fix
      actioncable/app/assets/javascripts/action_cable.js on lines 350..424
      actioncable/app/assets/javascripts/actioncable.js on lines 350..424

      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 732.

      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 mapper.rb has 1149 lines of code (exceeds 250 allowed). Consider refactoring.
      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"
      Severity: Major
      Found in actionpack/lib/action_dispatch/routing/mapper.rb - About 2 days to fix

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

          Connection.prototype.events = {
            message(event) {
              if (!this.isProtocolSupported()) {
                return;
              }
        Severity: Major
        Found in actioncable/app/assets/javascripts/actioncable.js and 3 other locations - About 2 days to fix
        actioncable/app/assets/javascripts/action_cable.js on lines 228..283
        actioncable/app/assets/javascripts/actioncable.esm.js on lines 236..291
        actioncable/app/javascript/action_cable/connection.js on lines 121..164

        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 474.

        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 4 locations. Consider refactoring.
        Open

          Connection.prototype.events = {
            message(event) {
              if (!this.isProtocolSupported()) {
                return;
              }
        Severity: Major
        Found in actioncable/app/assets/javascripts/action_cable.js and 3 other locations - About 2 days to fix
        actioncable/app/assets/javascripts/actioncable.esm.js on lines 236..291
        actioncable/app/assets/javascripts/actioncable.js on lines 228..283
        actioncable/app/javascript/action_cable/connection.js on lines 121..164

        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 474.

        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 4 locations. Consider refactoring.
        Open

        Connection.prototype.events = {
          message(event) {
            if (!this.isProtocolSupported()) {
              return;
            }
        Severity: Major
        Found in actioncable/app/assets/javascripts/actioncable.esm.js and 3 other locations - About 2 days to fix
        actioncable/app/assets/javascripts/action_cable.js on lines 228..283
        actioncable/app/assets/javascripts/actioncable.js on lines 228..283
        actioncable/app/javascript/action_cable/connection.js on lines 121..164

        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 474.

        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 4 locations. Consider refactoring.
        Open

        Connection.prototype.events = {
          message(event) {
            if (!this.isProtocolSupported()) { return }
            const {identifier, message, reason, reconnect, type} = JSON.parse(event.data)
            switch (type) {
        Severity: Major
        Found in actioncable/app/javascript/action_cable/connection.js and 3 other locations - About 2 days to fix
        actioncable/app/assets/javascripts/action_cable.js on lines 228..283
        actioncable/app/assets/javascripts/actioncable.esm.js on lines 236..291
        actioncable/app/assets/javascripts/actioncable.js on lines 228..283

        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 474.

        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 ToSql has 113 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 886 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
          
          var activestorage = {exports: {}};
          
          (function (module, exports) {
          Severity: Major
          Found in actiontext/app/assets/javascripts/actiontext.js - About 2 days to fix
            Severity
            Category
            Status
            Source
            Language