Showing 88 of 140 total issues
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"
Further reading
Method load_file
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function load_file( $name, $file_path, $is_script = false, $support = array(), $version = '', $footer = false ) {
Function output
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function output( $current_view ) {
if ( $current_view !== 'getting-started' ) {
return;
}
- 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 admin_scripts
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function admin_scripts() {
$screen = get_current_screen();
$screen_id = $screen ? $screen->id : '';
if ( $screen_id == 'settings_page_auto-load-next-post' ) {
- 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 is_theme_supported
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function is_theme_supported() {
if ( is_alnp_supported() ) {
$plugin_supported = alnp_get_theme_support( 'plugin_support' );
// Is the theme supported by theme or plugin?
- 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 alnp_is_bot_user_agent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function alnp_is_bot_user_agent( $ua = null ) {
if ( empty( $ua ) ) {
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
Function redirect_getting_started
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function redirect_getting_started( $plugin ) {
// Prevent redirect if plugin name does not match.
if ( $plugin !== plugin_basename( AUTO_LOAD_NEXT_POST_FILE ) ) {
return;
}
- 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 autoload
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function autoload( $class ) {
$class = strtolower( $class );
if ( 0 !== strpos( $class, 'alnp_' ) ) {
return;
- 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 reset_alnp
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function reset_alnp() {
if ( current_user_can( 'install_plugins' ) && isset( $_GET['reset-alnp'] ) && $_GET['reset-alnp'] == 'yes' ) {
global $wpdb;
// If we made it till here nothing is running yet, lets set the transient now for two minutes.
- 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
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return __( 'a minute', 'auto-load-next-post' );
Avoid too many return
statements within this method. Open
return sprintf( __( '%s seconds', 'auto-load-next-post' ), $seconds );
Avoid too many return
statements within this method. Open
return sprintf( __( '%s minutes', 'auto-load-next-post' ), $minutes );
Avoid too many return
statements within this method. Open
return sprintf( __( '%s days', 'auto-load-next-post' ), $days );
Avoid too many return
statements within this method. Open
return __( 'an hour', 'auto-load-next-post' );
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this method. Open
return sprintf( __( '%s hours', 'auto-load-next-post' ), $hours );
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this method. Open
return __( 'a second', 'auto-load-next-post' );
Avoid too many return
statements within this method. Open
return __( 'a day', 'auto-load-next-post' );