aimer1124/JianshuSpider

View on GitHub

Showing 155 of 155 total issues

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

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

    /*!
     * Bootstrap v3.3.0 (http://getbootstrap.com)
     * Copyright 2011-2014 Twitter, Inc.
     * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
     */
    Severity: Major
    Found in public/js/bootstrap.js - About 4 days to fix

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

      /*!
       * Bootstrap-select v1.11.2 (http://silviomoreto.github.io/bootstrap-select)
       *
       * Copyright 2013-2016 bootstrap-select
       * Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
      Severity: Major
      Found in public/js/bootstrap-select.js - About 4 days 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

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

            function Plugin(option) {
              return this.each(function () {
                var $this    = $(this)
                var data     = $this.data('bs.tooltip')
                var options  = typeof option == 'object' && option
          Severity: Major
          Found in public/js/bootstrap.js and 1 other location - About 1 day to fix
          public/js/bootstrap.js on lines 1751..1767

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

          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

            function Plugin(option) {
              return this.each(function () {
                var $this    = $(this)
                var data     = $this.data('bs.popover')
                var options  = typeof option == 'object' && option
          Severity: Major
          Found in public/js/bootstrap.js and 1 other location - About 1 day to fix
          public/js/bootstrap.js on lines 1631..1647

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

          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

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

                keydown: function (e) {
                  var $this = $(this),
                      $parent = $this.is('input') ? $this.parent().parent() : $this.parent(),
                      $items,
                      that = $parent.data('this'),
            Severity: Major
            Found in public/js/bootstrap-select.js - About 7 hrs to fix

              Function clickListener has 158 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  clickListener: function () {
                    var that = this,
                        $document = $(document);
              
                    this.$newElement.on('touchstart.dropdown', '.dropdown-menu', function (e) {
              Severity: Major
              Found in public/js/bootstrap-select.js - About 6 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 setSize has 123 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        setSize: function () {
                          this.findLis();
                          this.liHeight();
                    
                          if (this.options.header) this.$menu.css('padding-top', 0);
                    Severity: Major
                    Found in public/js/bootstrap-select.js - About 4 hrs to fix

                      Function createLi has 122 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          createLi: function () {
                            var that = this,
                                _li = [],
                                optID = 0,
                                titleOption = document.createElement('option'),
                      Severity: Major
                      Found in public/js/bootstrap-select.js - About 4 hrs to fix

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

                          function Plugin(option) {
                            return this.each(function () {
                              var $this   = $(this)
                              var data    = $this.data('bs.affix')
                              var options = typeof option == 'object' && option
                        Severity: Major
                        Found in public/js/bootstrap.js and 1 other location - About 4 hrs to fix
                        public/js/bootstrap.js on lines 1923..1932

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

                        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

                          function Plugin(option) {
                            return this.each(function () {
                              var $this   = $(this)
                              var data    = $this.data('bs.scrollspy')
                              var options = typeof option == 'object' && option
                        Severity: Major
                        Found in public/js/bootstrap.js and 1 other location - About 4 hrs to fix
                        public/js/bootstrap.js on lines 2233..2242

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

                        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

                          $.expr.pseudos.aicontains = function (obj, index, meta) {
                            var $obj = $(obj);
                            var haystack = ($obj.data('tokens') || $obj.data('normalizedText') || $obj.text()).toString().toUpperCase();
                            return haystack.includes(meta[3].toUpperCase());
                          };
                        Severity: Major
                        Found in public/js/bootstrap-select.js and 1 other location - About 3 hrs to fix
                        public/js/bootstrap-select.js on lines 217..221

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

                        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

                          $.expr.pseudos.aibegins = function (obj, index, meta) {
                            var $obj = $(obj);
                            var haystack = ($obj.data('tokens') || $obj.data('normalizedText') || $obj.text()).toString().toUpperCase();
                            return haystack.startsWith(meta[3].toUpperCase());
                          };
                        Severity: Major
                        Found in public/js/bootstrap-select.js and 1 other location - About 3 hrs to fix
                        public/js/bootstrap-select.js on lines 210..214

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

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

                        Severity
                        Category
                        Status
                        Source
                        Language