CaffGeek/MBACNationals

View on GitHub

Showing 5,566 of 7,504 total issues

Function check_comment has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
Open

function check_comment($author, $email, $url, $comment, $user_ip, $user_agent, $comment_type) {
    global $wpdb;

    if ( 1 == get_option('comment_moderation') )
        return false; // If moderation is set to manual
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/comment.php - About 6 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 replace_invalid_with_pct_encoding has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
Open

    protected function replace_invalid_with_pct_encoding($string, $extra_chars, $iprivate = false)
    {
        // Normalize as many pct-encoded sections as possible
        $string = preg_replace_callback('/(?:%[A-Fa-f0-9]{2})+/', array($this, 'remove_iunreserved_percent_encoded'), $string);

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

    function request($url, $args = array()) {
        $defaults = array(
            'method' => 'GET', 'timeout' => 5,
            'redirection' => 5, 'httpversion' => '1.0',
            'blocking' => true,
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 6 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_body_class has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
Open

function get_body_class( $class = '' ) {
    global $wp_query, $wpdb, $current_user;

    $classes = array();

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

    function send_headers() {
        $headers = array('X-Pingback' => get_bloginfo('pingback_url'));
        $status = null;
        $exit_required = false;

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

    function _encode($var)
    {

        switch (gettype($var)) {
            case 'boolean':
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-json.php - About 6 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

Method wp_insert_post has 168 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function wp_insert_post($postarr = array(), $wp_error = false) {
    global $wpdb, $wp_rewrite, $user_ID;

    $defaults = array('post_status' => 'draft', 'post_type' => 'post', 'post_author' => $user_ID,
        'ping_status' => get_option('default_ping_status'), 'post_parent' => 0,
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/post.php - About 6 hrs to fix

    ftp_base has 48 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class ftp_base {
        /* Public variables */
        var $LocalEcho;
        var $Verbose;
        var $OS_local;
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-admin/includes/class-ftp.php - About 6 hrs to fix

      File schema.php has 444 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * WordPress Administration Scheme API
       *
       * Here we keep the DB structure and option values.
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-admin/includes/schema.php - About 6 hrs to fix

        Function svgPainter has 166 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        wp.svgPainter = ( function( $, window, document, undefined ) {
            'use strict';
            var selector, base64, painter,
                colorscheme = {},
                elements = [];
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-admin/js/svg-painter.js - About 6 hrs to fix

          Function Selection has 165 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              var Selection = function()/*{{{*/
              {
                  var start, end, dragmode, awake, hdep = 370;
                  var borders = { };
                  var handle = { };
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/js/jcrop/jquery.Jcrop.dev.js - About 6 hrs to fix

            Function id has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
            Open

                id: function(nodes, root, id, combinator) {
                  var targetNode = $(id), h = Selector.handlers;
                  if (!targetNode) return [];
                  if (!nodes && root == document) return [targetNode];
                  if (nodes) {
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/js/prototype.js - About 6 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 id has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
            Open

                id: function(nodes, root, id, combinator) {
                  var targetNode = $(id), h = Selector.handlers;
                  if (!targetNode) return [];
                  if (!nodes && root == document) return [targetNode];
                  if (nodes) {
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/prototype.js - About 6 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 confirm_delete_users has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
            Open

            function confirm_delete_users( $users ) {
                $current_user = wp_get_current_user();
                if ( !is_array( $users ) )
                    return false;
                ?>
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-admin/network/users.php - About 6 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 absolutize has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function absolutize($base, $relative)
                {
                    if (!($relative instanceof SimplePie_IRI))
                    {
                        $relative = new SimplePie_IRI($relative);
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/IRI.php - About 6 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 wp_nav_menu has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
            Open

            function wp_nav_menu( $args = array() ) {
                static $menu_id_slugs = array();
            
                $defaults = array( 'menu' => '', 'container' => 'div', 'container_class' => '', 'container_id' => '', 'menu_class' => 'menu', 'menu_id' => '',
                'echo' => true, 'fallback_cb' => 'wp_page_menu', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/nav-menu-template.php - About 6 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

            File network.php has 440 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
             * Network installation administration panel.
             *
             * A multi-step process allowing the user to enable a network of WordPress sites.
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-admin/network.php - About 6 hrs to fix

              Method start_el has 163 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
                      global $_wp_nav_menu_max_depth;
                      $_wp_nav_menu_max_depth = $depth > $_wp_nav_menu_max_depth ? $depth : $_wp_nav_menu_max_depth;
              
                      ob_start();
              Severity: Major
              Found in Web.Admin/2014/wordpress/wp-admin/includes/nav-menu.php - About 6 hrs to fix

                Method wp_tiny_mce has 163 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function wp_tiny_mce( $teeny = false, $settings = false ) {
                    global $concatenate_scripts, $compress_scripts, $tinymce_version;
                
                    if ( ! user_can_richedit() )
                        return;
                Severity: Major
                Found in Web.Admin/2014/wordpress/wp-admin/includes/post.php - About 6 hrs to fix

                  Method process_post has 163 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function process_post($post) {
                          global $wpdb;
                  
                          $post_ID = (int) $this->get_tag( $post, 'wp:post_id' );
                            if ( $post_ID && !empty($this->post_ids_processed[$post_ID]) ) // Processed already
                  Severity: Major
                  Found in Web.Admin/2014/wordpress/wp-admin/import/wordpress.php - About 6 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language