aimer1124/JianshuSpider

View on GitHub

Showing 155 of 155 total issues

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

            vert: parseInt(menuStyle ? menuStyle.paddingTop : $menu.css('paddingTop')) +
                  parseInt(menuStyle ? menuStyle.paddingBottom : $menu.css('paddingBottom')) +
                  parseInt(menuStyle ? menuStyle.borderTopWidth : $menu.css('borderTopWidth')) +
                  parseInt(menuStyle ? menuStyle.borderBottomWidth : $menu.css('borderBottomWidth')),
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 876..879

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

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.alert')

Severity: Major
Found in public/js/bootstrap.js and 1 other location - About 3 hrs to fix
public/js/bootstrap.js on lines 866..874

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

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

            horiz: parseInt(menuStyle ? menuStyle.paddingLeft : $menu.css('paddingLeft')) +
                  parseInt(menuStyle ? menuStyle.paddingRight : $menu.css('paddingRight')) +
                  parseInt(menuStyle ? menuStyle.borderLeftWidth : $menu.css('borderLeftWidth')) +
                  parseInt(menuStyle ? menuStyle.borderRightWidth : $menu.css('borderRightWidth'))
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 872..875

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

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.dropdown')

Severity: Major
Found in public/js/bootstrap.js and 1 other location - About 3 hrs to fix
public/js/bootstrap.js on lines 141..149

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

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.icontains = function (obj, index, meta) {
    var $obj = $(obj);
    var haystack = ($obj.data('tokens') || $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 203..207

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

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.ibegins = function (obj, index, meta) {
    var $obj = $(obj);
    var haystack = ($obj.data('tokens') || $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 196..200

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

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

    init: function () {
      var that = this,
          id = this.$element.attr('id');

      this.$element.addClass('bs-select-hidden');
Severity: Major
Found in public/js/bootstrap-select.js - About 2 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 liHeight has 72 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          liHeight: function (refresh) {
            if (!refresh && (this.options.size === false || this.sizeInfo)) return;
      
            var newElement = document.createElement('div'),
                menu = document.createElement('div'),
      Severity: Major
      Found in public/js/bootstrap-select.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

            Function liveSearchListener has 63 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                liveSearchListener: function () {
                  var that = this,
                      $no_results = $('<li class="no-results"></li>');
            
                  this.$button.on('click.dropdown.data-api touchstart.dropdown.data-api', function () {
            Severity: Major
            Found in public/js/bootstrap-select.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 articleInfo has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function articleInfo() {
                
                    var articleTitles = [];
                    // console.log('获取数据开始');
                    getURL.getPageContent('/', function (err, gres, next) {
                Severity: Major
                Found in util/syncData.js - About 2 hrs to fix

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

                    Tooltip.prototype.show = function () {
                      var e = $.Event('show.bs.' + this.type)
                  
                      if (this.hasContent() && this.enabled) {
                        this.$element.trigger(e)
                  Severity: Major
                  Found in public/js/bootstrap.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 render has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            render: function (updateLi) {
                              var that = this,
                                  notDisabled;
                        
                              //Update the LI to match the SELECT
                        Severity: Major
                        Found in public/js/bootstrap-select.js - About 2 hrs to fix

                          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

                          Severity
                          Category
                          Status
                          Source
                          Language