CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

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

            library.validator = function( attachment ) {
                return !! this.mirroring.get( attachment.cid ) && ! edit.get( attachment.cid ) && media.model.Selection.prototype.validator.apply( this, arguments );
            };
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/js/media-views.js and 1 other location - About 2 hrs to fix
Web.Admin/2014/wordpress/wp-includes/js/media-views.js on lines 1076..1078

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

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

var Try = {
  these: function() {
    var returnValue;

    for (var i = 0, length = arguments.length; i < length; i++) {
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/js/prototype.js and 1 other location - About 2 hrs to fix
Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/prototype.js on lines 263..277

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

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 (!edCheckOpenTags(i) || edButtons[i].tagEnd == '') {
                myField.value = myField.value.substring(0, startPos)
                              + edButtons[i].tagStart
                              + myField.value.substring(endPos, myField.value.length);
                edAddTag(i);
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/js/quicktags.dev.js and 1 other location - About 2 hrs to fix
Web.Admin/2014/wordpress/wp-includes/js/quicktags.dev.js on lines 308..314

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

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

            library.validator = function( attachment ) {
                return !! this.mirroring.get( attachment.cid ) && ! edit.get( attachment.cid ) && media.model.Selection.prototype.validator.apply( this, arguments );
            };
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/js/media-views.js and 1 other location - About 2 hrs to fix
Web.Admin/2014/wordpress/wp-includes/js/media-views.js on lines 907..909

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

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 {
                myField.value = myField.value.substring(0, startPos)
                              + edButtons[i].tagEnd
                              + myField.value.substring(endPos, myField.value.length);
                edRemoveTag(i);
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/js/quicktags.dev.js and 1 other location - About 2 hrs to fix
Web.Admin/2014/wordpress/wp-includes/js/quicktags.dev.js on lines 301..307

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

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

File Locator.php has 289 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * SimplePie
 *
 * A PHP-Based RSS and Atom Feed Framework.
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Locator.php - About 2 hrs to fix

    Function updateText has 73 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function updateText() {
                var attemptedDate, originalDate, currentDate, publishOn, postStatus = $('#post_status'),
                    optPublish = $('option[value=publish]', postStatus), aa = $('#aa').val(),
                    mm = $('#mm').val(), jj = $('#jj').val(), hh = $('#hh').val(), mn = $('#mn').val();
    
    
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-admin/js/post.dev.js - About 2 hrs to fix

      Function addMethods has 73 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Element.addMethods = function(methods) {
        var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag;
      
        if (!methods) {
          Object.extend(Form, Form.Methods);
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/js/prototype.js - About 2 hrs to fix

        Function addMethods has 73 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Element.addMethods = function(methods) {
          var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag;
        
          if (!methods) {
            Object.extend(Form, Form.Methods);
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/prototype.js - About 2 hrs to fix

          Method bulk_edit_posts has 73 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function bulk_edit_posts( $post_data = null ) {
              global $wpdb;
          
              if ( empty($post_data) )
                  $post_data = &$_POST;
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-admin/includes/post.php - About 2 hrs to fix

            Method link_xfn_meta_box has 73 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function link_xfn_meta_box($link) {
            ?>
            <table class="editform" style="width: 100%;" cellspacing="2" cellpadding="5">
                <tr>
                    <th style="width: 20%;" scope="row"><label for="link_rel"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('rel:') ?></label></th>
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-admin/includes/meta-boxes.php - About 2 hrs to fix

              Method dispatch has 73 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function dispatch()
                  {
              
                      if (empty ($_GET['step']))
                          $step = 0;
              Severity: Major
              Found in Web.Admin/2014/wordpress/wp-admin/import/dotclear.php - About 2 hrs to fix

                Function keyHandler has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                    keyHandler : function(evt) {
                        keyCode = evt.keyCode;    
                        charCode = evt.charCode;
                        fromChar = String.fromCharCode(charCode);
                
                
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-includes/js/codepress/engines/gecko.js - About 2 hrs 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 edInsertTag has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                function edInsertTag(myField, i) {
                    //IE support
                    if (document.selection) {
                        myField.focus();
                        var sel = document.selection.createRange();
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-includes/js/quicktags.dev.js - About 2 hrs 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 dirlist has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                    function dirlist($path = '.', $include_hidden = true, $recursive = false ) {
                        if ( $this->is_file($path) ) {
                            $limit_file = basename($path);
                            $path = dirname($path) . '/';
                        } else {

                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 prepare_items has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                    function prepare_items() {
                        global $status, $totals, $page, $orderby, $order, $s;
                
                        wp_reset_vars( array( 'orderby', 'order', 's' ) );
                
                

                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 favorite_actions has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                function favorite_actions( $screen = null ) {
                    switch ( $screen ) {
                        case 'post-new.php':
                            $default_action = array('edit.php' => array(__('Edit Posts'), 'edit_posts'));
                            break;
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 2 hrs 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 _page_rows has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                    function _page_rows( &$children_pages, &$count, $parent, $level, $pagenum, $per_page ) {
                
                        if ( ! isset( $children_pages[$parent] ) )
                            return;
                
                

                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 wp_doc_link_parse has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                function wp_doc_link_parse( $content ) {
                    if ( !is_string( $content ) || empty( $content ) )
                        return array();
                
                    if ( !function_exists('token_get_all') )
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-admin/includes/misc.php - About 2 hrs 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 step1 has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                    function step1() {
                        global $verified;
                        set_time_limit( 0 );
                        update_option( 'ljapi_step', 1 );
                        if ( !$this->ixr ) $this->ixr = new IXR_Client( $this->ixr_url, false, 80, 30 );
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-admin/import/livejournal.php - About 2 hrs 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

                Severity
                Category
                Status
                Source
                Language