CaffGeek/MBACNationals

View on GitHub
Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js

Summary

Maintainability
F
3 days
Test Coverage

File wp-lists.dev.js has 304 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function($) {
var fs = {add:'ajaxAdd',del:'ajaxDel',dim:'ajaxDim',process:'process',recolor:'recolor'}, wpList;

wpList = {
    settings: {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js - About 3 hrs to fix

    Function ajaxDim has 55 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        ajaxDim: function( e, s ) {
            if ( $(e).parent().css('display') == 'none' ) // Prevent hidden links from being clicked by hotkeys
                return false;
            e = $(e); s = s || {};
            var list = this, cls = wpList.parseClass(e,'dim'), element, isClass, color, dimColor;
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js - About 2 hrs to fix

      Function ajaxAdd has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          ajaxAdd: function( e, s ) {
              e = $(e);
              s = s || {};
              var list = this, cls = wpList.parseClass(e,'add'), es, valid, formData;
              s = wpList.pre.call( list, e, s, 'add' );
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js - About 1 hr to fix

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

            ajaxDel: function( e, s ) {
                e = $(e); s = s || {};
                var list = this, cls = wpList.parseClass(e,'delete'), element;
                s = wpList.pre.call( list, e, s, 'delete' );
        
        
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js - About 1 hr to fix

          Function add has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              add: function( e, s ) {
                  e = $(e);
          
                  var list = $(this), old = false, _s = { pos: 0, id: 0, oldId: null }, ba, ref, color;
                  if ( 'string' == typeof s ) { s = { what: s }; }
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js - About 1 hr to fix

            Avoid too many return statements within this function.
            Open

                        if ( !s ) { return true; }
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      if ( !s.data.match(/_ajax_nonce=[a-f0-9]+/) ) { return true; }
              Severity: Major
              Found in Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return false;
                Severity: Major
                Found in Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return false;
                  Severity: Major
                  Found in Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js - About 30 mins to fix

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

                                if ( $.isFunction(s.dimAfter) ) {
                                    o = this.complete;
                                    this.complete = function(x,st) {
                                        element.queue( function() {
                                            var _s = $.extend( { xml: x, status: st, parsed: res }, s );
                    Severity: Major
                    Found in Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js and 1 other location - About 5 hrs to fix
                    Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js on lines 162..171

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

                    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 ( $.isFunction(s.delAfter) ) {
                                    o = this.complete;
                                    this.complete = function(x,st) {
                                        element.queue( function() {
                                            var _s = $.extend( { xml: x, status: st, parsed: res }, s );
                    Severity: Major
                    Found in Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js and 1 other location - About 5 hrs to fix
                    Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js on lines 229..238

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

                    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 ( cls[3] ) { s.delColor = '#' + cls[3]; }
                            else { s.delColor = s.delColor || '#faa'; }
                    Severity: Major
                    Found in Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js and 3 other locations - About 55 mins to fix
                    Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js on lines 60..61
                    Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js on lines 186..187
                    Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js on lines 188..189

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

                    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 ( cls[3] ) { s.addColor = '#' + cls[3]; }
                            else { s.addColor = s.addColor || '#FFFF33'; }
                    Severity: Major
                    Found in Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js and 3 other locations - About 55 mins to fix
                    Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js on lines 124..125
                    Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js on lines 186..187
                    Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js on lines 188..189

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

                    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 ( cls[4] ) { s.dimAddColor = '#' + cls[4]; }
                            else { s.dimAddColor = s.dimAddColor || '#FFFF33'; }
                    Severity: Major
                    Found in Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js and 3 other locations - About 55 mins to fix
                    Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js on lines 60..61
                    Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js on lines 124..125
                    Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js on lines 188..189

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

                    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 ( cls[5] ) { s.dimDelColor = '#' + cls[5]; }
                            else { s.dimDelColor = s.dimDelColor || '#FF3333'; }
                    Severity: Major
                    Found in Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js and 3 other locations - About 55 mins to fix
                    Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js on lines 60..61
                    Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js on lines 124..125
                    Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js on lines 186..187

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

                    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

                            $("[class^=delete:" + list.id + ":]", el || null).click( function() { return list.wpList.del(this); } );
                    Severity: Minor
                    Found in Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js and 1 other location - About 50 mins to fix
                    Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js on lines 320..320

                    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

                            $("[class^=dim:" + list.id + ":]", el || null).click( function() { return list.wpList.dim(this); } );
                    Severity: Minor
                    Found in Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js and 1 other location - About 50 mins to fix
                    Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js on lines 319..319

                    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 ( $.isFunction(s.addBefore) ) {
                                s = s.addBefore( s );
                                if ( !s ) { return true; }
                            }
                    Severity: Minor
                    Found in Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js and 1 other location - About 35 mins to fix
                    Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js on lines 202..205

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 46.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

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

                            if ( $.isFunction(s.dimBefore) ) {
                                s = s.dimBefore( s );
                                if ( !s ) { return true; }
                            }
                    Severity: Minor
                    Found in Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js and 1 other location - About 35 mins to fix
                    Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js on lines 81..84

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 46.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    There are no issues that match your filters.

                    Category
                    Status