Showing 88 of 140 total issues
Function is_page_alnp_ready
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function is_page_alnp_ready() {
if ( is_front_page() && is_home() ) {
return false;
} elseif ( is_front_page() ) {
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 install
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function install() {
if ( ! is_blog_installed() ) {
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 find_template_location
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function find_template_location() {
$post_type = isset( $_GET['post_type'] ) ? $_GET['post_type'] : 'post';
if ( empty( $post_type ) ) {
wp_send_json( -1 );
- 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 lock_js_in_footer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function lock_js_in_footer( $settings ) {
$js_locked_in_footer = get_option( 'auto_load_next_post_lock_js_in_footer' );
if ( ! empty( $js_locked_in_footer ) && $js_locked_in_footer == 'yes' ) {
// Setting key to look for.
- 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_include_theme_support
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function alnp_include_theme_support() {
$themes_supported = alnp_themes_supported();
if ( is_alnp_active_theme( $themes_supported ) ) {
foreach( $themes_supported as $theme ) {
- 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 includes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function includes() {
global $wp_version;
include( dirname( __FILE__ ) . '/class-alnp-admin-action-links.php' ); // Action Links
include( dirname( __FILE__ ) . '/class-alnp-admin-assets.php' ); // Admin Assets
- 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 settings_page_init
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function settings_page_init() {
global $current_view, $current_section;
// Include settings pages.
include_once( dirname( __FILE__ ) . '/class-alnp-admin-settings.php' );
- 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_get_random_page_permalink
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function alnp_get_random_page_permalink( $post_type = 'post' ) {
$args = array(
'post_type' => $post_type,
'post_status' => 'publish',
'orderby' => 'rand',
- 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"