Showing 399 of 427 total issues
Function get_loaded_module_list
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function get_loaded_module_list() {
$module_list = Array();
if ( !empty( $this->modules ) ) {
foreach( $this->modules as $k => $v )
if ( !empty( $v ) )
- 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 add_hooks
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function add_hooks() {
global $aioseop_options;
aioseop_update_settings_check();
add_filter( 'user_contactmethods', 'aioseop_add_contactmethods' );
if ( is_user_logged_in() && function_exists( 'is_admin_bar_showing' ) && is_admin_bar_showing() && current_user_can( 'manage_options' ) )
- 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 aioseop_ajax_save_meta
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function aioseop_ajax_save_meta() {
if ( !empty( $_POST['_inline_edit'] ) && ( $_POST['_inline_edit'] != 'undefined' ) )
check_ajax_referer( 'inlineeditnonce', '_inline_edit' );
$post_id = intval( $_POST['post_id'] );
$new_meta = strip_tags( $_POST['new_meta'] );
- 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 aioseop_filter_callback
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function aioseop_filter_callback( $matches ) {
if ( $matches[1] && !empty( $matches[1] ) ) $postID = $matches[1];
if ( empty( $postID ) ) $postID = get_option( "page_on_front" );
$title_attrib = stripslashes( get_post_meta($postID, '_aioseop_titleatr', true ) );
if ( empty( $title_attrib ) && !empty( $matches[4] ) ) $title_attrib = $matches[4];
- 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 filter_settings
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function filter_settings( $settings, $location ) {
if ( $location == 'generator' ) {
$prefix = $this->get_prefix( $location ) . $location . '_';
if ( isset( $_POST['Submit_Optimize'] ) ) {
if ( isset( $settings[ $prefix . 'robotgen' ] ) ) {
- 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 do_robots
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function do_robots( $options, $location ) {
if ( $location ) $prefix = $this->get_prefix( $location ) . $location . '_';
if ( $location === 'generator' ) {
if ( isset( $_POST['Submit_Update'] ) || isset( $_POST['Submit_Opt_Update'] ) ) {
$this->save_files( Array( 'robotgen' => 'robots.txt' ), $prefix );
- 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 add_admin_bar_submenu
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function add_admin_bar_submenu() {
global $aioseop_admin_menu, $wp_admin_bar;
if ( $aioseop_admin_menu ) {
$links = $this->get_admin_links();
- 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 update_class_option
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function update_class_option( $option_data, $option_name = false ) {
if ( $option_name == false )
$option_name = $this->get_option_name();
if ( $this->store_option || $option_name == $this->parent_option ) {
return update_option( $option_name, $option_data );
- 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 csv_to_array
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function csv_to_array( $csv ) {
$args = Array();
if ( !function_exists( 'str_getcsv' ) )
$v = $this->str_getcsv( $csv );
else
- 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 filter_pointers
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function filter_pointers() {
if ( !empty( $this->pointers ) ) {
$dismissed = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
foreach( $dismissed as $d )
if ( isset( $this->pointers[$d] ) )
- 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_the_image_by_author
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function get_the_image_by_author( $options = null, $p = null ) {
if ( $p === null ) {
global $post;
} else {
$post = $p;
- 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_rewrite_url
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function get_rewrite_url( $url ) {
global $wp_rewrite;
$url = parse_url( esc_url( $url ), PHP_URL_PATH );
$url = ltrim( $url, '/' );
if ( !empty( $wp_rewrite ) ) {
- 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 deeply nested control flow statements. Open
if( is_array( $module_options ) ) {
foreach( $module_options as $key => $value ) {
/* Update Post Data */
if( $label == 'post_data' ) {
$post_exists = post_exists( $module_options[$key]['post_title'], '', $module_options[$key]['post_date'] );
Function aioseop_init_class
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function aioseop_init_class() {
global $aiosp;
require_once( AIOSEOP_PLUGIN_DIR . 'aioseop_functions.php' );
require_once( AIOSEOP_PLUGIN_DIR . 'aioseop_class.php' );
$aiosp = new All_in_One_SEO_Pack();
- 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 deeply nested control flow statements. Open
if ( !empty( $d ) ) {
if ( !empty( $domain_list ) )
$domain_list .= ", ";
$domain_list .= "'" . $d . "'";
}
Avoid deeply nested control flow statements. Open
if (reset($stk) == SERVICES_JSON_IN_ARR) {
// we are in an array, so just push an element onto the stack
array_push($arr, $this->decode($slice));
} elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
Avoid deeply nested control flow statements. Open
if (($delim == '"' && $substr_chrs_c_2 != '\\\'') ||
($delim == "'" && $substr_chrs_c_2 != '\\"')) {
$utf8 .= $chrs{++$c};
}
Avoid deeply nested control flow statements. Open
if ( !empty( $this->$v) ) $preload["{$this->prefix}{$v}"] = $this->$v;
Avoid deeply nested control flow statements. Open
if ( count( $terms ) > 0 )
$term = $terms[0];
Avoid deeply nested control flow statements. Open
for ($i = $top['where']; $i <= $c; ++$i)
$chrs = substr_replace($chrs, ' ', $i, 1);