twbs/bootstrap

View on GitHub

Showing 56 of 93 total issues

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

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

    Function exports has 406 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 2 days to fix

      Function onload has 362 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.0 (http://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 55 (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.0 (http://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 Gruntfile.js has 409 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

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

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

          /* ========================================================================
           * Bootstrap: tooltip.js v3.4.0
           * http://getbootstrap.com/javascript/#tooltip
           * Inspired by the original jQuery.tipsy by Jason Frame
           * ========================================================================
          Severity: Minor
          Found in js/tooltip.js - About 5 hrs to fix

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

            /*!
             * Bootstrap Customizer (http://getbootstrap.com/customize/)
             * Copyright 2011-2016 Twitter, Inc.
             *
             * Licensed under the Creative Commons Attribution 3.0 Unported License. For
            Severity: Minor
            Found in docs/assets/js/src/customizer.js - About 4 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

                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

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

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

                          Modal.prototype.show = function (_relatedTarget) {
                            var that = this
                            var e    = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
                        
                            this.$element.trigger(e)
                        Severity: Minor
                        Found in js/modal.js - About 1 hr to fix

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

                            Modal.prototype.show = function (_relatedTarget) {
                              var that = this
                              var e    = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
                          
                              this.$element.trigger(e)
                          Severity: Minor
                          Found in docs/dist/js/bootstrap.js - About 1 hr to fix

                            Function backdrop has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              Modal.prototype.backdrop = function (callback) {
                                var that = this
                                var animate = this.$element.hasClass('fade') ? 'fade' : ''
                            
                                if (this.isShown && this.options.backdrop) {
                            Severity: Minor
                            Found in docs/dist/js/bootstrap.js - About 1 hr to fix

                              Function backdrop has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                Modal.prototype.backdrop = function (callback) {
                                  var that = this
                                  var animate = this.$element.hasClass('fade') ? 'fade' : ''
                              
                                  if (this.isShown && this.options.backdrop) {
                              Severity: Minor
                              Found in js/modal.js - About 1 hr to fix

                                Function activate has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  Tab.prototype.activate = function (element, container, callback) {
                                    var $active    = container.find('> .active')
                                    var transition = callback
                                      && $.support.transition
                                      && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length)
                                Severity: Minor
                                Found in js/tab.js - About 1 hr to fix

                                  Function activate has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    Tab.prototype.activate = function (element, container, callback) {
                                      var $active    = container.find('> .active')
                                      var transition = callback
                                        && $.support.transition
                                        && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length)
                                  Severity: Minor
                                  Found in docs/dist/js/bootstrap.js - About 1 hr to fix

                                    Function _shift has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    Tokenizer.prototype._shift = function () {
                                      // returning null signals EOF
                                      // returning undefined means the line was ignored
                                      if (this._next !== undefined) {
                                        var result = this._next;
                                    Severity: Minor
                                    Found in grunt/bs-lessdoc-parser.js - About 1 hr to fix

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

                                        Collapse.prototype.show = function () {
                                          if (this.transitioning || this.$element.hasClass('in')) return
                                      
                                          var activesData
                                          var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
                                      Severity: Minor
                                      Found in docs/dist/js/bootstrap.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language