Showing 399 of 427 total issues
Function get_child_sitemap_urls
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
function get_child_sitemap_urls() {
$siteurls = Array();
$blogs = $this->get_child_blogs();
if ( !empty( $blogs ) ) {
$option_name = $this->get_option_name();
- 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_robots_meta
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
function get_robots_meta() {
global $aioseop_options;
$opts = $this->meta_opts;
$page = $this->get_page_number();
$robots_meta = $tax_noindex = '';
- 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_options
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
function filter_options( $options ) {
if ( !isset( $this->default_options['posttypes' ]['initial_options'] ) ) $this->add_post_types();
if ( is_array( $options["{$this->prefix}posttypes"] ) && in_array( 'all', $options["{$this->prefix}posttypes"] ) && is_array( $this->default_options['posttypes' ]['initial_options'] ) )
$options["{$this->prefix}posttypes"] = array_keys( $this->default_options['posttypes' ]['initial_options'] );
if ( is_array( $options["{$this->prefix}taxonomies"] ) && in_array( 'all', $options["{$this->prefix}taxonomies"] ) && is_array( $this->default_options['taxonomies' ]['initial_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
Method get_aioseop_title
has 178 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_aioseop_title( $post ) {
global $aioseop_options;
// the_search_query() is not suitable, it cannot just return
global $s, $STagging;
$opts = $this->meta_opts;
Function aiosp_mrt_get_url
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
function aiosp_mrt_get_url( $query, $show_page = true ) {
if ( $query->is_404 || $query->is_search )
return false;
$link = '';
- 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 display_settings_page
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
function display_settings_page( $location = null ) {
if ( $location != null ) $location_info = $this->locations[$location];
$name = null;
if ( ( $location ) && ( isset( $location_info['name'] ) ) ) $name = $location_info['name'];
if ( !$name ) $name = $this->name;
- 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 decode
has 171 lines of code (exceeds 25 allowed). Consider refactoring. Open
function decode($str)
{
$str = $this->reduce_string($str);
switch (strtolower($str)) {
Method __construct
has 170 lines of code (exceeds 25 allowed). Consider refactoring. Open
function __construct( ) {
if ( get_class( $this ) === 'All_in_One_SEO_Pack_Sitemap' ) { // Set this up only when instantiated as this class
$this->name = __( 'XML Sitemap', 'all-in-one-seo-pack' ); // Human-readable name of the plugin
$this->prefix = 'aiosp_sitemap_'; // option prefix
$this->file = __FILE__; // the current file
Function aioseop_ajax_scan_header
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
function aioseop_ajax_scan_header() {
$_POST["options"] = "foo";
aioseop_ajax_init();
$options = Array();
parse_str( $_POST['options'], $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
File aioseop_utility.php
has 444 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @package All-in-One-SEO-Pack
*/
$UTF8_TABLES = Array();
Function filter_settings
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
function filter_settings( $settings, $location, $current ) {
if ( $location == 'opengraph' || $location == 'settings' ) {
$prefix = $this->get_prefix( $location ) . $location . '_';
if ( $location == 'opengraph' ) return $settings;
if ( $location == 'settings' ) {
- 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 aiosp_google_analytics
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
function aiosp_google_analytics() {
global $aioseop_options;
$analytics = '';
if ( !empty( $aioseop_options['aiosp_ga_advanced_options'] ) && !empty( $aioseop_options['aiosp_ga_exclude_users'] ) ) {
if ( is_user_logged_in() ) {
- 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 load_module
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
function load_module( $mod ) {
static $feature_options = null;
static $feature_prefix = null;
if ( !is_array( $this->modules ) ) return false;
$v = $this->modules[ $mod ];
- 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_simple_sitemap
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
function get_simple_sitemap() {
$home = Array(
'loc' => get_home_url(),
'priority' => $this->get_default_priority( 'homepage' ),
'changefreq' => $this->get_default_frequency( 'homepage' )
- 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
Consider simplifying this complex logical expression. Open
if ( ( is_category() && !empty( $aioseop_options['aiosp_category_noindex'] ) ) || ( !is_category() && is_archive() && !is_tag() && !is_tax()
&& ( ( is_date() && !empty( $aioseop_options['aiosp_archive_date_noindex'] ) ) || ( is_author() && !empty( $aioseop_options['aiosp_archive_author_noindex'] ) ) ) )
|| ( is_tag() && !empty( $aioseop_options['aiosp_tags_noindex'] ) )
|| ( is_search() && !empty( $aioseop_options['aiosp_search_noindex'] ) )
|| ( is_404() && !empty( $aioseop_options['aiosp_404_noindex'] ) )
Method default_bad_bots
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
function default_bad_bots() {
$botlist = Array(
"Abonti",
"aggregator",
"AhrefsBot",
Function parse_ini_helper
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
function parse_ini_helper( $array ) {
$returnArray = array();
if (is_array($array)) {
foreach ($array as $key => $value) {
$e = explode(':', $key);
- 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_export
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
function settings_export( $buf ) {
global $aiosp;
$post_types = null;
$has_data = null;
$general_settings = null;
- 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 domnode_to_array
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
function domnode_to_array( $node ) {
switch ( $node->nodeType ) {
case XML_CDATA_SECTION_NODE:
case XML_TEXT_NODE:
return trim( $node->textContent );
- 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_all_post_counts
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
function get_all_post_counts( $args ) {
$post_counts = null;
$status = 'inherit';
if ( !empty( $args['post_status'] ) ) $status = $args['post_status'];
if ( !empty( $args ) && !empty( $args['post_type'] ) )
- 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"