gecos-team/gecoscc-ui

View on GitHub
gecoscc/static/js/libs/backbone.paginator-0.8.1.js

Summary

Maintainability
F
2 wks
Test Coverage

Function Paginator has a Cognitive Complexity of 195 (exceeds 5 allowed). Consider refactoring.
Open

Backbone.Paginator = (function ( Backbone, _, $ ) {
  "use strict";


  var bbVer = _.map(Backbone.VERSION.split('.'), function(digit) {
Severity: Minor
Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js - About 3 days to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function Paginator has 692 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Backbone.Paginator = (function ( Backbone, _, $ ) {
  "use strict";


  var bbVer = _.map(Backbone.VERSION.split('.'), function(digit) {
Severity: Major
Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js - About 3 days to fix

    File backbone.paginator-0.8.1.js has 695 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*! backbone.paginator - v0.8.1 - 7/3/2013
    * http://github.com/addyosmani/backbone.paginator
    * Copyright (c) 2013 Addy Osmani; Licensed MIT */
    /*globals Backbone:true, _:true, jQuery:true*/
    Backbone.Paginator = (function ( Backbone, _, $ ) {
    Severity: Major
    Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js - About 1 day to fix

      Function _fieldFilter has 87 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _fieldFilter: function( models, rules ) {
      
            // Check if there are any rules
            if ( _.isEmpty(rules) ) {
              return models;
      Severity: Major
      Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js - About 3 hrs to fix

        Function sync has 64 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            sync: function ( method, model, options ) {
        
              var self = this;
        
              self.setDefaults();
        Severity: Major
        Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js - About 2 hrs to fix

          Function sync has 59 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              sync: function ( method, model, options ) {
                var self = this;
          
                // SET DEFAULT VALUES
                this.setDefaults();
          Severity: Major
          Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js - About 2 hrs to fix

            Function _filter has 59 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                _filter: function ( models, fields, filter ) {
            
                  //  For example, if you had a data model containing cars like { color: '', description: '', hp: '' },
                  //  your fields was set to ['color', 'description', 'hp'] and your filter was set
                  //  to "Black Mustang 300", the word "Black" will match all the cars that have black color, then
            Severity: Major
            Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js - About 2 hrs to fix

              Function _sort has 57 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _sort: function ( models, sort, direction ) {
                    models = models.sort(function (a, b) {
                      var ac = a.get(sort),
                      bc = b.get(sort);
              
              
              Severity: Major
              Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js - About 2 hrs to fix

                Function pager has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    pager: function (options) {
                      var self = this,
                      disp = this.perPage,
                      start = (self.currentPage - 1) * disp,
                      stop = start + disp;
                Severity: Minor
                Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js - About 1 hr to fix

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

                      setPagination: function ( info ) {
                  
                        var pages = [], i = 0, l = 0;
                  
                        // How many adjacent pages should be shown on each side?
                  Severity: Minor
                  Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js - About 1 hr to fix

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

                        setPagination: function ( info ) {
                    
                          var pages = [], i = 0, l = 0;
                    
                          // How many adjacent pages should be shown on each side?
                    Severity: Minor
                    Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js - About 1 hr to fix

                      Avoid deeply nested control flow statements.
                      Open

                                  for (i = LASTPAGE - ADJACENTx2; i <= LASTPAGE; i++) {
                                    pages.push(i);
                                  }
                      Severity: Major
                      Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                    for (i = LASTPAGE - ADJACENTx2; i <= LASTPAGE; i++) {
                                      pages.push(i);
                                    }
                        Severity: Major
                        Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                      if( !_.isNaN( Number( model.get(rule.field) ) ) &&
                                         !_.isNaN( Number( rule.value ) ) &&
                                           Number( model.get(rule.field) ) <= Number( rule.value ) ) {
                                        should_push = true;
                                      }
                          Severity: Major
                          Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                        for (i = info.currentPage - this.pagesInRange; i <= info.currentPage + this.pagesInRange; i++) {
                                          pages.push(i);
                                        }
                            Severity: Major
                            Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                          for (i = info.currentPage - this.pagesInRange; i <= info.currentPage + this.pagesInRange; i++) {
                                            pages.push(i);
                                          }
                              Severity: Major
                              Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                          }else if(rule.type === "range"){
                                            if( !_.isNaN( Number( model.get(rule.field) ) ) &&
                                               _.isObject( rule.value ) &&
                                                 !_.isNaN( Number( rule.value.min ) ) &&
                                                   !_.isNaN( Number( rule.value.max ) ) &&
                                Severity: Major
                                Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js - About 45 mins to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                              if( !_.isNaN( Number( model.get(rule.field) ) ) &&
                                                 _.isObject( rule.value ) &&
                                                   !_.isNaN( Number( rule.value.min ) ) &&
                                                     !_.isNaN( Number( rule.value.max ) ) &&
                                                       Number( model.get(rule.field) ) >= Number( rule.value.min ) &&
                                  Severity: Major
                                  Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js - About 40 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                                  return 1;
                                    Severity: Major
                                    Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                                    return 1;
                                      Severity: Major
                                      Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                                      return -1;
                                        Severity: Major
                                        Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                                  return 0;
                                          Severity: Major
                                          Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js - About 30 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                                          return -1;
                                            Severity: Major
                                            Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                          return -1;
                                              Severity: Major
                                              Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js - About 30 mins to fix

                                                Avoid too many return statements within this function.
                                                Open

                                                              return -1;
                                                Severity: Major
                                                Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js - About 30 mins to fix

                                                  Avoid too many return statements within this function.
                                                  Open

                                                              return 1;
                                                  Severity: Major
                                                  Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js - About 30 mins to fix

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

                                                        setPagination: function ( info ) {
                                                    
                                                          var pages = [], i = 0, l = 0;
                                                    
                                                          // How many adjacent pages should be shown on each side?
                                                    Severity: Major
                                                    Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js and 1 other location - About 2 days to fix
                                                    gecoscc/static/js/libs/backbone.paginator-0.8.1.js on lines 970..1016

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

                                                    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

                                                        setPagination: function ( info ) {
                                                    
                                                          var pages = [], i = 0, l = 0;
                                                    
                                                          // How many adjacent pages should be shown on each side?
                                                    Severity: Major
                                                    Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js and 1 other location - About 2 days to fix
                                                    gecoscc/static/js/libs/backbone.paginator-0.8.1.js on lines 708..754

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

                                                    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

                                                              }else if(rule.type === "min"){
                                                                if( !_.isNaN( Number( model.get(rule.field) ) ) &&
                                                                   !_.isNaN( Number( rule.value ) ) &&
                                                                     Number( model.get(rule.field) ) >= Number( rule.value ) ) {
                                                                  should_push = true;
                                                    Severity: Major
                                                    Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js and 1 other location - About 3 hrs to fix
                                                    gecoscc/static/js/libs/backbone.paginator-0.8.1.js on lines 470..539

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

                                                    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

                                                              }else if(rule.type === "max"){
                                                                if( !_.isNaN( Number( model.get(rule.field) ) ) &&
                                                                   !_.isNaN( Number( rule.value ) ) &&
                                                                     Number( model.get(rule.field) ) <= Number( rule.value ) ) {
                                                                  should_push = true;
                                                    Severity: Major
                                                    Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js and 1 other location - About 3 hrs to fix
                                                    gecoscc/static/js/libs/backbone.paginator-0.8.1.js on lines 462..539

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

                                                    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

                                                          _.each(_.result(self, "server_api"), function(value, key){
                                                            if( _.isFunction(value) ) {
                                                              value = _.bind(value, self);
                                                              value = value();
                                                            }
                                                    Severity: Major
                                                    Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js and 1 other location - About 2 hrs to fix
                                                    gecoscc/static/js/libs/backbone.paginator-0.8.1.js on lines 86..92

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

                                                    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

                                                          _.each(_.result(self, "server_api"), function(value, key){
                                                            if( _.isFunction(value) ) {
                                                              value = _.bind(value, self);
                                                              value = value();
                                                            }
                                                    Severity: Major
                                                    Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js and 1 other location - About 2 hrs to fix
                                                    gecoscc/static/js/libs/backbone.paginator-0.8.1.js on lines 795..801

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

                                                    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

                                                          _.each(queryOptions, function(value, key){
                                                            if( _.isFunction(value) ) {
                                                              value = _.bind(value, self);
                                                              value = value();
                                                            }
                                                    Severity: Major
                                                    Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js and 1 other location - About 1 hr to fix
                                                    gecoscc/static/js/libs/backbone.paginator-0.8.1.js on lines 95..101

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

                                                    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

                                                          _.each(queryOptions, function(value, key){
                                                            if( _.isFunction(value) ) {
                                                              value = _.bind(value, self);
                                                              value = value();
                                                            }
                                                    Severity: Major
                                                    Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js and 1 other location - About 1 hr to fix
                                                    gecoscc/static/js/libs/backbone.paginator-0.8.1.js on lines 804..810

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

                                                    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

                                                        requestPreviousPage: function ( options ) {
                                                          if ( this.currentPage !== undefined ) {
                                                            this.currentPage -= 1;
                                                            return this.pager( options );
                                                          } else {
                                                    Severity: Major
                                                    Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js and 1 other location - About 1 hr to fix
                                                    gecoscc/static/js/libs/backbone.paginator-0.8.1.js on lines 890..897

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

                                                    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

                                                        requestNextPage: function ( options ) {
                                                          if ( this.currentPage !== undefined ) {
                                                            this.currentPage += 1;
                                                            return this.pager( options );
                                                          } else {
                                                    Severity: Major
                                                    Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js and 1 other location - About 1 hr to fix
                                                    gecoscc/static/js/libs/backbone.paginator-0.8.1.js on lines 899..906

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

                                                    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

                                                          queryOptions = _.extend(queryOptions, {
                                                            data: decodeURIComponent($.param(queryAttributes)),
                                                            processData: false,
                                                            url: _.result(queryOptions, 'url')
                                                          }, options);
                                                    Severity: Minor
                                                    Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js and 1 other location - About 55 mins to fix
                                                    gecoscc/static/js/libs/backbone.paginator-0.8.1.js on lines 827..831

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

                                                    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

                                                          queryOptions = _.extend(queryOptions, {
                                                            data: decodeURIComponent($.param(queryAttributes)),
                                                            processData: false,
                                                            url: _.result(queryOptions, 'url')
                                                          }, options);
                                                    Severity: Minor
                                                    Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js and 1 other location - About 55 mins to fix
                                                    gecoscc/static/js/libs/backbone.paginator-0.8.1.js on lines 111..115

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

                                                    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.filterExpression !== "" ) {
                                                            self.models = self._filter(self.models, this.filterFields, this.filterExpression);
                                                          }
                                                    Severity: Minor
                                                    Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js and 1 other location - About 50 mins to fix
                                                    gecoscc/static/js/libs/backbone.paginator-0.8.1.js on lines 300..302

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

                                                    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.sortColumn !== "" ) {
                                                            self.models = self._sort(self.models, this.sortColumn, this.sortDirection);
                                                          }
                                                    Severity: Minor
                                                    Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js and 1 other location - About 50 mins to fix
                                                    gecoscc/static/js/libs/backbone.paginator-0.8.1.js on lines 310..312

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

                                                    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

                                                              }else if(rule.type === "maxLength"){
                                                                if( model.get(rule.field).toString().length <= rule.value ) {
                                                                  should_push = true;
                                                                }
                                                    
                                                    
                                                    Severity: Minor
                                                    Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js and 1 other location - About 50 mins to fix
                                                    gecoscc/static/js/libs/backbone.paginator-0.8.1.js on lines 489..539

                                                    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

                                                              }else if(rule.type === "minLength"){
                                                                if( model.get(rule.field).toString().length >= rule.value ) {
                                                                  should_push = true;
                                                                }
                                                    
                                                    
                                                    Severity: Minor
                                                    Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js and 1 other location - About 50 mins to fix
                                                    gecoscc/static/js/libs/backbone.paginator-0.8.1.js on lines 495..539

                                                    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

                                                              if((!ac.match(/[^\-\d\.]/) && ac.match(/-?[\d\.]+/)) &&
                                                                   (!bc.match(/[^\-\d\.]/) && bc.match(/-?[\d\.]+/))){
                                                    
                                                                if( (ac - 0) < (bc - 0) ) {
                                                                  return 1;
                                                    Severity: Minor
                                                    Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js and 1 other location - About 45 mins to fix
                                                    gecoscc/static/js/libs/backbone.paginator-0.8.1.js on lines 382..397

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

                                                    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((!ac.match(/[^\-\d\.]/) && ac.match(/-?[\d\.]+/)) &&
                                                                 (!bc.match(/[^\-\d\.]/) && bc.match(/-?[\d\.]+/))){
                                                                if( (ac - 0) < (bc - 0) ) {
                                                                  return -1;
                                                                }
                                                    Severity: Minor
                                                    Found in gecoscc/static/js/libs/backbone.paginator-0.8.1.js and 1 other location - About 45 mins to fix
                                                    gecoscc/static/js/libs/backbone.paginator-0.8.1.js on lines 361..377

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

                                                    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