Function output_fields
has a Cognitive Complexity of 111 (exceeds 5 allowed). Consider refactoring. Open
public static function output_fields( $options ) {
foreach ( $options as $key => $value ) {
if ( ! isset( $value['type'] ) ) {
continue;
- 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 output_fields
has 269 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function output_fields( $options ) {
foreach ( $options as $key => $value ) {
if ( ! isset( $value['type'] ) ) {
continue;
Function save_fields
has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring. Open
public static function save_fields( $options ) {
if ( empty( $_POST ) ) {
return 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
File class-alnp-admin-settings.php
has 433 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Auto Load Next Post - Admin Settings Class.
*
* @since 1.0.0
Method save_fields
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function save_fields( $options ) {
if ( empty( $_POST ) ) {
return false;
}
Function get_option
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function get_option( $option_name, $default = '' ) {
// Array value
if ( strstr( $option_name, '[' ) ) {
parse_str( $option_name, $option_array );
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
public static function show_messages() {
if ( count( self::$errors ) > 0 ) {
foreach ( self::$errors as $error ) {
echo '<div class="notice notice-error"><p><strong>' . esc_html( $error ) . '</strong></p></div>';
}
- 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"