Showing 1,823 of 1,823 total issues

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

    function memberDec(e, t, r, a, n, i, s, o) {
      var c;
      switch (n) {
        case 1:
          c = "accessor";
Severity: Major
Found in actiontext/app/assets/javascripts/trix.js and 1 other location - About 2 days to fix
actiontext/app/assets/javascripts/trix.js on lines 2737..2789

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

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

    function memberDec(e, t, r, n, a, i, s, o) {
      var c;
      switch (a) {
        case 1:
          c = "accessor";
Severity: Major
Found in actiontext/app/assets/javascripts/trix.js and 1 other location - About 2 days to fix
actiontext/app/assets/javascripts/trix.js on lines 2552..2604

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

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 117 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

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

    class SubscriptionGuarantor {
      constructor(subscriptions) {
        this.subscriptions = subscriptions;
        this.pendingSubscriptions = [];
      }
    Severity: Major
    Found in actioncable/app/assets/javascripts/actioncable.esm.js and 2 other locations - About 2 days to fix
    actioncable/app/assets/javascripts/action_cable.js on lines 331..366
    actioncable/app/assets/javascripts/actioncable.js on lines 331..366

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

    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 SubscriptionGuarantor {
        constructor(subscriptions) {
          this.subscriptions = subscriptions;
          this.pendingSubscriptions = [];
        }
    Severity: Major
    Found in actioncable/app/assets/javascripts/action_cable.js and 2 other locations - About 2 days to fix
    actioncable/app/assets/javascripts/actioncable.esm.js on lines 342..377
    actioncable/app/assets/javascripts/actioncable.js on lines 331..366

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

    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 SubscriptionGuarantor {
        constructor(subscriptions) {
          this.subscriptions = subscriptions;
          this.pendingSubscriptions = [];
        }
    Severity: Major
    Found in actioncable/app/assets/javascripts/actioncable.js and 2 other locations - About 2 days to fix
    actioncable/app/assets/javascripts/action_cable.js on lines 331..366
    actioncable/app/assets/javascripts/actioncable.esm.js on lines 342..377

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

    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

    class BlobUpload {
      constructor(blob) {
        this.blob = blob;
        this.file = blob.file;
        const {url: url, headers: headers} = blob.directUploadData;
    Severity: Major
    Found in activestorage/app/assets/javascripts/activestorage.esm.js and 4 other locations - About 2 days to fix
    actiontext/app/assets/javascripts/actiontext.esm.js on lines 576..605
    actiontext/app/assets/javascripts/actiontext.js on lines 569..598
    activestorage/app/assets/javascripts/activestorage.js on lines 570..599
    activestorage/app/javascript/activestorage/blob_upload.js on lines 1..35

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

    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

    class BlobUpload {
      constructor(blob) {
        this.blob = blob;
        this.file = blob.file;
        const {url: url, headers: headers} = blob.directUploadData;
    Severity: Major
    Found in actiontext/app/assets/javascripts/actiontext.esm.js and 4 other locations - About 2 days to fix
    actiontext/app/assets/javascripts/actiontext.js on lines 569..598
    activestorage/app/assets/javascripts/activestorage.esm.js on lines 576..605
    activestorage/app/assets/javascripts/activestorage.js on lines 570..599
    activestorage/app/javascript/activestorage/blob_upload.js on lines 1..35

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

    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 class BlobUpload {
      constructor(blob) {
        this.blob = blob
        this.file = blob.file
    
    
    Severity: Major
    Found in activestorage/app/javascript/activestorage/blob_upload.js and 4 other locations - About 2 days to fix
    actiontext/app/assets/javascripts/actiontext.esm.js on lines 576..605
    actiontext/app/assets/javascripts/actiontext.js on lines 569..598
    activestorage/app/assets/javascripts/activestorage.esm.js on lines 576..605
    activestorage/app/assets/javascripts/activestorage.js on lines 570..599

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

    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

      class BlobUpload {
        constructor(blob) {
          this.blob = blob;
          this.file = blob.file;
          const {url: url, headers: headers} = blob.directUploadData;
    Severity: Major
    Found in actiontext/app/assets/javascripts/actiontext.js and 4 other locations - About 2 days to fix
    actiontext/app/assets/javascripts/actiontext.esm.js on lines 576..605
    activestorage/app/assets/javascripts/activestorage.esm.js on lines 576..605
    activestorage/app/assets/javascripts/activestorage.js on lines 570..599
    activestorage/app/javascript/activestorage/blob_upload.js on lines 1..35

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

    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

      class BlobUpload {
        constructor(blob) {
          this.blob = blob;
          this.file = blob.file;
          const {url: url, headers: headers} = blob.directUploadData;
    Severity: Major
    Found in activestorage/app/assets/javascripts/activestorage.js and 4 other locations - About 2 days to fix
    actiontext/app/assets/javascripts/actiontext.esm.js on lines 576..605
    actiontext/app/assets/javascripts/actiontext.js on lines 569..598
    activestorage/app/assets/javascripts/activestorage.esm.js on lines 576..605
    activestorage/app/javascript/activestorage/blob_upload.js on lines 1..35

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

    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 actiontext.js has 862 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 857 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 851 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 reflection.rb has 845 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require "active_support/core_ext/string/filters"
          
          module ActiveRecord
            # = Active Record Reflection
            module Reflection # :nodoc:
          Severity: Major
          Found in activerecord/lib/active_record/reflection.rb - About 2 days to fix

            File activestorage.js has 829 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

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

              const serializeElement = (element, additionalParam) => {
                let inputs = [ element ];
                if (matches(element, "form")) {
                  inputs = toArray(element.elements);
                }
              Severity: Major
              Found in actionview/app/assets/javascripts/rails-ujs.esm.js and 1 other location - About 1 day to fix
              actionview/app/assets/javascripts/rails-ujs.js on lines 228..267

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

              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 serializeElement = (element, additionalParam) => {
                  let inputs = [ element ];
                  if (matches(element, "form")) {
                    inputs = toArray(element.elements);
                  }
              Severity: Major
              Found in actionview/app/assets/javascripts/rails-ujs.js and 1 other location - About 1 day to fix
              actionview/app/assets/javascripts/rails-ujs.esm.js on lines 261..300

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

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

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

                class DirectUploadsController {
                  constructor(form) {
                    this.form = form;
                    this.inputs = findElements(form, inputSelector).filter((input => input.files.length));
                  }
                Severity: Major
                Found in actiontext/app/assets/javascripts/actiontext.esm.js and 4 other locations - About 1 day to fix
                actiontext/app/assets/javascripts/actiontext.js on lines 702..743
                activestorage/app/assets/javascripts/activestorage.esm.js on lines 715..756
                activestorage/app/assets/javascripts/activestorage.js on lines 703..744
                activestorage/app/javascript/activestorage/direct_uploads_controller.js on lines 6..50

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

                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

                Severity
                Category
                Status
                Source
                Language