CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

Function paged_walk has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

    function paged_walk( $elements, $max_depth, $page_num, $per_page ) {

        /* sanity check */
        if ( empty($elements) || $max_depth < -1 )
            return '';
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-walker.php - About 7 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 paged_walk has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

    function paged_walk( $elements, $max_depth, $page_num, $per_page ) {

        /* sanity check */
        if ( empty($elements) || $max_depth < -1 )
            return '';
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/classes.php - About 7 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

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

                    if ( $comment_status && 'all' != $comment_status ) { // not looking at all comments
                        if ( 'approved' == $the_comment_status )
                            $actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&amp;new=unapproved vim-u vim-destructive' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
                        else if ( 'unapproved' == $the_comment_status )
                            $actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&amp;new=approved vim-a vim-destructive' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
Severity: Major
Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php and 1 other location - About 7 hrs to fix
Web.Admin/2014/wordpress/wp-admin/includes/class-wp-comments-list-table.php on lines 439..447

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

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

    public function do_strip_htmltags($match)
    {
        if ($this->encode_instead_of_strip)
        {
            if (isset($match[4]) && !in_array(strtolower($match[1]), array('script', 'style')))
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Sanitize.php and 1 other location - About 7 hrs to fix
Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 14975..14998

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

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

<?php
/**
 * Twenty Fourteen back compat functionality
 *
 * Prevents Twenty Fourteen from running on WordPress versions prior to 3.6,
Web.Admin/2014/wordpress/wp-content/themes/twentythirteen/inc/back-compat.php on lines 1..63

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

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

    function do_strip_htmltags($match)
    {
        if ($this->encode_instead_of_strip)
        {
            if (isset($match[4]) && !in_array(strtolower($match[1]), array('script', 'style')))
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php and 1 other location - About 7 hrs to fix
Web.Admin/2014/wordpress/wp-includes/SimplePie/Sanitize.php on lines 434..457

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

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

<?php
/**
 * Twenty Thirteen back compat functionality
 *
 * Prevents Twenty Thirteen from running on WordPress versions prior to 3.6,
Web.Admin/2014/wordpress/wp-content/themes/twentyfourteen/inc/back-compat.php on lines 1..63

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

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 ( $comment_status && 'all' != $comment_status ) { // not looking at all comments
                if ( 'approved' == $the_comment_status )
                    $actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&amp;new=unapproved' class='vim-u vim-destructive' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
                else if ( 'unapproved' == $the_comment_status )
                    $actions['approve'] = "<a href='$approve_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&amp;new=approved' class='vim-a vim-destructive' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
Web.Admin/2014/wordpress/wp-admin/includes/template.php on lines 2174..2182

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

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

Method request has 185 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function request($url, $args = array()) {
        $defaults = array(
            'method' => 'GET', 'timeout' => 5,
            'redirection' => 5, 'httpversion' => '1.0',
            'blocking' => true,
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/class-http.php - About 7 hrs to fix

    File plugins.php has 474 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * Plugins administration panel.
     *
     * @package WordPress
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-admin/plugins.php - About 7 hrs to fix

      File category-template.php has 474 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * Category Template Tags and API.
       *
       * @package WordPress
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/category-template.php - About 7 hrs to fix

        Method network_step2 has 184 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function network_step2( $errors = false ) {
            global $wpdb;
        
            $hostname          = get_clean_basedomain();
            $slashed_home      = trailingslashit( get_option( 'home' ) );
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-admin/network.php - About 7 hrs to fix

          Consider simplifying this complex logical expression.
          Open

                      if (sizeof($this->data['enclosures']) === 0 && ($url || $type || $length || $bitrate || $captions_parent || $categories_parent || $channels || $copyrights_parent || $credits_parent || $description_parent || $duration_parent || $expression || $framerate || $hashes_parent || $height || $keywords_parent || $lang || $medium || $player_parent || $ratings_parent || $restrictions_parent || $samplingrate || $thumbnails_parent || $title_parent || $width))
                      {
                          // Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor
                          $this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width));
                      }
          Severity: Critical
          Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Item.php - About 7 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                        if (sizeof($this->data['enclosures']) === 0 && ($url || $type || $length || $bitrate || $captions_parent || $categories_parent || $channels || $copyrights_parent || $credits_parent || $description_parent || $duration_parent || $expression || $framerate || $hashes_parent || $height || $keywords_parent || $lang || $medium || $player_parent || $ratings_parent || $restrictions_parent || $samplingrate || $thumbnails_parent || $title_parent || $width))
                        {
                            // Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor
                            $this->data['enclosures'][] =& new $this->feed->enclosure_class($url, $type, $length, $this->feed->javascript, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width);
                        }
            Severity: Critical
            Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php - About 7 hrs to fix

              File editimage.js has 472 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              
              var tinymce = null, tinyMCEPopup, tinyMCE;
              
              tinyMCEPopup = {
                  init: function() {

                Function Coords has 183 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    var Coords = function()/*{{{*/
                    {
                        var x1 = 0, y1 = 0, x2 = 0, y2 = 0, ox, oy;
                
                        function setPressed(pos)/*{{{*/
                Severity: Major
                Found in Web.Admin/2014/wordpress/wp-includes/js/jcrop/jquery.Jcrop.dev.js - About 7 hrs to fix

                  File ms.php has 471 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  /**
                   * Multisite administration functions.
                   *
                   * @package WordPress
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-admin/includes/ms.php - About 7 hrs to fix

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

                                            for (var i = 0; i < $scope.model.Away.Bowlers.length; i++) {
                                                var awayBowlerResult = $.grep(match.Away.Bowlers, function (x) { return x.Id == $scope.model.Away.Bowlers[i].Id });
                                                if (awayBowlerResult.length) {
                                                    $scope.model.Away.Bowlers[i].Score = awayBowlerResult[0].Score;
                                                    $scope.model.Away.Bowlers[i].Position = awayBowlerResult[0].Position;
                    Severity: Major
                    Found in Web.Admin/AdminApp/Controllers/controller.scoreentry.js and 1 other location - About 7 hrs to fix
                    Web.Admin/AdminApp/Controllers/controller.scoreentry.js on lines 76..82

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

                    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

                                            for (var i = 0; i < $scope.model.Home.Bowlers.length; i++) {
                                                var homeBowlerResult = $.grep(match.Home.Bowlers, function (x) { return x.Id == $scope.model.Home.Bowlers[i].Id });
                                                if (homeBowlerResult.length) {
                                                    $scope.model.Home.Bowlers[i].Score = homeBowlerResult[0].Score;
                                                    $scope.model.Home.Bowlers[i].Position = homeBowlerResult[0].Position;
                    Severity: Major
                    Found in Web.Admin/AdminApp/Controllers/controller.scoreentry.js and 1 other location - About 7 hrs to fix
                    Web.Admin/AdminApp/Controllers/controller.scoreentry.js on lines 68..74

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

                    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

                    Function _show has 182 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        _show : function() {
                    
                            // shortcuts
                            var self = this,
                                queue = this._queue[ 0 ],
                    Severity: Major
                    Found in Web.Admin/2015/js/galleria/galleria-1.4.2.js - About 7 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language