CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

Avoid deeply nested control flow statements.
Open

                        while (($subfile = readdir( $plugins_subdir ) ) !== false ) {
                            if ( substr($subfile, 0, 1) == '.' )
                                continue;
                            $plugin_files[] = plugin_basename("$dir/$file/$subfile");
                        }
Severity: Major
Found in Web.Admin/2014/wordpress/wp-admin/includes/plugin.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if ( substr($subfile, 0, 1) == '.' )
                                continue;
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-admin/includes/plugin.php - About 45 mins to fix

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

          function _page_rows( &$children_pages, &$count, $parent, $level, $pagenum, $per_page ) {
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-posts-list-table.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if ( isset( $ordered_menu_item_object->menu_order ) ) {
                                    $dbids_to_orders[$ordered_menu_item_object->ID] = $ordered_menu_item_object->menu_order;
                                    $orders_to_dbids[$ordered_menu_item_object->menu_order] = $ordered_menu_item_object->ID;
                                }
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-admin/nav-menus.php - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if ( isset( $ordered_menu_item_object->menu_order ) ) {
                                      $dbids_to_orders[$ordered_menu_item_object->ID] = $ordered_menu_item_object->menu_order;
                                      $orders_to_dbids[$ordered_menu_item_object->menu_order] = $ordered_menu_item_object->ID;
                                  }
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-admin/nav-menus.php - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if ( ! is_wp_error( $parent_object ) ) {
                                        $parent_data = (array) $parent_object;
                                        $menu_item_data['menu_item_parent'] = $parent_data['menu_item_parent'];
                                        update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] );
            
            
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-admin/nav-menus.php - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  if (
                                      ! empty( $menu_item_data['menu_item_parent'] ) &&
                                      in_array( $menu_item_data['menu_item_parent'], array_keys( $dbids_to_orders ) ) &&
                                      isset( $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] ) &&
                                      ( $menu_item_data['menu_item_parent'] == $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] )
              Severity: Major
              Found in Web.Admin/2014/wordpress/wp-admin/nav-menus.php - About 45 mins to fix

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

                    function get_authors_from_post() {
                        $formnames = array ();
                        $selectnames = array ();
                
                        foreach ($_POST['user'] as $key => $line) {
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-admin/import/mt.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 dispatch has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    function dispatch() {
                        if (empty ($_GET['step']))
                            $step = 0;
                        else
                            $step = (int) $_GET['step'];
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-admin/import/wordpress.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 (($commentinfo[11]=="PM") && ($commenthour!="12"))
                                        $commenthour=$commenthour+12;
                Severity: Major
                Found in Web.Admin/2014/wordpress/wp-admin/import/greymatter.php - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if ($i<10000) {
                                          $entryfile .= "0";
                                          if ($i<1000) {
                                              $entryfile .= "0";
                                              if ($i<100) {
                  Severity: Major
                  Found in Web.Admin/2014/wordpress/wp-admin/import/greymatter.php - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        if (!comment_exists($comment_author, $comment_date)) {
                                            $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_author_email', 'comment_author_IP', 'comment_date', 'comment_content', 'comment_approved');
                                            $commentdata = wp_filter_comment($commentdata);
                                            wp_insert_comment($commentdata);
                                            $numAddedComments++;
                    Severity: Major
                    Found in Web.Admin/2014/wordpress/wp-admin/import/greymatter.php - About 45 mins to fix

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

                      function wp_credits() {
                          global $wp_version;
                          $locale = get_locale();
                      
                          $results = get_site_transient( 'wordpress_credits_' . $locale );
                      Severity: Minor
                      Found in Web.Admin/2014/wordpress/wp-admin/credits.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

                      Avoid deeply nested control flow statements.
                      Open

                                  if ( !isset($_SERVER['HTTP_ACCEPT_ENCODING']) )
                                      die('-1');
                      Severity: Major
                      Found in Web.Admin/2014/wordpress/wp-admin/admin-ajax.php - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                        if ( is_super_admin( $user->ID ) )
                                                            wp_die( sprintf( __( 'Warning! User cannot be modified. The user %s is a network administrator.' ), esc_html( $user->user_login ) ) );
                        Severity: Major
                        Found in Web.Admin/2014/wordpress/wp-admin/network/users.php - About 45 mins to fix

                          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

                          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

                            Avoid deeply nested control flow statements.
                            Open

                                                                if ( $details->userblog_id != $current_site->blog_id ) // main blog not a spam !
                                                                    update_blog_status( $details->userblog_id, 'spam', '1' );
                            Severity: Major
                            Found in Web.Admin/2014/wordpress/wp-admin/network/users.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

                              Severity
                              Category
                              Status
                              Source
                              Language