twbs/bootstrap

View on GitHub

Showing 56 of 123 total issues

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 js/collapse.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

      Function generateCSS has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function generateCSS(preamble) {
          var promise = $.Deferred()
          var oneChecked = false
          var lessFileIncludes = {}
          $('#less-section input').each(function () {
      Severity: Minor
      Found in docs/assets/js/src/customizer.js - About 1 hr to fix

        Function applyPlacement has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          Tooltip.prototype.applyPlacement = function (offset, placement) {
            var $tip   = this.tip()
            var width  = $tip[0].offsetWidth
            var height = $tip[0].offsetHeight
        
        
        Severity: Minor
        Found in docs/dist/js/bootstrap.js - About 1 hr to fix

          Function applyPlacement has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            Tooltip.prototype.applyPlacement = function (offset, placement) {
              var $tip   = this.tip()
              var width  = $tip[0].offsetWidth
              var height = $tip[0].offsetHeight
          
          
          Severity: Minor
          Found in js/tooltip.js - About 1 hr to fix

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

              Tab.prototype.show = function () {
                var $this    = this.element
                var $ul      = $this.closest('ul:not(.dropdown-menu)')
                var selector = $this.data('target')
            
            
            Severity: Minor
            Found in docs/dist/js/bootstrap.js - About 1 hr to fix

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

                Tab.prototype.show = function () {
                  var $this    = this.element
                  var $ul      = $this.closest('ul:not(.dropdown-menu)')
                  var selector = $this.data('target')
              
              
              Severity: Minor
              Found in js/tab.js - About 1 hr to fix

                Function checkPosition has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  Affix.prototype.checkPosition = function () {
                    if (!this.$element.is(':visible')) return
                
                    var height       = this.$element.height()
                    var offset       = this.options.offset
                Severity: Minor
                Found in docs/dist/js/bootstrap.js - About 1 hr to fix

                  Function checkPosition has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    Affix.prototype.checkPosition = function () {
                      if (!this.$element.is(':visible')) return
                  
                      var height       = this.$element.height()
                      var offset       = this.options.offset
                  Severity: Minor
                  Found in js/affix.js - About 1 hr to fix

                    Function exports has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                    module.exports = function (config) {
                      var conf = {
                        basePath: '../',
                        frameworks: ['qunit'],
                        plugins: ['karma-qunit'],
                    Severity: Minor
                    Found in grunt/karma.conf.js - About 1 hr 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

                    Function walkAsync has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function walkAsync(directory, excludedDirectories, fileCallback, errback) {
                      if (excludedDirectories.has(path.parse(directory).base)) {
                        return;
                      }
                      fs.readdir(directory, function (err, names) {
                    Severity: Minor
                    Found in grunt/change-version.js - About 1 hr to fix

                      Function main has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function main(args) {
                        if (args.length !== 2) {
                          console.error('USAGE: change-version old_version new_version');
                          console.error('Got arguments:', args);
                          process.exit(1);
                      Severity: Minor
                      Found in grunt/change-version.js - About 1 hr to fix

                        Function refresh has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          ScrollSpy.prototype.refresh = function () {
                            var that          = this
                            var offsetMethod  = 'offset'
                            var offsetBase    = 0
                        
                        
                        Severity: Minor
                        Found in js/scrollspy.js - About 1 hr to fix

                          Function refresh has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            ScrollSpy.prototype.refresh = function () {
                              var that          = this
                              var offsetMethod  = 'offset'
                              var offsetBase    = 0
                          
                          
                          Severity: Minor
                          Found in docs/dist/js/bootstrap.js - About 1 hr to fix

                            Function hide has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              Collapse.prototype.hide = function () {
                                if (this.transitioning || !this.$element.hasClass('in')) return
                            
                                var startEvent = $.Event('hide.bs.collapse')
                                this.$element.trigger(startEvent)
                            Severity: Minor
                            Found in docs/dist/js/bootstrap.js - About 1 hr to fix

                              Function next has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function next() {
                                    $active
                                      .removeClass('active')
                                      .find('> .dropdown-menu > .active')
                                      .removeClass('active')
                              Severity: Minor
                              Found in js/tab.js - About 1 hr to fix

                                Function hide has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  Collapse.prototype.hide = function () {
                                    if (this.transitioning || !this.$element.hasClass('in')) return
                                
                                    var startEvent = $.Event('hide.bs.collapse')
                                    this.$element.trigger(startEvent)
                                Severity: Minor
                                Found in js/collapse.js - About 1 hr to fix

                                  Function next has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      function next() {
                                        $active
                                          .removeClass('active')
                                          .find('> .dropdown-menu > .active')
                                            .removeClass('active')
                                  Severity: Minor
                                  Found in docs/dist/js/bootstrap.js - About 1 hr to fix

                                    Function parseSubSections has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    Parser.prototype.parseSubSections = function (section) {
                                      while (true) {
                                        var subsection = this.parseSubSection();
                                        if (subsection === null) {
                                          if (section.subsections.length === 0) {
                                    Severity: Minor
                                    Found in grunt/bs-lessdoc-parser.js - About 55 mins 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

                                    Function _shift has a Cognitive Complexity of 9 (exceeds 5 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 55 mins 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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language