aimer1124/JianshuSpider

View on GitHub
public/js/bootstrap-table.js

Summary

Maintainability
F
2 wks
Test Coverage

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

/**
 * @author zhixin wen <wenzhixin2010@gmail.com>
 * version: 1.11.0
 * https://github.com/wenzhixin/bootstrap-table/
 */
Severity: Major
Found in public/js/bootstrap-table.js - About 1 wk to fix

    Function initBody has 267 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        BootstrapTable.prototype.initBody = function (fixedScroll) {
            var that = this,
                html = [],
                data = this.getData();
    
    
    Severity: Major
    Found in public/js/bootstrap-table.js - About 1 day to fix

      Function initPagination has 191 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          BootstrapTable.prototype.initPagination = function () {
              if (!this.options.pagination) {
                  this.$pagination.hide();
                  return;
              } else {
      Severity: Major
      Found in public/js/bootstrap-table.js - About 7 hrs to fix

        Function initToolbar has 140 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            BootstrapTable.prototype.initToolbar = function () {
                var that = this,
                    html = [],
                    timeoutId = 0,
                    $keepOpen,
        Severity: Major
        Found in public/js/bootstrap-table.js - About 5 hrs to fix

          Function initHeader has 134 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              BootstrapTable.prototype.initHeader = function () {
                  var that = this,
                      visibleColumns = {},
                      html = [];
          
          
          Severity: Major
          Found in public/js/bootstrap-table.js - About 5 hrs to fix

            Function initTable has 74 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                BootstrapTable.prototype.initTable = function () {
                    var that = this,
                        columns = [],
                        data = [];
            
            
            Severity: Major
            Found in public/js/bootstrap-table.js - About 2 hrs to fix

              Function initServer has 67 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  BootstrapTable.prototype.initServer = function (silent, query, url) {
                      var that = this,
                          data = {},
                          params = {
                              searchText: this.searchText,
              Severity: Major
              Found in public/js/bootstrap-table.js - About 2 hrs to fix

                Function fitHeader has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    BootstrapTable.prototype.fitHeader = function () {
                        var that = this,
                            fixedBody,
                            scrollWidth,
                            focused,
                Severity: Major
                Found in public/js/bootstrap-table.js - About 2 hrs to fix

                  Consider simplifying this complex logical expression.
                  Open

                                  if (column.checkbox || column.radio) {
                                      type = column.checkbox ? 'checkbox' : type;
                                      type = column.radio ? 'radio' : type;
                  
                                      text = [sprintf(that.options.cardView ?
                  Severity: Critical
                  Found in public/js/bootstrap-table.js - About 2 hrs to fix

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

                        BootstrapTable.prototype.initSort = function () {
                            var that = this,
                                name = this.options.sortName,
                                order = this.options.sortOrder === 'desc' ? -1 : 1,
                                index = $.inArray(this.options.sortName, this.header.fields);
                    Severity: Major
                    Found in public/js/bootstrap-table.js - About 2 hrs to fix

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

                          BootstrapTable.prototype.initSearch = function () {
                              var that = this;
                      
                              if (this.options.sidePagination !== 'server') {
                                  if (this.options.customSearch !== $.noop) {
                      Severity: Major
                      Found in public/js/bootstrap-table.js - About 2 hrs to fix

                        Function resetFooter has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            BootstrapTable.prototype.resetFooter = function () {
                                var that = this,
                                    data = that.getData(),
                                    html = [];
                        
                        
                        Severity: Minor
                        Found in public/js/bootstrap-table.js - About 1 hr to fix

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

                              BootstrapTable.prototype.initContainer = function () {
                                  this.$container = $([
                                      '<div class="bootstrap-table">',
                                      '<div class="fixed-table-toolbar"></div>',
                                      this.options.paginationVAlign === 'top' || this.options.paginationVAlign === 'both' ?
                          Severity: Minor
                          Found in public/js/bootstrap-table.js - About 1 hr to fix

                            Function objectKeys has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                var objectKeys = function () {
                                    // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys
                                    if (!Object.keys) {
                                        Object.keys = (function() {
                                            var hasOwnProperty = Object.prototype.hasOwnProperty,
                            Severity: Minor
                            Found in public/js/bootstrap-table.js - About 1 hr to fix

                              Function resetView has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  BootstrapTable.prototype.resetView = function (params) {
                                      var padding = 0;
                              
                                      if (params && params.height) {
                                          this.options.height = params.height;
                              Severity: Minor
                              Found in public/js/bootstrap-table.js - About 1 hr to fix

                                Function data has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                            this.data = s ? $.grep(this.data, function (item, i) {
                                                for (var j = 0; j < that.header.fields.length; j++) {
                                
                                                    if (!that.header.searchables[j]) {
                                                        continue;
                                Severity: Minor
                                Found in public/js/bootstrap-table.js - About 1 hr to fix

                                  Function expandAllRows has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      BootstrapTable.prototype.expandAllRows = function (isSubTable) {
                                          if (isSubTable) {
                                              var $tr = this.$body.find(sprintf('> tr[data-index="%s"]', 0)),
                                                  that = this,
                                                  detailIcon = null,
                                  Severity: Minor
                                  Found in public/js/bootstrap-table.js - About 1 hr to fix

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

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

                                              Avoid too many return statements within this function.
                                              Open

                                                                  return order * -1;
                                              Severity: Major
                                              Found in public/js/bootstrap-table.js - About 30 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

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

                                                          if (this.options.showRefresh) {
                                                              html.push(sprintf('<button class="btn' +
                                                                      sprintf(' btn-%s', this.options.buttonsClass) +
                                                                      sprintf(' btn-%s', this.options.iconSize) +
                                                                      '" type="button" name="refresh" title="%s">',
                                                  Severity: Major
                                                  Found in public/js/bootstrap-table.js and 2 other locations - About 3 hrs to fix
                                                  public/js/bootstrap-table.js on lines 1057..1065
                                                  public/js/bootstrap-table.js on lines 1077..1085

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

                                                  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 3 locations. Consider refactoring.
                                                  Open

                                                          if (this.options.showToggle) {
                                                              html.push(sprintf('<button class="btn' +
                                                                      sprintf(' btn-%s', this.options.buttonsClass) +
                                                                      sprintf(' btn-%s', this.options.iconSize) +
                                                                      '" type="button" name="toggle" title="%s">',
                                                  Severity: Major
                                                  Found in public/js/bootstrap-table.js and 2 other locations - About 3 hrs to fix
                                                  public/js/bootstrap-table.js on lines 1057..1065
                                                  public/js/bootstrap-table.js on lines 1067..1075

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

                                                  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 3 locations. Consider refactoring.
                                                  Open

                                                          if (this.options.showPaginationSwitch) {
                                                              html.push(sprintf('<button class="btn' +
                                                                      sprintf(' btn-%s', this.options.buttonsClass) +
                                                                      sprintf(' btn-%s', this.options.iconSize) +
                                                                      '" type="button" name="paginationSwitch" title="%s">',
                                                  Severity: Major
                                                  Found in public/js/bootstrap-table.js and 2 other locations - About 3 hrs to fix
                                                  public/js/bootstrap-table.js on lines 1067..1075
                                                  public/js/bootstrap-table.js on lines 1077..1085

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

                                                  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

                                                          if (isSubTable) {
                                                              this.expandRow_(false, 0);
                                                          } else {
                                                              var trs = this.$body.children();
                                                              for (var i = 0; i < trs.length; i++) {
                                                  Severity: Major
                                                  Found in public/js/bootstrap-table.js and 1 other location - About 2 hrs to fix
                                                  public/js/bootstrap-table.js on lines 2869..2903

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

                                                  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

                                                          if (isSubTable) {
                                                              var $tr = this.$body.find(sprintf('> tr[data-index="%s"]', 0)),
                                                                  that = this,
                                                                  detailIcon = null,
                                                                  executeInterval = false,
                                                  Severity: Major
                                                  Found in public/js/bootstrap-table.js and 1 other location - About 2 hrs to fix
                                                  public/js/bootstrap-table.js on lines 2907..2914

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

                                                  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

                                                      BootstrapTable.prototype.append = function (data) {
                                                          this.initData(data, 'append');
                                                          this.initSearch();
                                                          this.initPagination();
                                                          this.initSort();
                                                  Severity: Major
                                                  Found in public/js/bootstrap-table.js and 1 other location - About 1 hr to fix
                                                  public/js/bootstrap-table.js on lines 2370..2376

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

                                                  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

                                                      BootstrapTable.prototype.showRow = function (params) {
                                                          if (!params.hasOwnProperty('index') && !params.hasOwnProperty('uniqueId')) {
                                                              return;
                                                          }
                                                          this.toggleRow(params.index, params.uniqueId, true);
                                                  Severity: Major
                                                  Found in public/js/bootstrap-table.js and 1 other location - About 1 hr to fix
                                                  public/js/bootstrap-table.js on lines 2527..2532

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

                                                  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

                                                      BootstrapTable.prototype.hideRow = function (params) {
                                                          if (!params.hasOwnProperty('index') && !params.hasOwnProperty('uniqueId')) {
                                                              return;
                                                          }
                                                          this.toggleRow(params.index, params.uniqueId, false);
                                                  Severity: Major
                                                  Found in public/js/bootstrap-table.js and 1 other location - About 1 hr to fix
                                                  public/js/bootstrap-table.js on lines 2520..2525

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

                                                  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

                                                      BootstrapTable.prototype.prepend = function (data) {
                                                          this.initData(data, 'prepend');
                                                          this.initSearch();
                                                          this.initPagination();
                                                          this.initSort();
                                                  Severity: Major
                                                  Found in public/js/bootstrap-table.js and 1 other location - About 1 hr to fix
                                                  public/js/bootstrap-table.js on lines 2362..2368

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

                                                  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

                                                      BootstrapTable.prototype.getSelections = function () {
                                                          var that = this;
                                                  
                                                          return $.grep(this.options.data, function (row) {
                                                              return row[that.header.stateField];
                                                  Severity: Major
                                                  Found in public/js/bootstrap-table.js and 1 other location - About 1 hr to fix
                                                  public/js/bootstrap-table.js on lines 2600..2606

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

                                                  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

                                                      BootstrapTable.prototype.getAllSelections = function () {
                                                          var that = this;
                                                  
                                                          return $.grep(this.options.data, function (row) {
                                                              return row[that.header.stateField];
                                                  Severity: Major
                                                  Found in public/js/bootstrap-table.js and 1 other location - About 1 hr to fix
                                                  public/js/bootstrap-table.js on lines 2592..2598

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

                                                  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

                                                          if (this.options.showRefresh) {
                                                              this.$toolbar.find('button[name="refresh"]')
                                                                  .off('click').on('click', $.proxy(this.refresh, this));
                                                          }
                                                  Severity: Major
                                                  Found in public/js/bootstrap-table.js and 1 other location - About 1 hr to fix
                                                  public/js/bootstrap-table.js on lines 1128..1131

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

                                                  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

                                                          if (this.options.showPaginationSwitch) {
                                                              this.$toolbar.find('button[name="paginationSwitch"]')
                                                                  .off('click').on('click', $.proxy(this.togglePagination, this));
                                                          }
                                                  Severity: Major
                                                  Found in public/js/bootstrap-table.js and 1 other location - About 1 hr to fix
                                                  public/js/bootstrap-table.js on lines 1133..1136

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

                                                  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

                                                                  params.limit = this.options.pageSize === this.options.formatAllRows() ?
                                                                      this.options.totalRows : this.options.pageSize;
                                                  Severity: Major
                                                  Found in public/js/bootstrap-table.js and 1 other location - About 1 hr to fix
                                                  public/js/bootstrap-table.js on lines 1925..1926

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

                                                  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

                                                              params.pageSize = this.options.pageSize === this.options.formatAllRows() ?
                                                                  this.options.totalRows : this.options.pageSize;
                                                  Severity: Major
                                                  Found in public/js/bootstrap-table.js and 1 other location - About 1 hr to fix
                                                  public/js/bootstrap-table.js on lines 1944..1945

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

                                                  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

                                                              if (style && style.css) {
                                                                  for (key in style.css) {
                                                                      csses.push(key + ': ' + style.css[key]);
                                                                  }
                                                              }
                                                  Severity: Major
                                                  Found in public/js/bootstrap-table.js and 1 other location - About 1 hr to fix
                                                  public/js/bootstrap-table.js on lines 2184..2188

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

                                                  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

                                                              if (style && style.css) {
                                                                  for (key in style.css) {
                                                                      csses.push(key + ': ' + style.css[key]);
                                                                  }
                                                              }
                                                  Severity: Major
                                                  Found in public/js/bootstrap-table.js and 1 other location - About 1 hr to fix
                                                  public/js/bootstrap-table.js on lines 1611..1615

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

                                                  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

                                                              if ($items.filter(':checked').length <= this.options.minimumCountColumns) {
                                                                  $items.filter(':checked').prop('disabled', true);
                                                              }
                                                  Severity: Minor
                                                  Found in public/js/bootstrap-table.js and 1 other location - About 50 mins to fix
                                                  public/js/bootstrap-table.js on lines 2254..2256

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

                                                  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

                                                              if ($items.filter(':checked').length <= this.options.minimumCountColumns) {
                                                                  $items.filter(':checked').prop('disabled', true);
                                                              }
                                                  Severity: Minor
                                                  Found in public/js/bootstrap-table.js and 1 other location - About 50 mins to fix
                                                  public/js/bootstrap-table.js on lines 2769..2771

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

                                                  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

                                                          this.timeoutId_ = setTimeout($.proxy(this.fitHeader, this), this.$el.is(':hidden') ? 100 : 0);
                                                  Severity: Minor
                                                  Found in public/js/bootstrap-table.js and 1 other location - About 35 mins to fix
                                                  public/js/bootstrap-table.js on lines 2204..2205

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

                                                  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

                                                          this.timeoutFooter_ = setTimeout($.proxy(this.fitFooter, this),
                                                              this.$el.is(':hidden') ? 100 : 0);
                                                  Severity: Minor
                                                  Found in public/js/bootstrap-table.js and 1 other location - About 35 mins to fix
                                                  public/js/bootstrap-table.js on lines 2061..2061

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

                                                  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

                                                                  $this.find('i').attr('class', sprintf('%s %s', that.options.iconsPrefix, that.options.icons.detailClose));
                                                  Severity: Minor
                                                  Found in public/js/bootstrap-table.js and 1 other location - About 35 mins to fix
                                                  public/js/bootstrap-table.js on lines 1829..1829

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

                                                  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

                                                                  $this.find('i').attr('class', sprintf('%s %s', that.options.iconsPrefix, that.options.icons.detailOpen));
                                                  Severity: Minor
                                                  Found in public/js/bootstrap-table.js and 1 other location - About 35 mins to fix
                                                  public/js/bootstrap-table.js on lines 1833..1833

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

                                                  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

                                                  There are no issues that match your filters.

                                                  Category
                                                  Status