CaffGeek/MBACNationals

View on GitHub
Web.Admin/2014/wordpress/wp-admin/update-core.php

Summary

Maintainability
D
2 days
Test Coverage

File update-core.php has 324 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Update Core administration panel.
 *
 * @package WordPress
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/update-core.php - About 3 hrs to fix

    Method list_plugin_updates has 68 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function list_plugin_updates() {
        global $wp_version;
    
        $cur_wp_version = preg_replace('/-.*$/', '', $wp_version);
    
    
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-admin/update-core.php - About 2 hrs to fix

      Function list_plugin_updates has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

      function list_plugin_updates() {
          global $wp_version;
      
          $cur_wp_version = preg_replace('/-.*$/', '', $wp_version);
      
      
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-admin/update-core.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 list_core_update has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

      function list_core_update( $update ) {
          global $wp_local_package;
          $version_string = ('en_US' == $update->locale && 'en_US' == get_locale() ) ?
                  $update->current : sprintf("%s&ndash;<strong>%s</strong>", $update->current, $update->locale);
          $current = false;
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-admin/update-core.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 list_core_update has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function list_core_update( $update ) {
          global $wp_local_package;
          $version_string = ('en_US' == $update->locale && 'en_US' == get_locale() ) ?
                  $update->current : sprintf("%s&ndash;<strong>%s</strong>", $update->current, $update->locale);
          $current = false;
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-admin/update-core.php - About 1 hr to fix

        Function do_core_upgrade has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

        function do_core_upgrade( $reinstall = false ) {
            global $wp_filesystem;
        
            if ( $reinstall )
                $url = 'update-core.php?action=do-core-reinstall';
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-admin/update-core.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 do_core_upgrade has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function do_core_upgrade( $reinstall = false ) {
            global $wp_filesystem;
        
            if ( $reinstall )
                $url = 'update-core.php?action=do-core-reinstall';
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-admin/update-core.php - About 1 hr to fix

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

          function core_upgrade_preamble() {
              global $upgrade_error;
          
              $updates = get_core_updates();
          ?>
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-admin/update-core.php - About 1 hr to fix

            Method list_theme_updates has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function list_theme_updates() {
                $themes = get_theme_updates();
                if ( empty($themes) )
                    return;
            ?>
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-admin/update-core.php - About 1 hr to fix

              There are no issues that match your filters.

              Category
              Status