Showing 427 of 427 total issues
Consider simplifying this complex logical expression. Open
if ( ( $aiosp_nofollow == 'on' ) || ( ( !empty( $aioseop_options['aiosp_paginated_nofollow'] ) ) && ( ( $page > 1 ) ) ) ||
( ( $aiosp_nofollow == '' ) && ( !empty( $aioseop_options['aiosp_cpostnofollow'] ) ) && ( in_array( $post_type, $aioseop_options['aiosp_cpostnofollow'] ) ) ) )
$nofollow = "no" . $nofollow;
Consider simplifying this complex logical expression. Open
if ( empty( $description ) && $first_page && ( !empty( $this->options['aiosp_opengraph_generate_descriptions'] ) ) && !empty( $post ) && !empty( $post->post_content ) && !post_password_required( $post ) )
$description = $aiosp->trim_excerpt_without_filters( $aiosp->internationalize( preg_replace( '/\s+/', ' ', $post->post_content ) ), 1000 );
Method Services_JSON_Error
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function Services_JSON_Error($message = 'unknown error', $code = null,
$mode = null, $options = null, $userinfo = null)
Method title_placeholder_helper
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function title_placeholder_helper( $title, $post, $type = 'post', $title_format = '', $category = '' ) {
Method Services_JSON_Error
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function Services_JSON_Error($message = 'unknown error', $code = null,
$mode = null, $options = null, $userinfo = null)
Method from_consumer_and_token
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters=NULL) {
Method load_file
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function load_file( $filename, $use_include_path = false, $context = null, $offset = -1, $maxlen = -1 ) {
Function do_load_module
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function do_load_module( $mod, $args = null ) {
$mod_path = apply_filters( "aioseop_include_$mod", AIOSEOP_PLUGIN_DIR . "aioseop_$mod.php" );
if ( !empty( $mod_path ) )
require_once( $mod_path );
$ref = "aioseop_$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 paged_title
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function paged_title( $title ) {
// the page number if paged
global $paged;
global $aioseop_options;
// simple tagging support
- 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_page_icon
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function add_page_icon() {
wp_enqueue_script( 'wp-pointer', false, array( 'jquery' ) );
wp_enqueue_style( 'wp-pointer' );
$this->add_admin_pointers();
?>
- 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 template_redirect
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function template_redirect() {
global $aioseop_options;
$post = $this->get_queried_object();
- 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 sitelinks_search_box
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function sitelinks_search_box() {
global $aioseop_options;
$home_url = esc_url( get_home_url() );
$name_block = $search_block = '';
if ( !empty( $aioseop_options["aiosp_google_set_site_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 check_signature
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function check_signature($request, $consumer, $token, $signature) {
$built = $this->build_signature($request, $consumer, $token);
// Check for zero length, although unlikely here
if (strlen($built) == 0 || strlen($signature) == 0) {
- 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_meta_key
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function get_the_image_by_meta_key( $args = array() ) {
/* If $meta_key is not an array. */
if ( !is_array( $args['meta_key'] ) )
$args['meta_key'] = array( $args['meta_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 is_aioseop_active_on_blog
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function is_aioseop_active_on_blog( $bid = false ) {
global $blog_id;
if ( empty( $bid ) || ( $bid == $blog_id ) || !is_multisite() ) return true;
if ( ! function_exists( 'is_plugin_active_for_network' ) )
require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
- 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_post_thumbnail
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function get_the_image_by_post_thumbnail( $p = null ) {
if ( $p === null ) {
global $post;
} 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 urlencode_rfc3986
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function urlencode_rfc3986($input) {
if (is_array($input)) {
return array_map(array('OAuthUtil', 'urlencode_rfc3986'), $input);
} else if (is_scalar($input)) {
return str_replace(
- 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 set_parameter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function set_parameter($name, $value, $allow_duplicates = true) {
if ($allow_duplicates && isset($this->parameters[$name])) {
// We have already added parameter(s) with this name, so add to the list
if (is_scalar($this->parameters[$name])) {
// This is the first duplicate, so transform scalar (string)
- 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 __construct
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function __construct( ) {
$this->name = __('Robots.txt', 'all-in-one-seo-pack'); // Human-readable name of the plugin
$this->prefix = 'aiosp_robots_'; // 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
Function aioseop_get_pages
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function aioseop_get_pages( $pages ) {
global $aioseop_get_pages_start;
if ( !$aioseop_get_pages_start ) return $pages;
foreach ( $pages as $k => $v ) {
$postID = $v->ID;
- 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"