Showing 1,823 of 1,823 total issues

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

      if (this.selectionFrozen) {
        this.composition.thawSelection();
        this.selectionManager.unlock();
        this.selectionFrozen = false;
        return this.render();
Severity: Minor
Found in actiontext/app/assets/javascripts/trix.js and 1 other location - About 55 mins to fix
actiontext/app/assets/javascripts/trix.js on lines 11559..11564

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

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

var isXhrRedirect = function(event) {
  const xhr = event.detail ? event.detail[0] : undefined;
  return xhr && xhr.getResponseHeader("X-Xhr-Redirect");
};
Severity: Minor
Found in actionview/app/assets/javascripts/rails-ujs.esm.js and 1 other location - About 55 mins to fix
actionview/app/assets/javascripts/rails-ujs.js on lines 389..392

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

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

  var isXhrRedirect = function(event) {
    const xhr = event.detail ? event.detail[0] : undefined;
    return xhr && xhr.getResponseHeader("X-Xhr-Redirect");
  };
Severity: Minor
Found in actionview/app/assets/javascripts/rails-ujs.js and 1 other location - About 55 mins to fix
actionview/app/assets/javascripts/rails-ujs.esm.js on lines 436..439

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

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

        start() {
            if (!this.started) {
                this.eventTarget.addEventListener("submit", this.submitCaptured, true);
                this.started = true;
            }
Severity: Minor
Found in guides/assets/javascripts/@hotwired--turbo.js and 1 other location - About 55 mins to fix
guides/assets/javascripts/@hotwired--turbo.js on lines 1136..1141

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

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

        start() {
            if (!this.started) {
                this.eventTarget.addEventListener("click", this.clickCaptured, true);
                this.started = true;
            }
Severity: Minor
Found in guides/assets/javascripts/@hotwired--turbo.js and 1 other location - About 55 mins to fix
guides/assets/javascripts/@hotwired--turbo.js on lines 937..942

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

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

    historyUndo() {
      var _this$delegate16;
      return (_this$delegate16 = this.delegate) === null || _this$delegate16 === void 0 ? void 0 : _this$delegate16.inputControllerWillPerformUndo();
    },
Severity: Minor
Found in actiontext/app/assets/javascripts/trix.js and 1 other location - About 55 mins to fix
actiontext/app/assets/javascripts/trix.js on lines 10822..10825

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

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 asyncGeneratorStep has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
Severity: Major
Found in actiontext/app/assets/javascripts/trix.js - About 50 mins to fix

    Method civil_from_format has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def self.civil_from_format(utc_or_local, year, month = 1, day = 1, hour = 0, min = 0, sec = 0)
    Severity: Major
    Found in activesupport/lib/active_support/core_ext/date_time/conversions.rb - About 50 mins to fix

      Method collection_radio_buttons has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

            def collection_radio_buttons(method, collection, value_method, text_method, options = {}, html_options = {}, &block)
      Severity: Major
      Found in actionview/lib/action_view/helpers/form_options_helper.rb - About 50 mins to fix

        Method collection_select has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

              def collection_select(object, method, collection, value_method, text_method, options = {}, html_options = {})
        Severity: Major
        Found in actionview/lib/action_view/helpers/form_options_helper.rb - About 50 mins to fix

          Method collection_check_boxes has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                def collection_check_boxes(method, collection, value_method, text_method, options = {}, html_options = {}, &block)
          Severity: Major
          Found in actionview/lib/action_view/helpers/form_options_helper.rb - About 50 mins to fix

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

              function getMetaValue(name) {
                const element = findElement(document.head, `meta[name="${name}"]`);
                if (element) {
                  return element.getAttribute("content");
                }
            Severity: Major
            Found in activestorage/app/assets/javascripts/activestorage.js and 4 other locations - About 50 mins to fix
            actiontext/app/assets/javascripts/actiontext.esm.js on lines 461..466
            actiontext/app/assets/javascripts/actiontext.js on lines 460..465
            activestorage/app/assets/javascripts/activestorage.esm.js on lines 461..466
            activestorage/app/javascript/activestorage/helpers.js on lines 1..6

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

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

            export function getMetaValue(name) {
              const element = findElement(document.head, `meta[name="${name}"]`)
              if (element) {
                return element.getAttribute("content")
              }
            Severity: Major
            Found in activestorage/app/javascript/activestorage/helpers.js and 4 other locations - About 50 mins to fix
            actiontext/app/assets/javascripts/actiontext.esm.js on lines 461..466
            actiontext/app/assets/javascripts/actiontext.js on lines 460..465
            activestorage/app/assets/javascripts/activestorage.esm.js on lines 461..466
            activestorage/app/assets/javascripts/activestorage.js on lines 461..466

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

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

            function getMetaValue(name) {
              const element = findElement(document.head, `meta[name="${name}"]`);
              if (element) {
                return element.getAttribute("content");
              }
            Severity: Major
            Found in activestorage/app/assets/javascripts/activestorage.esm.js and 4 other locations - About 50 mins to fix
            actiontext/app/assets/javascripts/actiontext.esm.js on lines 461..466
            actiontext/app/assets/javascripts/actiontext.js on lines 460..465
            activestorage/app/assets/javascripts/activestorage.js on lines 461..466
            activestorage/app/javascript/activestorage/helpers.js on lines 1..6

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

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

              function getMetaValue(name) {
                const element = findElement(document.head, `meta[name="${name}"]`);
                if (element) {
                  return element.getAttribute("content");
                }
            Severity: Major
            Found in actiontext/app/assets/javascripts/actiontext.js and 4 other locations - About 50 mins to fix
            actiontext/app/assets/javascripts/actiontext.esm.js on lines 461..466
            activestorage/app/assets/javascripts/activestorage.esm.js on lines 461..466
            activestorage/app/assets/javascripts/activestorage.js on lines 461..466
            activestorage/app/javascript/activestorage/helpers.js on lines 1..6

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

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

            function getMetaValue(name) {
              const element = findElement(document.head, `meta[name="${name}"]`);
              if (element) {
                return element.getAttribute("content");
              }
            Severity: Major
            Found in actiontext/app/assets/javascripts/actiontext.esm.js and 4 other locations - About 50 mins to fix
            actiontext/app/assets/javascripts/actiontext.js on lines 460..465
            activestorage/app/assets/javascripts/activestorage.esm.js on lines 461..466
            activestorage/app/assets/javascripts/activestorage.js on lines 461..466
            activestorage/app/javascript/activestorage/helpers.js on lines 1..6

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

            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

                  def header(text, header_level)
                    header_with_id = text.scan(/(.*){#(.*)}/)
                    unless header_with_id.empty?
                      %(<h#{header_level} id="#{header_with_id[0][1].strip}">#{header_with_id[0][0].strip}</h#{header_level}>)
                    else
            Severity: Minor
            Found in guides/rails_guides/markdown/renderer.rb and 1 other location - About 50 mins to fix
            guides/rails_guides/markdown/epub_renderer.rb on lines 27..32

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

            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

                  def header(text, header_level)
                    header_with_id = text.scan(/(.*){#(.*)}/)
                    unless header_with_id.empty?
                      %(<h#{header_level} id="#{header_with_id[0][1].strip}">#{header_with_id[0][0].strip}</h#{header_level}>)
                    else
            Severity: Minor
            Found in guides/rails_guides/markdown/epub_renderer.rb and 1 other location - About 50 mins to fix
            guides/rails_guides/markdown/renderer.rb on lines 39..44

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

            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

                    stop() {
                        if (this.started) {
                            this.eventTarget.removeEventListener("submit", this.submitCaptured, true);
                            this.started = false;
                        }
            Severity: Minor
            Found in guides/assets/javascripts/@hotwired--turbo.js and 1 other location - About 50 mins to fix
            guides/assets/javascripts/@hotwired--turbo.js on lines 1142..1147

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

            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

                    stop() {
                        if (this.started) {
                            this.eventTarget.removeEventListener("click", this.clickCaptured, true);
                            this.started = false;
                        }
            Severity: Minor
            Found in guides/assets/javascripts/@hotwired--turbo.js and 1 other location - About 50 mins to fix
            guides/assets/javascripts/@hotwired--turbo.js on lines 943..948

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

            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