Showing 88 of 140 total issues
Method add_notices
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function add_notices() {
global $current_user;
// If the current user can not install plugins then return nothing!
if ( ! current_user_can( 'install_plugins' ) ) {
Function output
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function output( $current_view ) {
if ( $current_view !== 'setup-wizard' ) {
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 alnp_remove_widgets_panel
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function alnp_remove_widgets_panel( $components ) {
if ( $this->alnp_is_customizer() ) {
foreach( $components as $key => $component ) {
if ( $component == 'widgets' ) {
unset( $components[ 'widgets' ] );
- 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_load_content
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function alnp_load_content( $post_type, $post_format ) {
// Returns template location for supported themes.
$template_location = alnp_template_location();
$content_found = 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 scan_theme_selectors
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function scan_theme_selectors( timeout ) {
$.get( params.random_page, function( response ) {
if ( ! response ) {
return;
}
Method auto_load_next_post_seconds_to_words
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function auto_load_next_post_seconds_to_words( $seconds ) {
// Get the years.
$years = ( intval( $seconds ) / YEAR_IN_SECONDS ) % 100;
if ( $years > 1 ) {
/* translators: Number of years */
Function dont_bug_me
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function dont_bug_me() {
global $current_user;
$user_hidden_notice = 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 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
Method render_content
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render_content() {
?>
<span class="customize-control-title"><?php echo $this->label; ?></span>
<p>
Method get_settings
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_settings() {
return apply_filters(
'alnp_event_settings', array(
array(
Function find_template_location
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function find_template_location() {
var $data = {
action: 'alnp_find_template_location',
};
Function create_options
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function create_options() {
// Include settings so that we can run through defaults
include_once( dirname( __FILE__ ) . '/admin/class-alnp-admin-settings.php' );
$settings = ALNP_Admin_Settings::get_settings_pages();
- 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 no_theme_selectors_set
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function no_theme_selectors_set() {
$set_selectors = array();
$content_container = get_option( 'auto_load_next_post_content_container' );
$title_selector = get_option( 'auto_load_next_post_title_selector' );
- 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 alnp_enqueue_scripts
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function alnp_enqueue_scripts() {
// Prevent enqueue scripts if feed, trackback or a preview of a post.
if ( is_feed() || is_trackback() || is_preview() ) {
return;
}
Method alnp_get_theme_support
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function alnp_get_theme_support( $prop = '', $default = null ) {
$theme_support = get_theme_support( 'auto-load-next-post' );
$theme_support = is_array( $theme_support ) ? $theme_support[0] : false;
if ( ! $theme_support ) {
Method alnp_load_content
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function alnp_load_content( $post_type, $post_format ) {
// Returns template location for supported themes.
$template_location = alnp_template_location();
$content_found = false;
Function set_js_in_footer
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private static function set_js_in_footer() {
if ( is_alnp_supported() ) {
$load_js_in_footer = alnp_get_theme_support( 'load_js_in_footer' );
$lock_js_in_footer = alnp_get_theme_support( 'lock_js_in_footer' );
- 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_enqueue_scripts
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function alnp_enqueue_scripts() {
// Prevent enqueue scripts if feed, trackback or a preview of a post.
if ( is_feed() || is_trackback() || is_preview() ) {
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 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
Function exports
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(grunt) {
'use strict';
var sass = require( 'node-sass' );
- 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"