CaffGeek/MBACNationals

View on GitHub

Showing 5,566 of 7,504 total issues

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

function add_utility_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/plugin.php - About 45 mins to fix

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

    function add_submenu_page( $parent, $page_title, $menu_title, $access_level, $file, $function = '' ) {
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-admin/includes/plugin.php - About 45 mins to fix

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

      function wp_ajax_send_link_to_editor() {
          check_ajax_referer( 'media-send-to-editor', 'nonce' );
      
          if ( ! $src = wp_unslash( $_POST['src'] ) )
              wp_send_json_error();
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-admin/includes/ajax-actions.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 add_object_page has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function add_object_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') {
      Severity: Minor
      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, -4) == '.php' )
                                    $plugin_files[] = "$file/$subfile";
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-admin/includes/plugin.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 prepare_query has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              function prepare_query() {
                  global $wpdb;
                  $this->first_user = ($this->page - 1) * $this->users_per_page;
          
                  $this->query_limit = $wpdb->prepare(" LIMIT %d, %d", $this->first_user, $this->users_per_page);
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-admin/includes/deprecated.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_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

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

            function wp_ajax_set_post_thumbnail() {
                $json = ! empty( $_REQUEST['json'] ); // New-style request
            
                $post_ID = intval( $_POST['post_id'] );
                if ( ! current_user_can( 'edit_post', $post_ID ) )
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-admin/includes/ajax-actions.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 _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 (($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 ( ! 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

                    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

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

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

                            Severity
                            Category
                            Status
                            Source
                            Language