CaffGeek/MBACNationals

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

Summary

Maintainability
C
1 day
Test Coverage

Method prepare_items has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function prepare_items() {
        include( ABSPATH . 'wp-admin/includes/theme-install.php' );

        global $tabs, $tab, $paged, $type, $theme_field_defaults;
        wp_reset_vars( array( 'tab' ) );

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

    <?php
    /**
     * Theme Installer List Table class.
     *
     * @package WordPress

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

          function prepare_items() {
              include( ABSPATH . 'wp-admin/includes/theme-install.php' );
      
              global $tabs, $tab, $paged, $type, $theme_field_defaults;
              wp_reset_vars( array( 'tab' ) );

      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 single_row has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function single_row( $theme ) {
              global $themes_allowedtags;
      
              if ( empty( $theme ) )
                  return;

        Method install_theme_info has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function install_theme_info( $theme ) {
                global $themes_allowedtags;
        
                if ( empty( $theme ) )
                    return;

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

              function single_row( $theme ) {
                  global $themes_allowedtags;
          
                  if ( empty( $theme ) )
                      return;

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

              function install_theme_info( $theme ) {
                  global $themes_allowedtags;
          
                  if ( empty( $theme ) )
                      return;

          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