twbs/bootstrap

View on GitHub

Showing 54 of 114 total issues

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

      function createGist(configJson, callback) {
        var data = {
          description: 'Bootstrap Customizer Config',
          'public': true,
          files: {
    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 js/tab.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 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 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 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 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 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 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 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 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 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

                                  Function replaceRecursively has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function replaceRecursively(directory, excludedDirectories, allowedExtensions, original, replacement) {
                                    original = new RegExp(RegExp.quote(original), 'g');
                                    replacement = RegExp.quoteReplacement(replacement);
                                    var updateFile = !DRY_RUN ? function (filepath) {
                                      if (allowedExtensions.has(path.parse(filepath).ext)) {
                                  Severity: Minor
                                  Found in grunt/change-version.js - About 45 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

                                  Consider simplifying this complex logical expression.
                                  Open

                                    if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) {
                                      throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4')
                                    }
                                  Severity: Major
                                  Found in docs/dist/js/bootstrap.js - About 40 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language