CaffGeek/MBACNationals

View on GitHub
Web.Admin/2014/wordpress/wp-admin/includes/class-wp-list-table.php

Summary

Maintainability
D
2 days
Test Coverage

File class-wp-list-table.php has 461 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Base class for displaying a list of items in an ajaxified HTML table.
 *
 * @package WordPress
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-list-table.php - About 7 hrs to fix

    WP_List_Table has 35 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class WP_List_Table {
    
        /**
         * The current list of items
         *
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-list-table.php - About 4 hrs to fix

      Function print_column_headers has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          function print_column_headers( $with_id = true ) {
              list( $columns, $hidden, $sortable ) = $this->get_column_info();
      
              $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
              $current_url = remove_query_arg( 'paged', $current_url );
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-list-table.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 pagination has 57 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function pagination( $which ) {
              if ( empty( $this->_pagination_args ) )
                  return;
      
              extract( $this->_pagination_args, EXTR_SKIP );
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-list-table.php - About 2 hrs to fix

        Method print_column_headers has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function print_column_headers( $with_id = true ) {
                list( $columns, $hidden, $sortable ) = $this->get_column_info();
        
                $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
                $current_url = remove_query_arg( 'paged', $current_url );
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-list-table.php - About 1 hr to fix

          Method months_dropdown has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function months_dropdown( $post_type ) {
                  global $wpdb, $wp_locale;
          
                  $months = $wpdb->get_results( $wpdb->prepare( "
                      SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-list-table.php - About 1 hr to fix

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

                function pagination( $which ) {
                    if ( empty( $this->_pagination_args ) )
                        return;
            
                    extract( $this->_pagination_args, EXTR_SKIP );
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-list-table.php - About 45 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function months_dropdown has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                function months_dropdown( $post_type ) {
                    global $wpdb, $wp_locale;
            
                    $months = $wpdb->get_results( $wpdb->prepare( "
                        SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-list-table.php - About 35 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 get_column_info has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                function get_column_info() {
                    if ( isset( $this->_column_headers ) )
                        return $this->_column_headers;
            
                    $columns = get_column_headers( $this->screen );
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-list-table.php - About 35 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 single_row_columns has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                function single_row_columns( $item ) {
                    list( $columns, $hidden ) = $this->get_column_info();
            
                    foreach ( $columns as $column_name => $column_display_name ) {
                        $class = "class='$column_name column-$column_name'";
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-list-table.php - About 35 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 set_pagination_args has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                function set_pagination_args( $args ) {
                    $args = wp_parse_args( $args, array(
                        'total_items' => 0,
                        'total_pages' => 0,
                        'per_page' => 0,
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-list-table.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 search_box has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                function search_box( $text, $input_id ) {
                    if ( empty( $_REQUEST['s'] ) && !$this->has_items() )
                        return;
            
                    $input_id = $input_id . '-search-input';
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-list-table.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

            There are no issues that match your filters.

            Category
            Status