CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

Function escape has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    function escape(&$array) {
        global $wpdb;

        foreach ($array as $k => $v) {
                if (is_array($v)) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-app.php - About 45 mins 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

Avoid deeply nested control flow statements.
Open

                                if ( ! current_user_can( 'delete_users' ) )
                                    wp_die( __( 'You do not have permission to access this page.' ) );
Severity: Major
Found in Web.Admin/2014/wordpress/wp-admin/network/users.php - About 45 mins to fix

    Method confirm_blog_signup has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function confirm_blog_signup( $domain, $path, $blog_title, $user_name = '', $user_email = '', $meta = array() ) {
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-signup.php - About 45 mins to fix

      Function wp_update_comment has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function wp_update_comment($commentarr) {
          global $wpdb;
      
          // First, get all of the original fields
          $comment = get_comment($commentarr['comment_ID'], ARRAY_A);
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/comment.php - About 45 mins 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 submit_nonspam_comment has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function submit_nonspam_comment( $comment_id ) {
              global $wpdb, $current_user, $current_site;
      
              $comment_id = (int) $comment_id;
      
      

      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_blacklist_check has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function wp_blacklist_check($author, $email, $url, $comment, $user_ip, $user_agent) {
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/comment.php - About 45 mins to fix

        Function akismet_recheck_queue has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        function akismet_recheck_queue() {
            global $wpdb, $akismet_api_host, $akismet_api_port;
        
            if ( ! ( isset( $_GET['recheckqueue'] ) || ( isset( $_REQUEST['action'] ) && 'akismet_recheck_queue' == $_REQUEST['action'] ) ) )
                return;
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-content/plugins/akismet/akismet.php - About 45 mins 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 bail_on_activation has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            private static function bail_on_activation( $message, $deactivate = true ) {
        ?>
        <!doctype html>
        <html>
        <head>
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-content/plugins/akismet/class.akismet.php - About 45 mins 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 hide_the_featured_term has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function hide_the_featured_term( $terms, $id, $taxonomy ) {
        
                // This filter is only appropriate on the front-end.
                if ( is_admin() ) {
                    return $terms;

        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_blacklist_check has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        function wp_blacklist_check($author, $email, $url, $comment, $user_ip, $user_agent) {
            do_action('wp_blacklist_check', $author, $email, $url, $comment, $user_ip, $user_agent);
        
            $mod_keys = trim( get_option('blacklist_keys') );
            if ( '' == $mod_keys )
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/comment.php - About 45 mins 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 hide_featured_term has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function hide_featured_term( $terms, $taxonomies ) {
        
                // This filter is only appropriate on the front-end.
                if ( is_admin() ) {
                    return $terms;

        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_getPostTypes has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            function wp_getPostTypes( $args ) {
                if ( ! $this->minimum_args( $args, 3 ) )
                    return $this->error;
        
                $this->escape( $args );
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 45 mins 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

        Avoid deeply nested control flow statements.
        Open

                                if ( is_dir( $subdir . '/' . $theme_subdir) && is_readable($subdir . '/' . $theme_subdir) ) {
                                    if ( $theme_subdir{0} == '.' || $theme_subdir == 'CVS' )
                                        continue;
        
                                    $stylish_dir = @opendir($subdir . '/' . $theme_subdir);
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/theme.php - About 45 mins to fix

          Function wp_getTaxonomies has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              function wp_getTaxonomies( $args ) {
                  if ( ! $this->minimum_args( $args, 3 ) )
                      return $this->error;
          
                  $this->escape( $args );
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 45 mins 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

          Avoid deeply nested control flow statements.
          Open

                                  if ( preg_match('|\.php$|', $subfile) )
                                      $template_files[] = "$template_directory/$file/$subfile";
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/theme.php - About 45 mins to fix

            Function get_the_generator has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            function get_the_generator( $type ) {
                switch ($type) {
                    case 'html':
                        $gen = '<meta name="generator" content="WordPress ' . get_bloginfo( 'version' ) . '">';
                        break;
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/general-template.php - About 45 mins 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_deleteTerm has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                function wp_deleteTerm( $args ) {
                    if ( ! $this->minimum_args( $args, 5 ) )
                        return $this->error;
            
                    $this->escape( $args );
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 45 mins 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_getComments has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                function wp_getComments($args) {
                    $this->escape($args);
            
                    $blog_id    = (int) $args[0];
                    $username    = $args[1];
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 45 mins 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

            Avoid deeply nested control flow statements.
            Open

                                    if ( preg_match('|^\.+$|', $subfile) )
                                        continue;
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-includes/theme.php - About 45 mins to fix

              Function wp_update_term_count has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              function wp_update_term_count( $terms, $taxonomy, $do_deferred=false ) {
                  static $_deferred = array();
              
                  if ( $do_deferred ) {
                      foreach ( (array) array_keys($_deferred) as $tax ) {
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-includes/taxonomy.php - About 45 mins 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

              Severity
              Category
              Status
              Source
              Language