Showing 399 of 427 total issues
Function trim_excerpt_without_filters
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function trim_excerpt_without_filters( $text, $max = 0 ) {
$text = str_replace( ']]>', ']]>', $text );
$text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text );
$text = wp_strip_all_tags( $text );
if ( !$max ) $max = $this->maximum_description_length;
- 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_option_div
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function display_option_div( $buf, $args ) {
$name = $img = $desc = $checkbox = $class = '';
if ( isset( $args['options']['help_text'] ) && !empty( $args['options']['help_text'] ) )
$desc .= '<p class="aioseop_desc">' . $args['options']['help_text'] . '</p>';
if ($args['value']) $class = ' active';
- 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_add_contactmethods
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function aioseop_add_contactmethods( $contactmethods ) {
global $aioseop_options, $aioseop_modules;
if ( empty( $aioseop_options['aiosp_google_disable_profile'] ) )
$contactmethods['googleplus'] = __( 'Google+', 'all-in-one-seo-pack' );
if ( !empty( $aioseop_modules ) && is_object( $aioseop_modules ) ) {
- 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_term_priority_data
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function get_term_priority_data( $terms ) {
$prio = Array();
if (is_array( $terms ) ) {
$def_prio = $this->get_default_priority( 'taxonomies' );
$def_freq = $this->get_default_frequency( 'taxonomies' );
- 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_all_keywords
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_all_keywords() {
global $posts;
global $aioseop_options;
if ( is_404() ) return null;
// if we are on synthetic pages
Method parse_annotated_robots
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parse_annotated_robots( $robots ) {
$state = 0;
$rules = Array();
$opts = Array( 'sitemap', 'crawl-delay', 'user-agent', 'allow', 'disallow', 'comment' );
$rule = Array();
Method All_in_One_SEO_Pack_Performance
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function All_in_One_SEO_Pack_Performance( $mod ) {
$this->name = __('Performance', 'all-in-one-seo-pack'); // Human-readable name of the plugin
$this->prefix = 'aiosp_performance_'; // option prefix
$this->file = __FILE__; // the current file
parent::__construct();
Method get_prio_from_posts
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_prio_from_posts( $posts, $prio_override = false, $freq_override = false, $linkfunc = 'get_permalink' ) {
$prio = Array();
$args = Array( 'prio_override' => $prio_override, 'freq_override' => $freq_override, 'linkfunc' => $linkfunc );
if ( ( $prio_override ) && ( $freq_override ) )
$stats = 0;
Consider simplifying this complex logical expression. Open
if ( $aiosp_noindex || $aiosp_nofollow || $aiosp_noodp || $aiosp_noydir || !empty( $aioseop_options['aiosp_cpostnoindex'] )
|| !empty( $aioseop_options['aiosp_cpostnofollow'] ) || !empty( $aioseop_options['aiosp_cpostnoodp'] ) || !empty( $aioseop_options['aiosp_cpostnoydir'] )
|| !empty( $aioseop_options['aiosp_paginated_noindex'] ) || !empty( $aioseop_options['aiosp_paginated_nofollow'] ) ) {
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'] ) ) ) )
Method do_multi_input
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
function do_multi_input( $args ) {
extract( $args );
$buf1 = '';
$type = $options['type'];
if ( ( $type == 'radio' ) || ( $type == 'checkbox' ) ) {
Method aioseop_ajax_get_menu_links
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
function aioseop_ajax_get_menu_links() {
aioseop_ajax_init();
$options = Array();
parse_str( $_POST['options'], $options );
$_POST = $options;
Function get_post_title_format
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function get_post_title_format( $title_type = 'post', $p = null ) {
global $aioseop_options;
if ( ( $title_type != 'post' ) && ( $title_type != 'archive' ) ) return false;
$title_format = "%{$title_type}_title% | %blog_title%";
if ( isset( $aioseop_options["aiosp_{$title_type}_title_format"] ) )
- 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_current_options
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function get_current_options( $opts = Array(), $location = null, $defaults = null, $post = null ) {
$prefix = $this->get_prefix( $location );
$get_opts = '';
if ( empty( $location ) )
$type = '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 get_filesystem_object
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function get_filesystem_object( ) {
$cred = get_transient( 'aioseop_fs_credentials' );
if ( !empty( $cred ) ) $this->credentials = $cred;
if ( function_exists( 'WP_Filesystem' ) && ( WP_Filesystem( $this->credentials ) ) ) {
- 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_page_init
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function settings_page_init() {
add_filter( 'aiosp_output_option', Array( $this, 'display_custom_options' ), 10, 2 );
$cat = $this->options["{$this->prefix}categories"];
if ( !empty( $cat ) ) {
if ( $cat == 'blog' ) {
- 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_robots_meta
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_robots_meta() {
global $aioseop_options;
$opts = $this->meta_opts;
$page = $this->get_page_number();
$robots_meta = $tax_noindex = '';
Method annotate_robots_html
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function annotate_robots_html( $file, $show_help = false, $title = '' ) {
$robots = $this->annotate_robots( $file );
if( !empty( $robots ) ){
$buf = '<table class="widefat" ><thead>';
if ( !empty( $title ) ) {
Method get_all_post_type_data
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_all_post_type_data( $args ) {
$defaults = array(
'numberposts' => $this->max_posts, 'offset' => 0,
'category' => 0, 'orderby' => 'post_date',
'order' => 'DESC', 'include' => array(),
Method do_indexed_sitemaps
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function do_indexed_sitemaps() {
$this->start_memory_usage = memory_get_peak_usage();
$options = $this->options;
$this->do_write_sitemap( 'root' );
Method get_option_html
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_option_html( $args ) {
static $n = 0;
extract( $args );
if ( $options['type'] == 'custom' )
return apply_filters( "{$prefix}output_option", '', $args );