Showing 427 of 427 total issues
Function aioseop_handle_ignore_notice
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function aioseop_handle_ignore_notice() {
if ( !empty( $_GET ) ) {
global $current_user;
$user_id = $current_user->ID;
if ( !empty( $_GET["aioseop_reset_notices"] ) ) {
- 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 ( $m[$tags['name']] == $tv )
$meta .= "<tr><th style='color:red;'>" . sprintf( __( 'Duplicate %s Meta'), ucwords( $type ) ) . "</th><td>" . ucwords( $tk ) . "</td><td>{$m[$tags['name']]}</td><td>{$m[$tags['value']]}</td></tr>\n";
Avoid deeply nested control flow statements. Open
if ( empty( $excluded[$k] ) ) unset( $excluded[$k] );
Function delete_class_option
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function delete_class_option( $delete = false ) {
$option_name = $this->get_option_name();
if ( $this->store_option || $delete ) {
delete_option( $option_name );
} 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
Avoid deeply nested control flow statements. Open
if ( $post->ID == get_option( 'page_for_posts' ) )
$wp_query->is_home = true;
Avoid deeply nested control flow statements. Open
if ( empty( $link_list[$l['order']] ) ) $link_list[$l['order']] = Array();
Function split_header
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function split_header($header, $only_allow_oauth_parameters = true) {
$params = array();
if (preg_match_all('/('.($only_allow_oauth_parameters ? 'oauth_' : '').'[a-z_-]*)=(:?"([^"]*)"|([^,]*))/', $header, $matches)) {
foreach ($matches[1] as $i => $h) {
$params[$h] = OAuthUtil::urldecode_rfc3986(empty($matches[3][$i]) ? $matches[4][$i] : $matches[3][$i]);
- 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(!isset($output[$t]))
$output[$t] = array();
Function do_write_sitemap
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function do_write_sitemap( $sitemap_type, $page = 0, $filename = '', $comment = '' ) {
if ( empty( $filename ) ) {
if ( $sitemap_type == 'root' ) {
$filename = $this->options["{$this->prefix}filename"];
} 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
Avoid deeply nested control flow statements. Open
if ( !$siteurl ) $siteurl = get_home_url( $blog_id );
Avoid deeply nested control flow statements. Open
if ( !empty( $legacy[$thumbnail] ) )
$thumbnail = $legacy[$thumbnail];
Avoid deeply nested control flow statements. Open
if ( !empty( $keywords ) && !empty( $tag ) ) {
$tag .= ',' . $keywords;
} elseif ( empty( $tag ) ) {
$tag = $keywords;
}
Avoid deeply nested control flow statements. Open
if ( $sitemap_options["{$this->prefix}gzipped"] ) $url .= '.gz';
Function All_in_One_SEO_Pack_File_Editor
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function All_in_One_SEO_Pack_File_Editor( ) {
$this->name = __('File Editor', 'all-in-one-seo-pack'); // Human-readable name of the plugin
$this->prefix = 'aiosp_file_editor_'; // option prefix
$this->file = __FILE__; // the current file
parent::__construct();
- 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 ( defined( 'SUNRISE' ) && SUNRISE && is_object( $wpdb ) && isset( $wpdb->dmtable ) && !empty( $wpdb->dmtable ) ) {
$domain = $wpdb->get_var( "SELECT domain FROM {$wpdb->dmtable} WHERE blog_id = '$blog_id' AND active = 1 LIMIT 1" );
if ( $domain ) {
if ( false == isset( $_SERVER[ 'HTTPS' ] ) )
$_SERVER[ 'HTTPS' ] = 'Off';
Function cache_options
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function cache_options() {
static $start = true;
if ( $start ) {
$this->cache_struct = get_option( 'permalink_structure' );
if ( !empty( $this->cache_struct ) ) add_filter( 'pre_option_permalink_structure', Array( $this, 'cache_structure' ) );
- 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 get_default_values
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function get_default_values( $defaults, $prefix, &$cache, $item, $nodefaults = false, $type = '' ) {
Consider simplifying this complex logical expression. Open
if ( ( ( $title_type == 'archive' ) && is_post_type_archive( $wp_post_types ) && $prefix = "aiosp_{$title_type}_" ) ||
( ( $title_type == 'post' ) && $this->is_singular( $wp_post_types, $p ) && $prefix = "aiosp_" ) ) {
$post_type = get_post_type( $p );
if ( !empty( $aioseop_options["{$prefix}{$post_type}_title_format"] ) ) {
$title_format = $aioseop_options["{$prefix}{$post_type}_title_format"];
Consider simplifying this complex logical expression. Open
if ( ( $aiosp_noindex == 'on' ) || ( ( !empty( $aioseop_options['aiosp_paginated_noindex'] ) ) && ( ( $page > 1 ) ) ) ||
( ( $aiosp_noindex == '' ) && ( !empty( $aioseop_options['aiosp_cpostnoindex'] ) ) && ( in_array( $post_type, $aioseop_options['aiosp_cpostnoindex'] ) ) ) )
$noindex = "no" . $noindex;
Consider simplifying this complex logical expression. Open
if ( !is_object( $post ) && is_admin() && !empty( $_GET ) && !empty( $_GET['post_type'] ) && !empty( $_GET['taxonomy'] ) && !empty( $_GET['tag_ID'] ) ) {
$term = get_term_by( 'id', $_GET['tag_ID'], $_GET['taxonomy'] );
}