CaffGeek/MBACNationals

View on GitHub
Web.Admin/2014/wordpress/wp-admin/includes/template.php

Summary

Maintainability
F
1 mo
Test Coverage

File template.php has 2652 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Template WordPress Administration API.
 *
 * A Big Mess. Also some neat functions that are nicely written.
Severity: Major
Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 1 wk to fix

    Function _wp_comment_row has a Cognitive Complexity of 104 (exceeds 5 allowed). Consider refactoring.
    Open

    function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, $from_ajax = false ) {
        global $comment, $post, $_comment_pending_count;
        $comment = get_comment( $comment_id );
        $post = get_post($comment->comment_post_ID);
        $the_comment_status = wp_get_comment_status($comment->comment_ID);
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 2 days 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 _post_row has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring.
    Open

    function _post_row($a_post, $pending_comments, $mode) {
        global $post, $current_user;
        static $rowclass;
    
        $global_post = $post;
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 1 day 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 display_page_row has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
    Open

    function display_page_row( $page, $level = 0 ) {
        global $post;
        static $rowclass;
    
        $post = $page;
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 1 day 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 inline_edit_row has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
    Open

    function inline_edit_row( $type ) {
        global $current_user, $mode;
    
        $is_page = 'page' == $type;
        if ( $is_page ) {
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 1 day 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 inline_edit_row has 222 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function inline_edit_row( $type ) {
        global $current_user, $mode;
    
        $is_page = 'page' == $type;
        if ( $is_page ) {
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 1 day to fix

      Method _wp_comment_row has 176 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, $from_ajax = false ) {
          global $comment, $post, $_comment_pending_count;
          $comment = get_comment( $comment_id );
          $post = get_post($comment->comment_post_ID);
          $the_comment_status = wp_get_comment_status($comment->comment_ID);
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 7 hrs to fix

        Method _post_row has 173 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function _post_row($a_post, $pending_comments, $mode) {
            global $post, $current_user;
            static $rowclass;
        
            $global_post = $post;
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 6 hrs to fix

          Function page_rows has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
          Open

          function page_rows($pages, $pagenum = 1, $per_page = 20) {
              global $wpdb;
          
              $level = 0;
          
          
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 5 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 display_page_row has 134 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function display_page_row( $page, $level = 0 ) {
              global $post;
              static $rowclass;
          
              $post = $page;
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 5 hrs to fix

            Method screen_meta has 131 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function screen_meta($screen) {
                global $wp_meta_boxes, $_wp_contextual_help;
            
                $screen = str_replace('.php', '', $screen);
                $screen = str_replace('-new', '', $screen);
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 5 hrs to fix

              Function screen_meta has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
              Open

              function screen_meta($screen) {
                  global $wp_meta_boxes, $_wp_contextual_help;
              
                  $screen = str_replace('.php', '', $screen);
                  $screen = str_replace('-new', '', $screen);
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 4 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 add_meta_box has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
              Open

              function add_meta_box($id, $title, $callback, $page, $context = 'advanced', $priority = 'default', $callback_args=null) {
                  global $wp_meta_boxes;
              
                  if ( !isset($wp_meta_boxes) )
                      $wp_meta_boxes = array();
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 4 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 do_meta_boxes has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
              Open

              function do_meta_boxes($page, $context, $object) {
                  global $wp_meta_boxes;
                  static $already_sorted = false;
              
                  //do_action('do_meta_boxes', $page, $context, $object);
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 4 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 _cat_rows has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

              function _cat_rows( $parent = 0, $level = 0, $categories, &$children, $page = 1, $per_page = 20, &$count ) {
              
                  $start = ($page - 1) * $per_page;
                  $end = $start + $per_page;
                  ob_start();
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 3 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 user_row has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
              Open

              function user_row( $user_object, $style = '', $role = '' ) {
                  global $wp_roles;
              
                  $current_user = wp_get_current_user();
              
              
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 3 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 user_row has 87 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function user_row( $user_object, $style = '', $role = '' ) {
                  global $wp_roles;
              
                  $current_user = wp_get_current_user();
              
              
              Severity: Major
              Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 3 hrs to fix

                Function _page_rows has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                function _page_rows( &$children_pages, &$count, $parent, $level, $pagenum, $per_page ) {
                
                    if ( ! isset( $children_pages[$parent] ) )
                        return;
                
                
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 3 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 link_cat_row has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function link_cat_row( $category, $name_override = false ) {
                    static $row_class = '';
                
                    if ( !$category = get_term( $category, 'link_category', OBJECT, 'display' ) )
                        return false;
                Severity: Major
                Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 3 hrs to fix

                  Method get_column_headers has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function get_column_headers($page) {
                      global $_wp_column_headers;
                  
                      if ( !isset($_wp_column_headers) )
                          $_wp_column_headers = array();
                  Severity: Major
                  Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 3 hrs to fix

                    Method favorite_actions has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function favorite_actions( $screen = null ) {
                        switch ( $screen ) {
                            case 'post-new.php':
                                $default_action = array('edit.php' => array(__('Edit Posts'), 'edit_posts'));
                                break;
                    Severity: Major
                    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 3 hrs to fix

                      Method _cat_row has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function _cat_row( $category, $level, $name_override = false ) {
                          static $row_class = '';
                      
                          $category = get_category( $category, OBJECT, 'display' );
                      
                      
                      Severity: Major
                      Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 2 hrs to fix

                        Function favorite_actions has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function favorite_actions( $screen = null ) {
                            switch ( $screen ) {
                                case 'post-new.php':
                                    $default_action = array('edit.php' => array(__('Edit Posts'), 'edit_posts'));
                                    break;
                        Severity: Minor
                        Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 2 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 link_cat_row has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function link_cat_row( $category, $name_override = false ) {
                            static $row_class = '';
                        
                            if ( !$category = get_term( $category, 'link_category', OBJECT, 'display' ) )
                                return false;
                        Severity: Minor
                        Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 2 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_get_comment_list has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0, $type = '' ) {
                            global $wpdb;
                        
                            $start = abs( (int) $start );
                            $num = (int) $num;
                        Severity: Major
                        Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 2 hrs to fix

                          Function meta_box_prefs has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function meta_box_prefs($page) {
                              global $wp_meta_boxes;
                          
                              if ( empty($wp_meta_boxes[$page]) )
                                  return;
                          Severity: Minor
                          Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 2 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 _cat_row has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function _cat_row( $category, $level, $name_override = false ) {
                              static $row_class = '';
                          
                              $category = get_category( $category, OBJECT, 'display' );
                          
                          
                          Severity: Minor
                          Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 2 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_comment_reply has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function wp_comment_reply($position = '1', $checkbox = false, $mode = 'single', $table_row = true) {
                              global $current_user;
                          
                              // allow plugin to replace the popup content
                              $content = apply_filters( 'wp_comment_reply', '', array('position' => $position, 'checkbox' => $checkbox, 'mode' => $mode) );
                          Severity: Major
                          Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 2 hrs to fix

                            Method _tag_row has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function _tag_row( $tag, $class = '', $taxonomy = 'post_tag' ) {
                                    $count = number_format_i18n( $tag->count );
                                    $tagsel = ($taxonomy == 'post_tag' ? 'tag' : $taxonomy);
                                    $count = ( $count > 0 ) ? "<a href='edit.php?$tagsel=$tag->slug'>$count</a>" : $count;
                            
                            
                            Severity: Major
                            Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 2 hrs to fix

                              Function screen_options has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function screen_options($screen) {
                                  switch ( $screen ) {
                                      case 'edit':
                                          $per_page_label = __('Posts per page:');
                                          break;
                              Severity: Minor
                              Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 2 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 parent_dropdown has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) {
                                  global $wpdb, $post_ID;
                                  $items = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' ORDER BY menu_order", $parent) );
                              
                                  if ( $items ) {
                              Severity: Minor
                              Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 2 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_get_comment_list has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0, $type = '' ) {
                                  global $wpdb;
                              
                                  $start = abs( (int) $start );
                                  $num = (int) $num;
                              Severity: Minor
                              Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 2 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 meta_form has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function meta_form() {
                                  global $wpdb;
                                  $limit = (int) apply_filters( 'postmeta_form_limit', 30 );
                                  $keys = $wpdb->get_col( "
                                      SELECT meta_key
                              Severity: Minor
                              Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 2 hrs to fix

                                Function wp_category_checklist has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null, $checked_ontop = true ) {
                                    if ( empty($walker) || !is_a($walker, 'Walker') )
                                        $walker = new Walker_Category_Checklist;
                                
                                    $descendants_and_self = (int) $descendants_and_self;
                                Severity: Minor
                                Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 1 hr 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 screen_options has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function screen_options($screen) {
                                    switch ( $screen ) {
                                        case 'edit':
                                            $per_page_label = __('Posts per page:');
                                            break;
                                Severity: Minor
                                Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 1 hr to fix

                                  Method touch_time has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
                                      global $wp_locale, $post, $comment;
                                  
                                      if ( $for_post )
                                          $edit = ( in_array($post->post_status, array('draft', 'pending') ) && (!$post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt ) ) ? false : true;
                                  Severity: Minor
                                  Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 1 hr to fix

                                    Method inline_edit_term_row has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function inline_edit_term_row($type) {
                                    
                                        if ( ! current_user_can( 'manage_categories' ) )
                                            return;
                                    
                                    
                                    Severity: Minor
                                    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 1 hr to fix

                                      Method page_rows has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      function page_rows($pages, $pagenum = 1, $per_page = 20) {
                                          global $wpdb;
                                      
                                          $level = 0;
                                      
                                      
                                      Severity: Minor
                                      Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 1 hr to fix

                                        Function wp_dropdown_cats has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                        function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0 ) {
                                            if (!$categories )
                                                $categories = get_categories( array('hide_empty' => 0) );
                                        
                                            if ( $categories ) {
                                        Severity: Minor
                                        Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 1 hr 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 compression_test has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        function compression_test() {
                                        ?>
                                            <script type="text/javascript">
                                            /* <![CDATA[ */
                                            var testCompression = {
                                        Severity: Minor
                                        Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 1 hr to fix

                                          Method the_attachment_links has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                          function the_attachment_links( $id = false ) {
                                              $id = (int) $id;
                                              $post = & get_post( $id );
                                          
                                              if ( $post->post_type != 'attachment' )
                                          Severity: Minor
                                          Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 1 hr to fix

                                            Method do_meta_boxes has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                            function do_meta_boxes($page, $context, $object) {
                                                global $wp_meta_boxes;
                                                static $already_sorted = false;
                                            
                                                //do_action('do_meta_boxes', $page, $context, $object);
                                            Severity: Minor
                                            Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 1 hr to fix

                                              Method add_meta_box has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                              function add_meta_box($id, $title, $callback, $page, $context = 'advanced', $priority = 'default', $callback_args=null) {
                                                  global $wp_meta_boxes;
                                              
                                                  if ( !isset($wp_meta_boxes) )
                                                      $wp_meta_boxes = array();
                                              Severity: Minor
                                              Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 1 hr to fix

                                                Function get_column_headers has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                                Open

                                                function get_column_headers($page) {
                                                    global $_wp_column_headers;
                                                
                                                    if ( !isset($_wp_column_headers) )
                                                        $_wp_column_headers = array();
                                                Severity: Minor
                                                Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 1 hr 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 _cat_rows has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                function _cat_rows( $parent = 0, $level = 0, $categories, &$children, $page = 1, $per_page = 20, &$count ) {
                                                
                                                    $start = ($page - 1) * $per_page;
                                                    $end = $start + $per_page;
                                                    ob_start();
                                                Severity: Minor
                                                Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 1 hr to fix

                                                  Method wp_category_checklist has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                                  Open

                                                  function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null, $checked_ontop = true ) {
                                                      if ( empty($walker) || !is_a($walker, 'Walker') )
                                                          $walker = new Walker_Category_Checklist;
                                                  
                                                      $descendants_and_self = (int) $descendants_and_self;
                                                  Severity: Minor
                                                  Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 1 hr to fix

                                                    Method list_meta has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                                    Open

                                                    function list_meta( $meta ) {
                                                        // Exit if no meta
                                                        if ( ! $meta ) {
                                                            echo '
                                                    <table id="list-table" style="display: none;">
                                                    Severity: Minor
                                                    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 1 hr to fix

                                                      Method _list_meta_row has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                      function _list_meta_row( $entry, &$count ) {
                                                          static $update_nonce = false;
                                                          if ( !$update_nonce )
                                                              $update_nonce = wp_create_nonce( 'add-meta' );
                                                      
                                                      
                                                      Severity: Minor
                                                      Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 1 hr to fix

                                                        Function _tag_row has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                                        Open

                                                        function _tag_row( $tag, $class = '', $taxonomy = 'post_tag' ) {
                                                                $count = number_format_i18n( $tag->count );
                                                                $tagsel = ($taxonomy == 'post_tag' ? 'tag' : $taxonomy);
                                                                $count = ( $count > 0 ) ? "<a href='edit.php?$tagsel=$tag->slug'>$count</a>" : $count;
                                                        
                                                        
                                                        Severity: Minor
                                                        Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 1 hr 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 _post_states has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                                        Open

                                                        function _post_states($post) {
                                                            $post_states = array();
                                                            if ( isset($_GET['post_status']) )
                                                                $post_status = $_GET['post_status'];
                                                            else
                                                        Severity: Minor
                                                        Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 1 hr 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 get_inline_data has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                        Open

                                                        function get_inline_data($post) {
                                                        
                                                            if ( ! current_user_can('edit_' . $post->post_type, $post->ID) )
                                                                return;
                                                        
                                                        
                                                        Severity: Minor
                                                        Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 1 hr to fix

                                                          Method _page_rows has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                          Open

                                                          function _page_rows( &$children_pages, &$count, $parent, $level, $pagenum, $per_page ) {
                                                          
                                                              if ( ! isset( $children_pages[$parent] ) )
                                                                  return;
                                                          
                                                          
                                                          Severity: Minor
                                                          Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 1 hr to fix

                                                            Function manage_columns_prefs has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                                            Open

                                                            function manage_columns_prefs($page) {
                                                                $columns = get_column_headers($page);
                                                            
                                                                $hidden = get_hidden_columns($page);
                                                            
                                                            
                                                            Severity: Minor
                                                            Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 1 hr 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 _post_states has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                            Open

                                                            function _post_states($post) {
                                                                $post_states = array();
                                                                if ( isset($_GET['post_status']) )
                                                                    $post_status = $_GET['post_status'];
                                                                else
                                                            Severity: Minor
                                                            Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 1 hr to fix

                                                              Function touch_time has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                              Open

                                                              function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
                                                                  global $wp_locale, $post, $comment;
                                                              
                                                                  if ( $for_post )
                                                                      $edit = ( in_array($post->post_status, array('draft', 'pending') ) && (!$post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt ) ) ? false : true;
                                                              Severity: Minor
                                                              Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 55 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 print_column_headers has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                              Open

                                                              function print_column_headers( $type, $id = true ) {
                                                                  $type = str_replace('.php', '', $type);
                                                                  $columns = get_column_headers( $type );
                                                                  $hidden = get_hidden_columns($type);
                                                                  $styles = array();
                                                              Severity: Minor
                                                              Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 55 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_meta_box has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                                              Open

                                                              function add_meta_box($id, $title, $callback, $page, $context = 'advanced', $priority = 'default', $callback_args=null) {
                                                              Severity: Major
                                                              Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 50 mins to fix

                                                                Method _cat_rows has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                                                Open

                                                                function _cat_rows( $parent = 0, $level = 0, $categories, &$children, $page = 1, $per_page = 20, &$count ) {
                                                                Severity: Major
                                                                Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 50 mins to fix

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

                                                                  function _list_meta_row( $entry, &$count ) {
                                                                      static $update_nonce = false;
                                                                      if ( !$update_nonce )
                                                                          $update_nonce = wp_create_nonce( 'add-meta' );
                                                                  
                                                                  
                                                                  Severity: Minor
                                                                  Found in Web.Admin/2014/wordpress/wp-admin/includes/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

                                                                  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/template.php - About 45 mins to fix

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

                                                                    function add_settings_field($id, $title, $callback, $page, $section = 'default', $args = array()) {
                                                                    Severity: Minor
                                                                    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 45 mins to fix

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

                                                                      function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null, $checked_ontop = true ) {
                                                                      Severity: Minor
                                                                      Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 45 mins to fix

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

                                                                        function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0, $type = '' ) {
                                                                        Severity: Minor
                                                                        Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 45 mins to fix

                                                                          Consider simplifying this complex logical expression.
                                                                          Open

                                                                                                  if ( ('reply' == $action || 'quickedit' == $action) && ! $from_ajax )
                                                                                                      $action .= ' hide-if-no-js';
                                                                                                  elseif ( ($action == 'untrash' && $the_comment_status == 'trash') || ($action == 'unspam' && $the_comment_status == 'spam') ) {
                                                                                                      if ('1' == get_comment_meta($comment_id, '_wp_trash_meta_status', true))
                                                                                                          $action .= ' approve';
                                                                          Severity: Major
                                                                          Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 40 mins to fix

                                                                            Consider simplifying this complex logical expression.
                                                                            Open

                                                                                    if ( 'cb' == $column || 'title' == $column || 'name' == $column || 'username' == $column || 'media' == $column || 'comment' == $column )
                                                                                        continue;
                                                                            Severity: Major
                                                                            Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 40 mins to fix

                                                                              Method wp_dropdown_cats has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                              Open

                                                                              function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0 ) {
                                                                              Severity: Minor
                                                                              Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 35 mins to fix

                                                                                Method _wp_comment_row has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                Open

                                                                                function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, $from_ajax = false ) {
                                                                                Severity: Minor
                                                                                Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 35 mins to fix

                                                                                  Method cat_rows has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                  Open

                                                                                  function cat_rows( $parent = 0, $level = 0, $categories = 0, $page = 1, $per_page = 20 ) {
                                                                                  Severity: Minor
                                                                                  Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 35 mins to fix

                                                                                    Function inline_edit_term_row has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                    Open

                                                                                    function inline_edit_term_row($type) {
                                                                                    
                                                                                        if ( ! current_user_can( 'manage_categories' ) )
                                                                                            return;
                                                                                    
                                                                                    
                                                                                    Severity: Minor
                                                                                    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 25 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_link_category_checklist has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                    Open

                                                                                    function wp_link_category_checklist( $link_id = 0 ) {
                                                                                        $default = 1;
                                                                                    
                                                                                        if ( $link_id ) {
                                                                                            $checked_categories = wp_get_link_cats($link_id);
                                                                                    Severity: Minor
                                                                                    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 25 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_popular_terms_checklist has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                    Open

                                                                                    function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $echo = true ) {
                                                                                        global $post_ID;
                                                                                    
                                                                                        if ( $post_ID )
                                                                                            $checked_categories = wp_get_post_categories($post_ID);
                                                                                    Severity: Minor
                                                                                    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 25 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 do_settings_fields has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                    Open

                                                                                    function do_settings_fields($page, $section) {
                                                                                        global $wp_settings_fields;
                                                                                    
                                                                                        if ( !isset($wp_settings_fields) || !isset($wp_settings_fields[$page]) || !isset($wp_settings_fields[$page][$section]) )
                                                                                            return;
                                                                                    Severity: Minor
                                                                                    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 25 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 do_settings_sections has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                    Open

                                                                                    function do_settings_sections($page) {
                                                                                        global $wp_settings_sections, $wp_settings_fields;
                                                                                    
                                                                                        if ( !isset($wp_settings_sections) || !isset($wp_settings_sections[$page]) )
                                                                                            return;
                                                                                    Severity: Minor
                                                                                    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 25 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 post_rows has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                    Open

                                                                                    function post_rows( $posts = array() ) {
                                                                                        global $wp_query, $post, $mode;
                                                                                    
                                                                                        add_filter('the_title','esc_html');
                                                                                    
                                                                                    
                                                                                    Severity: Minor
                                                                                    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 25 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

                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                    Open

                                                                                                        if ( $comment_status && 'all' != $comment_status ) { // not looking at all comments
                                                                                                            if ( 'approved' == $the_comment_status )
                                                                                                                $actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&amp;new=unapproved vim-u vim-destructive' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
                                                                                                            else if ( 'unapproved' == $the_comment_status )
                                                                                                                $actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&amp;new=approved vim-a vim-destructive' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
                                                                                    Severity: Major
                                                                                    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php and 1 other location - About 7 hrs to fix
                                                                                    Web.Admin/2014/wordpress/wp-admin/includes/class-wp-comments-list-table.php on lines 439..447

                                                                                    Duplicated Code

                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                    Tuning

                                                                                    This issue has a mass of 233.

                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                    Refactorings

                                                                                    Further Reading

                                                                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                    Open

                                                                                        if ( $categories ) {
                                                                                            foreach ( $categories as $category ) {
                                                                                                if ( $currentcat != $category->term_id && $parent == $category->parent) {
                                                                                                    $pad = str_repeat( '&#8211; ', $level );
                                                                                                    $category->name = esc_html( $category->name );
                                                                                    Severity: Major
                                                                                    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php and 1 other location - About 2 hrs to fix
                                                                                    Web.Admin/2014/wordpress/wp-admin/includes/deprecated.php on lines 145..159

                                                                                    Duplicated Code

                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                    Tuning

                                                                                    This issue has a mass of 137.

                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                    Refactorings

                                                                                    Further Reading

                                                                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                    Open

                                                                                                foreach ( $wp_meta_boxes[$page][$context][$priority] as $box ) {
                                                                                                    if ( false == $box || ! $box['title'] )
                                                                                                        continue;
                                                                                                    // Submit box cannot be hidden
                                                                                                    if ( 'submitdiv' == $box['id'] || 'linksubmitdiv' == $box['id'] )
                                                                                    Severity: Major
                                                                                    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php and 1 other location - About 2 hrs to fix
                                                                                    Web.Admin/2014/wordpress/wp-admin/includes/screen.php on lines 78..88

                                                                                    Duplicated Code

                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                    Tuning

                                                                                    This issue has a mass of 135.

                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                    Refactorings

                                                                                    Further Reading

                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                    Open

                                                                                            case 'categories':
                                                                                            ?>
                                                                                            <td <?php echo $attributes ?>><?php
                                                                                                $categories = get_the_category();
                                                                                                if ( !empty( $categories ) ) {
                                                                                    Severity: Major
                                                                                    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php and 1 other location - About 2 hrs to fix
                                                                                    Web.Admin/2014/wordpress/wp-admin/edit-attachment-rows.php on lines 126..140

                                                                                    Duplicated Code

                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                    Tuning

                                                                                    This issue has a mass of 124.

                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                    Refactorings

                                                                                    Further Reading

                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                    Open

                                                                                                if ( current_user_can('edit_post', $post->ID) && 'trash' != $post->post_status ) {
                                                                                                    $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . esc_attr(__('Edit this post')) . '">' . __('Edit') . '</a>';
                                                                                                    $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this post inline')) . '">' . __('Quick&nbsp;Edit') . '</a>';
                                                                                                }
                                                                                    Severity: Major
                                                                                    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php and 1 other location - About 1 hr to fix
                                                                                    Web.Admin/2014/wordpress/wp-admin/includes/class-wp-posts-list-table.php on lines 645..648

                                                                                    Duplicated Code

                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                    Tuning

                                                                                    This issue has a mass of 120.

                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                    Refactorings

                                                                                    Further Reading

                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                    Open

                                                                                                        if ( 'spam' == $the_comment_status || 'trash' == $the_comment_status || !EMPTY_TRASH_DAYS ) {
                                                                                                            $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID::delete=1 delete vim-d vim-destructive'>" . __('Delete Permanently') . '</a>';
                                                                                                        } else {
                                                                                                            $actions['trash'] = "<a href='$trash_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive' title='" . esc_attr__( 'Move this comment to the trash' ) . "'>" . _x('Trash', 'verb') . '</a>';
                                                                                                        }
                                                                                    Severity: Major
                                                                                    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php and 1 other location - About 1 hr to fix
                                                                                    Web.Admin/2014/wordpress/wp-admin/includes/class-wp-comments-list-table.php on lines 457..461

                                                                                    Duplicated Code

                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                    Tuning

                                                                                    This issue has a mass of 115.

                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                    Refactorings

                                                                                    Further Reading

                                                                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                    Open

                                                                                                case 'name':
                                                                                                    $output .= "<td $attributes>$edit";
                                                                                                    $output .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">';
                                                                                                    $output .= '<div class="name">' . $qe_data->name . '</div>';
                                                                                                    $output .= '<div class="slug">' . apply_filters('editable_slug', $qe_data->slug) . '</div>';
                                                                                    Severity: Minor
                                                                                    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php and 1 other location - About 45 mins to fix
                                                                                    Web.Admin/2014/wordpress/wp-admin/includes/template.php on lines 346..352

                                                                                    Duplicated Code

                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                    Tuning

                                                                                    This issue has a mass of 95.

                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                    Refactorings

                                                                                    Further Reading

                                                                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                    Open

                                                                                                case 'name':
                                                                                                    $output .= "<td $attributes>$edit";
                                                                                                    $output .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">';
                                                                                                    $output .= '<div class="name">' . $qe_data->name . '</div>';
                                                                                                    $output .= '<div class="slug">' . apply_filters('editable_slug', $qe_data->slug) . '</div>';
                                                                                    Severity: Minor
                                                                                    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php and 1 other location - About 45 mins to fix
                                                                                    Web.Admin/2014/wordpress/wp-admin/includes/template.php on lines 176..182

                                                                                    Duplicated Code

                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                    Tuning

                                                                                    This issue has a mass of 95.

                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                    Refactorings

                                                                                    Further Reading

                                                                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                    Open

                                                                                                case 'posts':
                                                                                                    $attributes = 'class="posts column-posts num"' . $style;
                                                                                                    $r .= "<td $attributes>";
                                                                                                    if ( $numposts > 0 ) {
                                                                                                        $r .= "<a href='edit.php?author=$user_object->ID' title='" . __( 'View posts by this author' ) . "' class='edit'>";
                                                                                    Severity: Minor
                                                                                    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php and 1 other location - About 45 mins to fix
                                                                                    Web.Admin/2014/wordpress/wp-admin/includes/class-wp-users-list-table.php on lines 425..436

                                                                                    Duplicated Code

                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                    Tuning

                                                                                    This issue has a mass of 95.

                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                    Refactorings

                                                                                    Further Reading

                                                                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                    Open

                                                                                                        comments_number("<a href='edit-comments.php?p=$post->ID' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link */ _x('0', 'comment count') . '</span></a>', "<a href='edit-comments.php?p=$post->ID' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link */ _x('1', 'comment count') . '</span></a>', "<a href='edit-comments.php?p=$post->ID' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link: % will be substituted by comment count */ _x('%', 'comment count') . '</span></a>');
                                                                                    Severity: Minor
                                                                                    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php and 1 other location - About 40 mins to fix
                                                                                    Web.Admin/2014/wordpress/wp-admin/includes/template.php on lines 1521..1521

                                                                                    Duplicated Code

                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                    Tuning

                                                                                    This issue has a mass of 94.

                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                    Refactorings

                                                                                    Further Reading

                                                                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                    Open

                                                                                                    comments_number("<a href='edit-comments.php?p=$post->ID' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link */ _x('0', 'comment count') . '</span></a>', "<a href='edit-comments.php?p=$post->ID' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link */ _x('1', 'comment count') . '</span></a>', "<a href='edit-comments.php?p=$post->ID' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link: % will be substituted by comment count */ _x('%', 'comment count') . '</span></a>');
                                                                                    Severity: Minor
                                                                                    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php and 1 other location - About 40 mins to fix
                                                                                    Web.Admin/2014/wordpress/wp-admin/includes/template.php on lines 2273..2273

                                                                                    Duplicated Code

                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                    Tuning

                                                                                    This issue has a mass of 94.

                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                    Refactorings

                                                                                    Further Reading

                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                    Open

                                                                                            if ( in_array($post->post_status, array('pending', 'draft')) ) {
                                                                                                if ( current_user_can('edit_page', $page->ID) )
                                                                                                    $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
                                                                                            } elseif ( $post->post_status != 'trash' ) {
                                                                                                $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>';
                                                                                    Severity: Minor
                                                                                    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php and 1 other location - About 40 mins to fix
                                                                                    Web.Admin/2014/wordpress/wp-admin/includes/template.php on lines 1459..1464

                                                                                    Duplicated Code

                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                    Tuning

                                                                                    This issue has a mass of 93.

                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                    Refactorings

                                                                                    Further Reading

                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                    Open

                                                                                                if ( in_array($post->post_status, array('pending', 'draft')) ) {
                                                                                                    if ( current_user_can('edit_post', $post->ID) )
                                                                                                        $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
                                                                                                } elseif ( 'trash' != $post->post_status ) {
                                                                                                    $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>';
                                                                                    Severity: Minor
                                                                                    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php and 1 other location - About 40 mins to fix
                                                                                    Web.Admin/2014/wordpress/wp-admin/includes/template.php on lines 1679..1684

                                                                                    Duplicated Code

                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                    Tuning

                                                                                    This issue has a mass of 93.

                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                    Refactorings

                                                                                    Further Reading

                                                                                    There are no issues that match your filters.

                                                                                    Category
                                                                                    Status