File update-core.php
has 324 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Update Core administration panel.
*
* @package WordPress
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);
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);
- Read upRead up
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–<strong>%s</strong>", $update->current, $update->locale);
$current = false;
- Read upRead up
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–<strong>%s</strong>", $update->current, $update->locale);
$current = false;
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';
- Read upRead up
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';
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();
?>
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;
?>