CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

Function wp_sprintf has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

function wp_sprintf( $pattern ) {
    $args = func_get_args( );
    $len = strlen($pattern);
    $start = 0;
    $result = '';
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/formatting.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 get_comment_class has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

function get_comment_class( $class = '', $comment_id = null, $post_id = null ) {
    global $comment_alt, $comment_depth, $comment_thread_alt;

    $comment = get_comment($comment_id);

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/comment-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

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

    if ( $test_type ) {
        $wp_filetype = wp_check_filetype( $file['name'], $mimes );

        extract( $wp_filetype );

Severity: Major
Found in Web.Admin/2014/wordpress/wp-admin/includes/file.php and 1 other location - About 2 hrs to fix
Web.Admin/2014/wordpress/wp-admin/includes/file.php on lines 287..302

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

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

function is_category ($category = '') {
    global $wp_query;

    if ( !$wp_query->is_category )
        return false;
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/query.php and 2 other locations - About 2 hrs to fix
Web.Admin/2014/wordpress/wp-includes/query.php on lines 137..158
Web.Admin/2014/wordpress/wp-includes/query.php on lines 478..499

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

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

function is_single ($post = '') {
    global $wp_query;

    if ( !$wp_query->is_single )
        return false;
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/query.php and 2 other locations - About 2 hrs to fix
Web.Admin/2014/wordpress/wp-includes/query.php on lines 137..158
Web.Admin/2014/wordpress/wp-includes/query.php on lines 172..193

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

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

function is_author ($author = '') {
    global $wp_query;

    if ( !$wp_query->is_author )
        return false;
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/query.php and 2 other locations - About 2 hrs to fix
Web.Admin/2014/wordpress/wp-includes/query.php on lines 172..193
Web.Admin/2014/wordpress/wp-includes/query.php on lines 478..499

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

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 if ( is_singular() && get_the_author_meta( 'description' ) && is_multi_author() ) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries. ?>
                <div class="author-info">
                    <div class="author-avatar">
                        <?php
                        /** This filter is documented in author.php */
Web.Admin/2014/wordpress/wp-content/themes/twentythirteen/author-bio.php on lines 1..34

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

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 strip_comments($data)
    {
        $output = '';
        while (($start = strpos($data, '<!--')) !== false)
        {
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php and 1 other location - About 2 hrs to fix
Web.Admin/2014/wordpress/wp-includes/SimplePie/Misc.php on lines 1726..1742

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

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
/**
 * The template for displaying Author bios
 *
 * @package WordPress
Web.Admin/2014/wordpress/wp-content/themes/twentytwelve/content.php on lines 52..71

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

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 static function strip_comments($data)
    {
        $output = '';
        while (($start = strpos($data, '<!--')) !== false)
        {
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Misc.php and 1 other location - About 2 hrs to fix
Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 10828..10844

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

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

    if ( $test_type ) {
        $wp_filetype = wp_check_filetype( $file['name'], $mimes );

        extract( $wp_filetype );

Severity: Major
Found in Web.Admin/2014/wordpress/wp-admin/includes/file.php and 1 other location - About 2 hrs to fix
Web.Admin/2014/wordpress/wp-admin/includes/file.php on lines 395..408

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

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 thickbox.js has 274 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Thickbox 3.1 - One Box To Rule Them All.
 * By Cody Lindley (http://www.codylindley.com)
 * Copyright (c) 2007 cody lindley
 * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/js/thickbox/thickbox.js - About 2 hrs to fix

    File settings.php has 274 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * Multisite network settings administration panel.
     *
     * @package WordPress
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-admin/network/settings.php - About 2 hrs to fix

      Function PageVisitTimeManager has 64 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  var PageVisitTimeManager = (function () {
                      function PageVisitTimeManager(pageVisitTimeTrackingHandler) {
                          this.prevPageVisitDataKeyName = "prevPageVisitData";
                          this.pageVisitTimeTrackingHandler = pageVisitTimeTrackingHandler;
                      }
      Severity: Major
      Found in Web.Admin/z-scripts/ai.0.15.0-build46802.js - About 2 hrs to fix

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

            this.add = function(combi, options, callback) {
                if (jQuery.isFunction(options)){
                    callback = options;
                    options = {};
                }
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/js/jquery/jquery.hotkeys.dev.js - About 2 hrs to fix

          Method hash_data has 64 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function hash_data($file, $offset, $end, $algorithm) {
                  static $tempdir = '';
                  if (!self::intValueSupported($end)) {
                      return false;
                  }
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 2 hrs to fix

            Method load has 64 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function load()
                {
                    if ($this->mysql === null)
                    {
                        return false;
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Cache/MySQL.php - About 2 hrs to fix

              Method _shiftBoundaries has 64 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function _shiftBoundaries($lines, &$changed, $other_changed)
                  {
                      $i = 0;
                      $j = 0;
              
              
              Severity: Major
              Found in Web.Admin/2014/wordpress/wp-includes/Text/Diff/Engine/native.php - About 2 hrs to fix

                Method get_avatar has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function get_avatar( $id_or_email, $size = '96', $default = '', $alt = false ) {
                    if ( ! get_option('show_avatars') )
                        return false;
                
                    if ( false === $alt)
                Severity: Major
                Found in Web.Admin/2014/wordpress/wp-includes/pluggable.php - About 2 hrs to fix

                  Method Uncompress has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function Uncompress($ip)
                      {
                          $uip = SimplePie_Net_IPv6::removeNetmaskSpec($ip);
                          $c1 = -1;
                          $c2 = -1;
                  Severity: Major
                  Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php - About 2 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language