CaffGeek/MBACNationals

View on GitHub

Showing 5,566 of 7,504 total issues

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

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

function register_new_user($user_login, $user_email) {
    $errors = new WP_Error();

    $user_login = sanitize_user( $user_login );
    $user_email = apply_filters( 'user_registration_email', $user_email );
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-login.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 authenticate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    function authenticate() {
        log_app("authenticate()",print_r($_ENV, true));

        // if using mod_rewrite/ENV hack
        // http://www.besthostratings.com/articles/http-auth-php-cgi.html
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

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

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

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

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

        function set_custom_fields($post_id, $fields) {
            $post_id = (int) $post_id;
    
            foreach ( (array) $fields as $meta ) {
                if ( isset($meta['id']) ) {
    Severity: Minor
    Found in Web.Admin/2014/wordpress/xmlrpc.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

    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

      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_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('|\.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

          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_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
              Severity
              Category
              Status
              Source
              Language