CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

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

function do_enclose( $content, $post_ID ) {
    global $wpdb;
    include_once( ABSPATH . WPINC . '/class-IXR.php' );

    $log = debug_fopen( ABSPATH . 'enclosures.log', 'a' );
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/functions.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 _changed has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    function _changed( $orig, $final ) {
        $r = '';

        // Does the aforementioned additional processing
        // *_matches tell what rows are "the same" in orig and final.  Those pairs will be diffed to get word changes
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/wp-diff.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 MailSend has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

  function MailSend($header, $body) {

    $to = '';
    for($i = 0; $i < count($this->to); $i++) {
      if($i != 0) { $to .= ', '; }
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-phpmailer.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 MsgHTML has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

  function MsgHTML($message,$basedir='') {
    preg_match_all("/(src|background)=\"(.*)\"/Ui", $message, $images);
    if(isset($images[2])) {
      foreach($images[2] as $i => $url) {
        // do not change urls for absolute images (thanks to corvuscorax)
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-phpmailer.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 update_meta_cache has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

function update_meta_cache($meta_type, $object_ids) {
    if ( empty( $meta_type ) || empty( $object_ids ) )
        return false;

    if ( ! $table = _get_meta_table($meta_type) )
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/meta.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

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

        if ( $user_id == $post_author_data->ID ) {
            // If the post is published...
            if ( 'publish' == $post->post_status ) {
                $caps[] = 'delete_published_posts';
            } elseif ( 'trash' == $post->post_status ) {
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/capabilities.php and 2 other locations - About 2 hrs to fix
Web.Admin/2014/wordpress/wp-includes/capabilities.php on lines 863..882
Web.Admin/2014/wordpress/wp-includes/capabilities.php on lines 891..910

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

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

        if ( $user_id == $post_author_data->ID ) {
            // If the post is published...
            if ( 'publish' == $post->post_status ) {
                $caps[] = 'edit_published_posts';
            } elseif ( 'trash' == $post->post_status ) {
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/capabilities.php and 2 other locations - About 2 hrs to fix
Web.Admin/2014/wordpress/wp-includes/capabilities.php on lines 793..812
Web.Admin/2014/wordpress/wp-includes/capabilities.php on lines 891..910

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

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

        if ( $user_id == $page_author_data->ID ) {
            // If the page is published...
            if ( 'publish' == $page->post_status ) {
                $caps[] = 'edit_published_pages';
            } elseif ( 'trash' == $page->post_status ) {
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/capabilities.php and 2 other locations - About 2 hrs to fix
Web.Admin/2014/wordpress/wp-includes/capabilities.php on lines 793..812
Web.Admin/2014/wordpress/wp-includes/capabilities.php on lines 863..882

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

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 ScoresCommandHandlers.cs has 288 lines of code (exceeds 250 allowed). Consider refactoring.
Open

using Edument.CQRS;
using Events.Scores;
using MBACNationals.Participant;
using MBACNationals.Scores.Commands;
using System;
Severity: Minor
Found in Aggregates/Scores/ScoresCommandHandlers.cs - About 2 hrs to fix

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

        else if (document.layers) {
            x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
            y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
            }
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/js/colorpicker.dev.js and 1 other location - About 2 hrs to fix
    Web.Admin/2014/wordpress/wp-includes/js/colorpicker.dev.js on lines 116..119

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

    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 {
                x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
                y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
                }
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/js/colorpicker.dev.js and 1 other location - About 2 hrs to fix
    Web.Admin/2014/wordpress/wp-includes/js/colorpicker.dev.js on lines 125..128

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

    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.tag.apetag.php has 287 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.tag.apetag.php - About 2 hrs to fix

      Method mw_getRecentPosts has 72 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function mw_getRecentPosts($args) {
      
              $this->escape($args);
      
              $blog_ID     = (int) $args[0];
      Severity: Major
      Found in Web.Admin/2014/wordpress/xmlrpc.php - About 2 hrs to fix

        Method __construct has 72 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function __construct() {
        
                // Check for PHP version
                $required_php_version = '5.0.5';
                if (version_compare(PHP_VERSION, $required_php_version, '<')) {
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.php - About 2 hrs to fix

          Method wp_get_sidebars_widgets has 72 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function wp_get_sidebars_widgets($deprecated = true) {
              global $wp_registered_widgets, $wp_registered_sidebars, $_wp_sidebars_widgets;
          
              // If loading from front page, consult $_wp_sidebars_widgets rather than options
              // to see if wp_convert_widget_settings() has made manipulations in memory.
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/widgets.php - About 2 hrs to fix

            Method wp_widget_rss_output has 72 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function wp_widget_rss_output( $rss, $args = array() ) {
                if ( is_string( $rss ) ) {
                    $rss = fetch_feed($rss);
                } elseif ( is_array($rss) && isset($rss['url']) ) {
                    $args = $rss;
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-includes/default-widgets.php - About 2 hrs to fix

              Method smilies_init has 72 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function smilies_init() {
                  global $wpsmiliestrans, $wp_smiliessearch;
              
                  // don't bother setting up smilies if they are disabled
                  if ( !get_option( 'use_smilies' ) )
              Severity: Major
              Found in Web.Admin/2014/wordpress/wp-includes/functions.php - About 2 hrs to fix

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

                        if ( ($max_depth == 0 || $max_depth > $depth+1 ) && isset( $children_elements[$id]) ) {
                
                            foreach( $children_elements[ $id ] as $child ){
                
                                if ( !isset($newlevel) ) {
                Severity: Major
                Found in Web.Admin/2014/wordpress/wp-includes/class-wp-walker.php and 1 other location - About 2 hrs to fix
                Web.Admin/2014/wordpress/wp-includes/classes.php on lines 846..859

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

                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 ( ($max_depth == 0 || $max_depth > $depth+1 ) && isset( $children_elements[$id]) ) {
                
                            foreach( $children_elements[ $id ] as $child ){
                
                                if ( !isset($newlevel) ) {
                Severity: Major
                Found in Web.Admin/2014/wordpress/wp-includes/classes.php and 1 other location - About 2 hrs to fix
                Web.Admin/2014/wordpress/wp-includes/class-wp-walker.php on lines 140..153

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

                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

                    getRangeAndCaret : function() {    
                        var range = window.getSelection().getRangeAt(0);
                        var range2 = range.cloneRange();
                        var node = range.endContainer;            
                        var caret = range.endOffset;
                Web.Admin/2014/wordpress/wp-includes/js/codepress/engines/gecko.js on lines 207..214

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

                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