CaffGeek/MBACNationals

View on GitHub
Web.Admin/2014/wordpress/wp-admin/js/inline-edit-post.dev.js

Summary

Maintainability
D
1 day
Test Coverage

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

    edit : function(id) {
        var t = this, fields, editRow, rowData, cats, status, pageOpt, f, pageLevel, nextPage, pageLoop = true, nextLevel, tax;
        t.revert();

        if ( typeof(id) == 'object' )
Severity: Major
Found in Web.Admin/2014/wordpress/wp-admin/js/inline-edit-post.dev.js - About 2 hrs to fix

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

        init : function() {
            var t = this, qeRow = $('#inline-edit'), bulkRow = $('#bulk-edit');
    
            t.type = $('table.widefat').hasClass('page') ? 'page' : 'post';
            t.what = '#'+t.type+'-';
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-admin/js/inline-edit-post.dev.js - About 1 hr to fix

      Function save has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          save : function(id) {
              var params, fields, page = $('.post_status_page').val() || '';
      
              if( typeof(id) == 'object' )
                  id = this.getId(id);
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-admin/js/inline-edit-post.dev.js - About 1 hr to fix

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

            getId : function(o) {
                var id = o.tagName == 'TR' ? o.id : $(o).parents('tr').attr('id'), parts = id.split('-');
                return parts[parts.length - 1];
            }
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-admin/js/inline-edit-post.dev.js and 1 other location - About 2 hrs to fix
        Web.Admin/2014/wordpress/wp-admin/js/inline-edit-tax.dev.js on lines 112..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 84.

        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

            toggle : function(el) {
                var t = this;
                $(t.what+t.getId(el)).css('display') == 'none' ? t.revert() : t.edit(el);
            },
        Web.Admin/2014/wordpress/wp-admin/js/inline-edit-tax.dev.js on lines 29..32

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

        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

                $('span.cathide').click(function() {
                    $('.inline-editor ul.cat-checklist').removeClass("cat-hover");
                    $('.inline-editor span.catshow').show();
                    $(this).hide();
                });
        Web.Admin/2014/wordpress/wp-admin/js/inline-edit-post.dev.js on lines 40..44

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

        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

                $('span.catshow').click(function() {
                    $('.inline-editor ul.cat-checklist').addClass("cat-hover");
                    $('.inline-editor span.cathide').show();
                    $(this).hide();
                });
        Web.Admin/2014/wordpress/wp-admin/js/inline-edit-post.dev.js on lines 46..50

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

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

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

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

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

        Refactorings

        Further Reading

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

                $('#post-query-submit').click(function(e){
                    if ( $('form#posts-filter tr.inline-editor').length > 0 )
                        t.revert();
                });
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-admin/js/inline-edit-post.dev.js and 2 other locations - About 35 mins to fix
        Web.Admin/2014/wordpress/wp-admin/js/edit-comments.dev.js on lines 245..248
        Web.Admin/2014/wordpress/wp-admin/js/inline-edit-tax.dev.js on lines 23..26

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

        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

                $('td', qeRow).keydown(function(e) { if ( e.which == 13 ) return inlineEditPost.save(this); });
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-admin/js/inline-edit-post.dev.js and 1 other location - About 30 mins to fix
        Web.Admin/2014/wordpress/wp-admin/js/inline-edit-tax.dev.js on lines 21..21

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

        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

                $('#bulk-title-div').parents('fieldset').after(
                    $('#inline-edit fieldset.inline-edit-categories').clone()
                ).siblings( 'fieldset:last' ).prepend(
                    $('#inline-edit label.inline-edit-tags').clone()
                );
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-admin/js/inline-edit-post.dev.js and 1 other location - About 30 mins to fix
        Web.Admin/2014/wordpress/wp-admin/js/post.dev.js on lines 301..304

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

        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