Showing 427 of 427 total issues
Function get_aioseop_title
has a Cognitive Complexity of 519 (exceeds 5 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;
- 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_class.php
has 3243 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @package All-in-One-SEO-Pack
*/
/**
Function add_meta
has a Cognitive Complexity of 229 (exceeds 5 allowed). Consider refactoring. Open
function add_meta( ) {
global $post, $aiosp, $aioseop_options, $wp_query;
$metabox = $this->get_current_options( Array(), 'settings' );
$key = $this->options['aiosp_opengraph_key'];
$dimg = $this->options['aiosp_opengraph_dimg'];
- 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_module_class.php
has 1640 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @package All-in-One-SEO-Pack
*/
/**
File aioseop_sitemap.php
has 1561 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @package All-in-One-SEO-Pack
*/
/**
Method __construct
has 730 lines of code (exceeds 25 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'] )
Function get_original_title
has a Cognitive Complexity of 175 (exceeds 5 allowed). Consider refactoring. Open
function get_original_title( $sep = '|', $echo = false, $seplocation = '' ) {
global $aioseop_options;
if ( !empty( $aioseop_options['aiosp_use_original_title'] ) ) {
$has_filter = has_filter( 'wp_title', Array( $this, 'wp_title' ) );
if ( $has_filter !== 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 do_importer_exporter
has a Cognitive Complexity of 143 (exceeds 5 allowed). Consider refactoring. Open
function do_importer_exporter( ) {
$submit = null; $count = 0; $post_exists = null; $post_warning = null;
global $aioseop_options, $aiosp, $aioseop_module_list;
if ( isset( $_REQUEST['nonce-aioseop'] ) ) $nonce = $_REQUEST['nonce-aioseop'];
$post_fields = Array( 'keywords', 'description', 'title', 'meta', 'disable', 'disable', 'disable_analytics', 'titleatr', 'menulabel', 'togglekeywords' );
- 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 setting_options
has a Cognitive Complexity of 129 (exceeds 5 allowed). Consider refactoring. Open
function setting_options( $location = null, $defaults = null ) {
if ( $defaults === null )
$defaults = $this->default_options;
$prefix = $this->get_prefix( $location );
$opts = 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
Function oauth_init
has a Cognitive Complexity of 109 (exceeds 5 allowed). Consider refactoring. Open
function oauth_init() {
if ( !is_user_logged_in() || !current_user_can( 'manage_options' ) ) return false;
$this->token = "anonymous";
$this->secret = "anonymous";
$preload = $this->get_class_option();
- 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 output_sitemap
has a Cognitive Complexity of 98 (exceeds 5 allowed). Consider refactoring. Open
function output_sitemap( $urls, $comment = '' ) {
$max_items = 50000;
if ( !is_array( $urls ) ) return null;
echo '<?xml version="1.0" encoding="UTF-8"?>' . "\r\n\r\n";
echo "<!-- " . sprintf( $this->comment_string, $comment, AIOSEOP_VERSION, date('D, d M Y H:i:s e') ) . " -->\r\n";
- 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_images_by_type
has a Cognitive Complexity of 96 (exceeds 5 allowed). Consider refactoring. Open
function get_all_images_by_type( $options = null, $p = null ) {
$img = Array();
if ( empty( $img ) ) {
$size = apply_filters( 'post_thumbnail_size', 'large' );
- 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_opengraph.php
has 802 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @package All-in-One-SEO-Pack
*/
/**
Function admin_menu
has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring. Open
function admin_menu() {
$file = plugin_basename( __FILE__ );
$menu_name = __( 'All in One SEO', 'all-in-one-seo-pack' );
$this->locations['aiosp']['default_options']['nonce-aioseop-edit']['default'] = wp_create_nonce('edit-aioseop-nonce');
- 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 decode
has a Cognitive Complexity of 88 (exceeds 5 allowed). Consider refactoring. Open
function decode($str)
{
$str = $this->reduce_string($str);
switch (strtolower($str)) {
- 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
All_in_One_SEO_Pack_Module
has 91 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class All_in_One_SEO_Pack_Module {
public static $instance = null;
protected $plugin_name;
protected $name;
protected $menu_name;
All_in_One_SEO_Pack
has 90 functions (exceeds 20 allowed). Consider refactoring. Open
class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
/** The current version of the plugin. **/
var $version = AIOSEOP_VERSION;
Function filter_options
has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring. Open
function filter_options( $options, $location ) {
if ( $location ) $prefix = $this->get_prefix( $location ) . $location . '_';
if ( $location === 'generator' ) {
$optimize = false;
$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 get_serverinfo
has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring. Open
function get_serverinfo() {
global $wpdb;
global $wp_version;
$sqlversion = $wpdb->get_var("SELECT VERSION() AS version");
- 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_functions.php
has 682 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @package All-in-One-SEO-Pack
*/
/**