twbs/bootstrap

View on GitHub

Showing 92 of 92 total issues

File bootstrap.js has 1751 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * Bootstrap v3.4.1 (https://getbootstrap.com/)
 * Copyright 2011-2019 Twitter, Inc.
 * Licensed under the MIT license
 */
Severity: Major
Found in docs/dist/js/bootstrap.js - About 4 days to fix

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

    +function ($) {
      'use strict';
    
      // ALERT CLASS DEFINITION
      // ======================
    Severity: Major
    Found in docs/dist/js/bootstrap.js and 1 other location - About 3 days to fix
    js/alert.js on lines 10..95

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

    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 ($) {
      'use strict';
    
      // ALERT CLASS DEFINITION
      // ======================
    Severity: Major
    Found in js/alert.js and 1 other location - About 3 days to fix
    docs/dist/js/bootstrap.js on lines 88..173

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

    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 ($) {
      'use strict';
    
      // CSS TRANSITION SUPPORT (Shoutout: https://modernizr.com/)
      // ============================================================
    Severity: Major
    Found in docs/dist/js/bootstrap.js and 1 other location - About 2 days to fix
    js/transition.js on lines 10..59

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

    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 ($) {
      'use strict';
    
      // CSS TRANSITION SUPPORT (Shoutout: https://modernizr.com/)
      // ============================================================
    Severity: Major
    Found in js/transition.js and 1 other location - About 2 days to fix
    docs/dist/js/bootstrap.js on lines 28..77

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

    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 exports has 355 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function (grunt) {
      'use strict';
    
      // Force use of Unix newlines
      grunt.util.linefeed = '\n';
    Severity: Major
    Found in Gruntfile.js - About 1 day to fix

      Function onload has 311 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      window.onload = function () { // wait for load in a dumb way because B-0
        'use strict';
      
        var cw = '/*!\n' +
                 ' * Bootstrap v3.4.1 (https://getbootstrap.com/)\n' +
      Severity: Major
      Found in docs/assets/js/src/customizer.js - About 1 day to fix

        Function onload has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
        Open

        window.onload = function () { // wait for load in a dumb way because B-0
          'use strict';
        
          var cw = '/*!\n' +
                   ' * Bootstrap v3.4.1 (https://getbootstrap.com/)\n' +
        Severity: Minor
        Found in docs/assets/js/src/customizer.js - About 1 day to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        File tooltip.js has 497 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /* ========================================================================
         * Bootstrap: tooltip.js v3.4.1
         * https://getbootstrap.com/docs/3.4/javascript/#tooltip
         * Inspired by the original jQuery.tipsy by Jason Frame
         * ========================================================================
        Severity: Minor
        Found in js/tooltip.js - About 7 hrs to fix

          File Gruntfile.js has 358 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*!
           * Bootstrap's Gruntfile
           * https://getbootstrap.com/
           * Copyright 2013-2019 Twitter, Inc.
           * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
          Severity: Minor
          Found in Gruntfile.js - About 4 hrs to fix

            File customizer.js has 314 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*!
             * Bootstrap Customizer (https://getbootstrap.com/customize/)
             * Copyright 2011-2019 Twitter, Inc.
             *
             * Licensed under the Creative Commons Attribution 3.0 Unported License. For
            Severity: Minor
            Found in docs/assets/js/src/customizer.js - About 3 hrs to fix

              Function exports has 63 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              module.exports = function (config) {
                var conf = {
                  basePath: '../',
                  frameworks: ['qunit'],
                  plugins: ['karma-qunit'],
              Severity: Major
              Found in grunt/karma.conf.js - About 2 hrs to fix

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

                /* ========================================================================
                 * Bootstrap: modal.js v3.4.1
                 * https://getbootstrap.com/docs/3.4/javascript/#modals
                 * ========================================================================
                 * Copyright 2011-2019 Twitter, Inc.
                Severity: Minor
                Found in js/modal.js - About 2 hrs to fix

                  Function show has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    Tooltip.prototype.show = function () {
                      var e = $.Event('show.bs.' + this.type)
                  
                      if (this.hasContent() && this.enabled) {
                        this.$element.trigger(e)
                  Severity: Major
                  Found in docs/dist/js/bootstrap.js - About 2 hrs to fix

                    Function show has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      Tooltip.prototype.show = function () {
                        var e = $.Event('show.bs.' + this.type)
                    
                        if (this.hasContent() && this.enabled) {
                          this.$element.trigger(e)
                    Severity: Major
                    Found in js/tooltip.js - About 2 hrs to fix

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

                          $('#less-variables-section input')
                            .each(function () {
                              $(this).val() && (vars[$(this).prev().text()] = $(this).val())
                            })
                      Severity: Major
                      Found in docs/assets/js/src/customizer.js and 1 other location - About 2 hrs to fix
                      docs/assets/js/src/customizer.js on lines 240..243

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

                      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

                          $('#less-variables-section input')
                            .each(function () {
                              $(this).val() && (vars[$(this).prev().text()] = $(this).val())
                            })
                      Severity: Major
                      Found in docs/assets/js/src/customizer.js and 1 other location - About 2 hrs to fix
                      docs/assets/js/src/customizer.js on lines 48..51

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

                      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 slide has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        Carousel.prototype.slide = function (type, next) {
                          var $active   = this.$element.find('.item.active')
                          var $next     = next || this.getItemForDirection(type, $active)
                          var isCycling = this.interval
                          var direction = type == 'next' ? 'left' : 'right'
                      Severity: Minor
                      Found in js/carousel.js - About 1 hr to fix

                        Function slide has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          Carousel.prototype.slide = function (type, next) {
                            var $active   = this.$element.find('.item.active')
                            var $next     = next || this.getItemForDirection(type, $active)
                            var isCycling = this.interval
                            var direction = type == 'next' ? 'left' : 'right'
                        Severity: Minor
                        Found in docs/dist/js/bootstrap.js - About 1 hr to fix

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

                              for (var i = 0, len = dependencies.length; i < len; i++) {
                                var $dependency = $('[value="' + dependencies[i] + '"]')
                                $dependency && $dependency.prop('checked', true)
                              }
                          Severity: Major
                          Found in docs/assets/js/src/customizer.js and 1 other location - About 1 hr to fix
                          docs/assets/js/src/customizer.js on lines 373..376

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

                          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