aimer1124/JianshuSpider

View on GitHub

Showing 62 of 155 total issues

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

    var setFieldIndex = function (columns) {
        var i, j, k,
            totalCol = 0,
            flag = [];

Severity: Minor
Found in public/js/bootstrap-table.js - About 1 hr to fix

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

                Object.keys = (function() {
                    var hasOwnProperty = Object.prototype.hasOwnProperty,
                        hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString'),
                        dontEnums = [
                            'toString',
    Severity: Minor
    Found in public/js/bootstrap-table.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 public/js/bootstrap.js - About 1 hr to fix

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

                    var fetchUrl = function (article, callback) {
                        var delay = parseInt((Math.random() * 10000000) % 2000, 10);
                        conCurrencyCount++;
                        // console.log('并发数:' + conCurrencyCount + ',访问的页面是:' + article.authorHref + ',控制的延迟:' + delay);
                        getURL.getPageContent(article.authorHref, function (err, res) {
        Severity: Minor
        Found in util/syncData.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 public/js/bootstrap.js - About 1 hr to fix

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

              var Selectpicker = function (element, options, e) {
                // bootstrap-select has been initialized - revert valHooks.select.set back to its original function
                if (!valHooks.useDefault) {
                  $.valHooks.select.set = valHooks._set;
                  valHooks.useDefault = true;
            Severity: Minor
            Found in public/js/bootstrap-select.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 public/js/bootstrap.js - About 1 hr to fix

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

                    BootstrapTable.prototype.getRowByUniqueId = function (id) {
                        var uniqueId = this.options.uniqueId,
                            len = this.options.data.length,
                            dataRow = null,
                            i, row, rowUniqueId;
                Severity: Minor
                Found in public/js/bootstrap-table.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 public/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 offsetMethod = 'offset'
                        var offsetBase   = 0
                    
                        if (!$.isWindow(this.$scrollElement[0])) {
                    Severity: Minor
                    Found in public/js/bootstrap.js - About 1 hr to fix

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

                            var startsWith = function (search) {
                              if (this == null) {
                                throw new TypeError();
                              }
                              var string = String(this);
                      Severity: Minor
                      Found in public/js/bootstrap-select.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 public/js/bootstrap.js - About 1 hr to fix

                          Consider simplifying this complex logical expression.
                          Open

                                if (!isActive && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105 || e.keyCode >= 65 && e.keyCode <= 90)) {
                                  if (!that.options.container) {
                                    that.setSize();
                                    that.$menu.parent().addClass('open');
                                    isActive = true;
                          Severity: Major
                          Found in public/js/bootstrap-select.js - About 1 hr to fix

                            Avoid deeply nested control flow statements.
                            Open

                                            if (maxOptions && maxOptions == 1) {
                                              $options.prop('selected', false);
                                              $option.prop('selected', true);
                                              that.$menuInner.find('.selected').removeClass('selected');
                                              that.setSelected(clickedIndex, true);
                            Severity: Major
                            Found in public/js/bootstrap-select.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                          if ((value + '').toLowerCase() === s) {
                                                              return true;
                                                          }
                              Severity: Major
                              Found in public/js/bootstrap-table.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                              if ($prev[i].tagName === 'OPTGROUP') {
                                                var optGroupDistance = 0;
                                
                                                // loop through the options in between the current option and the optgroup
                                                // and check if they are hidden or disabled
                                Severity: Major
                                Found in public/js/bootstrap-select.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                              if ((value + '').toLowerCase().indexOf(s) !== -1) {
                                                                  return true;
                                                              }
                                  Severity: Major
                                  Found in public/js/bootstrap-table.js - About 45 mins to fix

                                    Consider simplifying this complex logical expression.
                                    Open

                                          if ((/(^9$|27)/.test(e.keyCode.toString(10)) && isActive && (that.multiple || that.options.liveSearch)) || (/(27)/.test(e.keyCode.toString(10)) && !isActive)) {
                                            that.$menu.parent().removeClass('open');
                                            if (that.options.container) that.$newElement.removeClass('open');
                                            that.$button.focus();
                                          }
                                    Severity: Major
                                    Found in public/js/bootstrap-select.js - About 40 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                                      return order;
                                      Severity: Major
                                      Found in public/js/bootstrap-table.js - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                            if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
                                        Severity: Major
                                        Found in public/js/bootstrap.js - About 30 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language