Function output_plugins_info
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
private static function output_plugins_info( $plugins, $untested_plugins ) {
$wc_version = Constants::get_constant( 'WC_VERSION' );
if ( 'major' === Constants::get_constant( 'WC_SSR_PLUGIN_UPDATE_RELEASE_VERSION_TYPE' ) ) {
// Since we're only testing against major, we don't need to show minor and patch 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 get_latest_theme_version
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public static function get_latest_theme_version( $theme ) {
include_once ABSPATH . 'wp-admin/includes/theme.php';
$api = themes_api(
'theme_information',
- 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
File class-wc-admin-status.php
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Debug/Status page
*
* @package WooCommerce\Admin\System Status
Function scan_template_files
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public static function scan_template_files( $template_path ) {
$files = @scandir( $template_path ); // @codingStandardsIgnoreLine.
$result = array();
if ( ! empty( $files ) ) {
- 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 get_latest_theme_version
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function get_latest_theme_version( $theme ) {
include_once ABSPATH . 'wp-admin/includes/theme.php';
$api = themes_api(
'theme_information',
Method output_plugins_info
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function output_plugins_info( $plugins, $untested_plugins ) {
$wc_version = Constants::get_constant( 'WC_VERSION' );
if ( 'major' === Constants::get_constant( 'WC_SSR_PLUGIN_UPDATE_RELEASE_VERSION_TYPE' ) ) {
// Since we're only testing against major, we don't need to show minor and patch version.
Method status_tools
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function status_tools() {
if ( ! class_exists( 'WC_REST_System_Status_Tools_Controller' ) ) {
wp_die( 'Cannot load the REST API to access WC_REST_System_Status_Tools_Controller.' );
}
Function status_tools
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function status_tools() {
if ( ! class_exists( 'WC_REST_System_Status_Tools_Controller' ) ) {
wp_die( 'Cannot load the REST API to access WC_REST_System_Status_Tools_Controller.' );
}
- 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 log_table_bulk_actions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static function log_table_bulk_actions() {
if ( empty( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'woocommerce-status-logs' ) ) { // WPCS: input var ok, sanitization ok.
wp_die( esc_html__( 'Action failed. Please refresh the page and retry.', 'woocommerce' ) );
}
- 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"