twbs/bootstrap

View on GitHub

Showing 569 of 569 total issues

File carousel.js has 481 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * --------------------------------------------------------------------------
 * Bootstrap (v4.3.1): carousel.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * --------------------------------------------------------------------------
Severity: Minor
Found in js/src/carousel.js - About 7 hrs to fix

    File modal.js has 463 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * --------------------------------------------------------------------------
     * Bootstrap (v4.3.1): modal.js
     * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
     * --------------------------------------------------------------------------
    Severity: Minor
    Found in js/src/modal.js - About 7 hrs to fix

      Function ScrollSpy has 176 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function () {
          function ScrollSpy(element, config) {
            var _this = this;
      
            this._element = element;
      Severity: Major
      Found in js/dist/scrollspy.js - About 7 hrs to fix

        File collapse.js has 456 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*!
          * Bootstrap collapse.js v4.3.1 (https://getbootstrap.com/)
          * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
          * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
          */
        Severity: Minor
        Found in js/dist/collapse.js - About 6 hrs to fix

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

            var getTransitionDurationFromElement = function getTransitionDurationFromElement(element) {
              if (!element) {
                return 0;
              } // Get transition-duration of the element
          
          
          Severity: Major
          Found in js/dist/tab.js and 6 other locations - About 6 hrs to fix
          js/dist/alert.js on lines 57..78
          js/dist/carousel.js on lines 111..132
          js/dist/collapse.js on lines 121..142
          js/dist/modal.js on lines 111..132
          js/dist/toast.js on lines 94..115
          js/dist/tooltip.js on lines 111..132

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

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

            var getTransitionDurationFromElement = function getTransitionDurationFromElement(element) {
              if (!element) {
                return 0;
              } // Get transition-duration of the element
          
          
          Severity: Major
          Found in js/dist/modal.js and 6 other locations - About 6 hrs to fix
          js/dist/alert.js on lines 57..78
          js/dist/carousel.js on lines 111..132
          js/dist/collapse.js on lines 121..142
          js/dist/tab.js on lines 57..78
          js/dist/toast.js on lines 94..115
          js/dist/tooltip.js on lines 111..132

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

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

            var getTransitionDurationFromElement = function getTransitionDurationFromElement(element) {
              if (!element) {
                return 0;
              } // Get transition-duration of the element
          
          
          Severity: Major
          Found in js/dist/carousel.js and 6 other locations - About 6 hrs to fix
          js/dist/alert.js on lines 57..78
          js/dist/collapse.js on lines 121..142
          js/dist/modal.js on lines 111..132
          js/dist/tab.js on lines 57..78
          js/dist/toast.js on lines 94..115
          js/dist/tooltip.js on lines 111..132

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

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

            var getTransitionDurationFromElement = function getTransitionDurationFromElement(element) {
              if (!element) {
                return 0;
              } // Get transition-duration of the element
          
          
          Severity: Major
          Found in js/dist/collapse.js and 6 other locations - About 6 hrs to fix
          js/dist/alert.js on lines 57..78
          js/dist/carousel.js on lines 111..132
          js/dist/modal.js on lines 111..132
          js/dist/tab.js on lines 57..78
          js/dist/toast.js on lines 94..115
          js/dist/tooltip.js on lines 111..132

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

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

            var getTransitionDurationFromElement = function getTransitionDurationFromElement(element) {
              if (!element) {
                return 0;
              } // Get transition-duration of the element
          
          
          Severity: Major
          Found in js/dist/toast.js and 6 other locations - About 6 hrs to fix
          js/dist/alert.js on lines 57..78
          js/dist/carousel.js on lines 111..132
          js/dist/collapse.js on lines 121..142
          js/dist/modal.js on lines 111..132
          js/dist/tab.js on lines 57..78
          js/dist/tooltip.js on lines 111..132

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

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

            var getTransitionDurationFromElement = function getTransitionDurationFromElement(element) {
              if (!element) {
                return 0;
              } // Get transition-duration of the element
          
          
          Severity: Major
          Found in js/dist/alert.js and 6 other locations - About 6 hrs to fix
          js/dist/carousel.js on lines 111..132
          js/dist/collapse.js on lines 121..142
          js/dist/modal.js on lines 111..132
          js/dist/tab.js on lines 57..78
          js/dist/toast.js on lines 94..115
          js/dist/tooltip.js on lines 111..132

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

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

            var getTransitionDurationFromElement = function getTransitionDurationFromElement(element) {
              if (!element) {
                return 0;
              } // Get transition-duration of the element
          
          
          Severity: Major
          Found in js/dist/tooltip.js and 6 other locations - About 6 hrs to fix
          js/dist/alert.js on lines 57..78
          js/dist/carousel.js on lines 111..132
          js/dist/collapse.js on lines 121..142
          js/dist/modal.js on lines 111..132
          js/dist/tab.js on lines 57..78
          js/dist/toast.js on lines 94..115

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

          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

              _proto.setContent = function setContent() {
                var tip = this.getTipElement(); // we use append for html objects to maintain js events
          
                this.setElementContent(SelectorEngine.findOne(Selector.TITLE, tip), this.getTitle());
          
          
          Severity: Major
          Found in js/dist/popover.js and 1 other location - About 6 hrs to fix
          js/src/popover.js on lines 108..122

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

          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

            setContent() {
              const tip = this.getTipElement()
          
              // we use append for html objects to maintain js events
              this.setElementContent(SelectorEngine.findOne(Selector.TITLE, tip), this.getTitle())
          Severity: Major
          Found in js/src/popover.js and 1 other location - About 6 hrs to fix
          js/dist/popover.js on lines 171..185

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

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

            var typeCheckConfig = function typeCheckConfig(componentName, config, configTypes) {
              Object.keys(configTypes).forEach(function (property) {
                var expectedTypes = configTypes[property];
                var value = config[property];
                var valueType = value && isElement(value) ? 'element' : toType(value);
          Severity: Major
          Found in js/dist/modal.js and 6 other locations - About 6 hrs to fix
          js/dist/carousel.js on lines 162..172
          js/dist/collapse.js on lines 172..182
          js/dist/dropdown.js on lines 114..124
          js/dist/scrollspy.js on lines 133..143
          js/dist/toast.js on lines 145..155
          js/dist/tooltip.js on lines 162..172

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

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

            var typeCheckConfig = function typeCheckConfig(componentName, config, configTypes) {
              Object.keys(configTypes).forEach(function (property) {
                var expectedTypes = configTypes[property];
                var value = config[property];
                var valueType = value && isElement(value) ? 'element' : toType(value);
          Severity: Major
          Found in js/dist/tooltip.js and 6 other locations - About 6 hrs to fix
          js/dist/carousel.js on lines 162..172
          js/dist/collapse.js on lines 172..182
          js/dist/dropdown.js on lines 114..124
          js/dist/modal.js on lines 162..172
          js/dist/scrollspy.js on lines 133..143
          js/dist/toast.js on lines 145..155

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

          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

              function Tooltip(element, config) {
                if (typeof Popper === 'undefined') {
                  throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org)');
                } // private
          
          
          Severity: Major
          Found in js/dist/tooltip.js and 1 other location - About 6 hrs to fix
          js/src/tooltip.js on lines 133..152

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

          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

            constructor(element, config) {
              if (typeof Popper === 'undefined') {
                throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org)')
              }
          
          
          Severity: Major
          Found in js/src/tooltip.js and 1 other location - About 6 hrs to fix
          js/dist/tooltip.js on lines 435..454

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

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

            var typeCheckConfig = function typeCheckConfig(componentName, config, configTypes) {
              Object.keys(configTypes).forEach(function (property) {
                var expectedTypes = configTypes[property];
                var value = config[property];
                var valueType = value && isElement(value) ? 'element' : toType(value);
          Severity: Major
          Found in js/dist/dropdown.js and 6 other locations - About 6 hrs to fix
          js/dist/carousel.js on lines 162..172
          js/dist/collapse.js on lines 172..182
          js/dist/modal.js on lines 162..172
          js/dist/scrollspy.js on lines 133..143
          js/dist/toast.js on lines 145..155
          js/dist/tooltip.js on lines 162..172

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

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

            var typeCheckConfig = function typeCheckConfig(componentName, config, configTypes) {
              Object.keys(configTypes).forEach(function (property) {
                var expectedTypes = configTypes[property];
                var value = config[property];
                var valueType = value && isElement(value) ? 'element' : toType(value);
          Severity: Major
          Found in js/dist/collapse.js and 6 other locations - About 6 hrs to fix
          js/dist/carousel.js on lines 162..172
          js/dist/dropdown.js on lines 114..124
          js/dist/modal.js on lines 162..172
          js/dist/scrollspy.js on lines 133..143
          js/dist/toast.js on lines 145..155
          js/dist/tooltip.js on lines 162..172

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

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

            var typeCheckConfig = function typeCheckConfig(componentName, config, configTypes) {
              Object.keys(configTypes).forEach(function (property) {
                var expectedTypes = configTypes[property];
                var value = config[property];
                var valueType = value && isElement(value) ? 'element' : toType(value);
          Severity: Major
          Found in js/dist/scrollspy.js and 6 other locations - About 6 hrs to fix
          js/dist/carousel.js on lines 162..172
          js/dist/collapse.js on lines 172..182
          js/dist/dropdown.js on lines 114..124
          js/dist/modal.js on lines 162..172
          js/dist/toast.js on lines 145..155
          js/dist/tooltip.js on lines 162..172

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

          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