Showing 427 of 427 total issues
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( $this->$v) ) $preload["{$this->prefix}{$v}"] = $this->$v;
Avoid deeply nested control flow statements. Open
if ( count( $terms ) > 0 )
$term = $terms[0];
Function __construct
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function __construct() {
global $aioseop_options;
$this->log_file = dirname( __FILE__ ) . '/all_in_one_seo_pack.log';
if ( !empty( $aioseop_options ) && isset( $aioseop_options['aiosp_do_log'] ) && $aioseop_options['aiosp_do_log'] )
- 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 (($delim == '"' && $substr_chrs_c_2 != '\\\'') ||
($delim == "'" && $substr_chrs_c_2 != '\\"')) {
$utf8 .= $chrs{++$c};
}
Avoid deeply nested control flow statements. Open
if ( preg_match( '/' . $hosts . '/i', $hostname ) )
return true;
Avoid deeply nested control flow statements. Open
if ( !empty( $post_thumbnail_id ) ) {
$image = wp_get_attachment_image_src( $post_thumbnail_id, $size );
if ( is_array( $image ) ) {
$img[] = Array( 'type' => 'featured', 'id' => $post_thumbnail_id, 'link' => $image[0] );
}
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 ( $optimize ) $options[$prefix . 'robotgen'] = $robotgen;
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 ( empty( $options[$prefix . 'robotgen'] ) )
$options = $this->load_files( $options, Array( 'robotgen' => 'robots.txt' ), $prefix );
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";
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 ( is_array( $image ) ) {
$img[] = Array( 'type' => 'attachment', 'id' => $id, 'link' => $image[0] );
}
Avoid deeply nested control flow statements. Open
if ( empty( $link_list[$l['order']] ) ) $link_list[$l['order']] = Array();
Avoid deeply nested control flow statements. Open
if(!isset($output[$t]))
$output[$t] = array();
Avoid deeply nested control flow statements. Open
if ( is_array($output) )
$output[$t][] = $v;
Avoid deeply nested control flow statements. Open
if ( !empty( $image ) ) {
$img[] = Array( 'type' => 'meta_key', 'id' => $meta_key, 'link' => $image );
}
Avoid deeply nested control flow statements. Open
if ( empty( $keywords_i ) )
$keywords_i = stripslashes( $this->internationalize( get_post_meta( $id, "_aioseop_keywords", true ) ) );
Method get_default_values
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function get_default_values( $defaults, $prefix, &$cache, $item, $nodefaults = false, $type = '' ) {