CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

Function is_active_widget has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

function is_active_widget($callback = false, $widget_id = false, $id_base = false, $skip_inactive = true) {
    global $wp_registered_widgets;

    $sidebars_widgets = wp_get_sidebars_widgets();

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/widgets.php - About 4 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 tag_open has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    public function tag_open($parser, $tag, $attributes)
    {
        list($this->namespace[], $this->element[]) = $this->split_ns($tag);

        $attribs = array();
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Parser.php - About 4 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 check_ipv6 has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    public static function check_ipv6($ip)
    {
        $ip = self::uncompress($ip);
        list($ipv6, $ipv4) = self::split_v6_v4($ip);
        $ipv6 = explode(':', $ipv6);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Net/IPv6.php - About 4 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_the_category_list has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

function get_the_category_list( $separator = '', $parents='', $post_id = false ) {
    global $wp_rewrite;
    $categories = get_the_category( $post_id );
    if ( empty( $categories ) )
        return apply_filters( 'the_category', __( 'Uncategorized' ), $separator, $parents );
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/category-template.php - About 4 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 render has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    function render($diff)
    {
        $xi = $yi = 1;
        $block = false;
        $context = array();
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/Text/Diff/Renderer.php - About 4 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_favicon has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    function get_favicon()
    {
        if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'icon'))
        {
            return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php - About 4 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 EncodeQP has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

  function EncodeQP( $input = '', $line_max = 76, $space_conv = false ) {
    $hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
    $lines = preg_split('/(?:\r\n|\r|\n)/', $input);
    $eol = "\r\n";
    $escape = '=';
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-phpmailer.php - About 4 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 sanitize_user_field has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

function sanitize_user_field($field, $value, $user_id, $context) {
    $int_fields = array('ID');
    if ( in_array($field, $int_fields) )
        $value = (int) $value;

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/user.php - About 4 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_network_by_path has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

function get_network_by_path( $domain, $path, $segments = null ) {
    global $wpdb;

    $domains = $exact_domains = array( $domain );
    $pieces = explode( '.', $domain );
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ms-load.php - About 4 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

  assertNotOfType: function(expected, actual) {
    var message = arguments[2] || 'assertNotOfType';
    try { 
      (actual.constructor != expected) ? this.pass() : 
      this.fail(message + ': expected "' + Test.Unit.inspect(expected) +  
Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/unittest.js on lines 354..361

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

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

  assertType: function(expected, actual) {
    var message = arguments[2] || 'assertType';
    try { 
      (actual.constructor == expected) ? this.pass() : 
      this.fail(message + ': expected "' + Test.Unit.inspect(expected) +  
Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/unittest.js on lines 362..369

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

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 106 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/http.php - About 4 hrs to fix

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

                if ( current_user_can( 'delete_post', $post->ID ) )
                    if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {
                        $actions['trash'] = "<a class='submitdelete' href='" . wp_nonce_url( "post.php?action=trash&amp;post=$post->ID", 'trash-post_' . $post->ID ) . "'>" . __( 'Trash' ) . "</a>";
                    } else {
                        $delete_ays = !MEDIA_TRASH ? " onclick='return showNotice.warn();'" : '';
    Web.Admin/2014/wordpress/wp-admin/upload.php on lines 394..400

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

    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 ( current_user_can('delete_post', $post->ID) )
                if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {
                    $actions['trash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=trash&amp;post=$post->ID", 'trash-post_' . $post->ID) . "'>" . __('Trash') . "</a>";
                } else {
                    $delete_ays = !MEDIA_TRASH ? " onclick='return showNotice.warn();'" : '';
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-admin/upload.php and 1 other location - About 4 hrs to fix
    Web.Admin/2014/wordpress/wp-admin/includes/class-wp-media-list-table.php on lines 433..439

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

    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 module.audio.flac.php has 342 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /////////////////////////////////////////////////////////////////
    /// getID3() by James Heinrich <info@getid3.org>               //
    //  available at http://getid3.sourceforge.net                 //
    //            or http://www.getid3.org                         //
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.audio.flac.php - About 4 hrs to fix

      Function addWidget has 105 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              addWidget: function( widgetId ) {
                  var self = this, controlHtml, $widget, controlType = 'widget_form', $control, controlConstructor,
                      parsedWidgetId = parseWidgetId( widgetId ),
                      widgetNumber = parsedWidgetId.number,
                      widgetIdBase = parsedWidgetId.id_base,
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-admin/js/customize-widgets.js - About 4 hrs to fix

        Method display_plugins_table has 105 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function display_plugins_table($plugins, $page = 1, $totalpages = 1){
            $type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : '';
            $term = isset($_REQUEST['s']) ? stripslashes( $_REQUEST['s'] ) : '';
        
            $plugins_allowedtags = array('a' => array('href' => array(),'title' => array(), 'target' => array()),
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-admin/includes/plugin-install.php - About 4 hrs to fix

          Method analyze has 105 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function analyze($filename) {
                  try {
                      if (!$this->openfile($filename)) {
                          return $this->info;
                      }
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.php - About 4 hrs to fix

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

            function $(element) {
              if (arguments.length > 1) {
                for (var i = 0, elements = [], length = arguments.length; i < length; i++)
                  elements.push($(arguments[i]));
                return elements;
            Web.Admin/2014/wordpress/wp-includes/js/prototype.js on lines 1510..1519

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

            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

            function $(element) {
              if (arguments.length > 1) {
                for (var i = 0, elements = [], length = arguments.length; i < length; i++)
                  elements.push($(arguments[i]));
                return elements;
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-includes/js/prototype.js and 1 other location - About 4 hrs to fix
            Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/prototype.js on lines 1510..1519

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

            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

            Severity
            Category
            Status
            Source
            Language