woocommerce/class-sv-wp-admin-message-handler.php
SV_WP_Admin_Message_Handler
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
Open
#[\AllowDynamicProperties]
class SV_WP_Admin_Message_Handler {
/** transient message prefix */
Function load_messages
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
public function load_messages() {
if ( isset( $_GET[ self::MESSAGE_ID_GET_NAME ] ) && $this->get_message_id() == $_GET[ self::MESSAGE_ID_GET_NAME ] ) {
$memo = get_transient( self::MESSAGE_TRANSIENT_PREFIX . $_GET[ self::MESSAGE_ID_GET_NAME ] );
- 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 show_messages
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
public function show_messages( $params = array() ) {
$params = wp_parse_args( $params, array(
'capabilities' => array(
'manage_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"
Further reading
Method show_messages
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function show_messages( $params = array() ) {
$params = wp_parse_args( $params, array(
'capabilities' => array(
'manage_woocommerce',