scholarslab/ivanhoe

View on GitHub
javascripts/infinite-scroll/wordpress-plugin/js/front-end/jquery.infinitescroll.dev.js

Summary

Maintainability
F
3 days
Test Coverage

File jquery.infinitescroll.dev.js has 518 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*global jQuery: true */

/*!
   --------------------------------
   Infinite Scroll

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

            beginAjax: function infscr_ajax(opts) {
                var instance = this,
                    path = opts.path,
                    box, desturl, method, condition;
    
    

      Function infscr_create has 58 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              _create: function infscr_create(options, callback) {
      
                  // Add custom options to defaults
                  var opts = $.extend(true, {}, $.infinitescroll.defaults, options);
                  this.options = opts;

        Function infscr_loadcallback has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                _loadcallback: function infscr_loadcallback(box, data, url) {
                    var opts = this.options,
                    callback = this.options.callback, // GLOBAL OBJECT FOR CALLBACK
                    result = (opts.state.isDone) ? 'done' : (!opts.appendCallback) ? 'no-append' : 'append',
                    frag;

          Function infscr_init has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              $.fn.infinitescroll = function infscr_init(options, callback) {
          
          
                  var thisCall = typeof options;
          
          

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

                    _determinepath: function infscr_determinepath(path) {
            
                        var opts = this.options;
            
                        // if behavior is defined and this function is extended, call that instead of default

              Avoid too many return statements within this function.
              Open

                          return path;

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

                            if (!!opts.behavior && this['retrieve_'+opts.behavior] !== undefined) {
                                this['retrieve_'+opts.behavior].call(this,pageNum);
                                return;
                            }
                javascripts/infinite-scroll/wordpress-plugin/js/front-end/jquery.infinitescroll.dev.js on lines 433..436

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

                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 (!!opts.behavior && this['_pausing_'+opts.behavior] !== undefined) {
                                this['_pausing_'+opts.behavior].call(this,pause);
                                return;
                            }
                javascripts/infinite-scroll/wordpress-plugin/js/front-end/jquery.infinitescroll.dev.js on lines 647..650

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

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

                            if (!!opts.behavior && this['scroll_'+opts.behavior] !== undefined) {
                                this['scroll_'+opts.behavior].call(this);
                                return;
                            }
                javascripts/infinite-scroll/wordpress-plugin/js/front-end/jquery.infinitescroll.dev.js on lines 94..97
                javascripts/infinite-scroll/wordpress-plugin/js/front-end/jquery.infinitescroll.dev.js on lines 471..474
                javascripts/infinite-scroll/wordpress-plugin/js/front-end/jquery.infinitescroll.dev.js on lines 488..491

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

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

                            if (!!opts.behavior && this['_setup_'+opts.behavior] !== undefined) {
                                this['_setup_'+opts.behavior].call(this);
                                return;
                            }
                javascripts/infinite-scroll/wordpress-plugin/js/front-end/jquery.infinitescroll.dev.js on lines 94..97
                javascripts/infinite-scroll/wordpress-plugin/js/front-end/jquery.infinitescroll.dev.js on lines 488..491
                javascripts/infinite-scroll/wordpress-plugin/js/front-end/jquery.infinitescroll.dev.js on lines 671..674

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

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

                            if (!!opts.behavior && this['_showdonemsg_'+opts.behavior] !== undefined) {
                                this['_showdonemsg_'+opts.behavior].call(this);
                                return;
                            }
                javascripts/infinite-scroll/wordpress-plugin/js/front-end/jquery.infinitescroll.dev.js on lines 94..97
                javascripts/infinite-scroll/wordpress-plugin/js/front-end/jquery.infinitescroll.dev.js on lines 471..474
                javascripts/infinite-scroll/wordpress-plugin/js/front-end/jquery.infinitescroll.dev.js on lines 671..674

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

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

                            if (!!opts.behavior && this['_binding_'+opts.behavior] !== undefined) {
                                this['_binding_'+opts.behavior].call(this);
                                return;
                            }
                javascripts/infinite-scroll/wordpress-plugin/js/front-end/jquery.infinitescroll.dev.js on lines 471..474
                javascripts/infinite-scroll/wordpress-plugin/js/front-end/jquery.infinitescroll.dev.js on lines 488..491
                javascripts/infinite-scroll/wordpress-plugin/js/front-end/jquery.infinitescroll.dev.js on lines 671..674

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

                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