Showing 399 of 427 total issues
Function type_setup
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
function type_setup() {
global $aiosp, $wp_query;
$this->type = '';
if ( $aiosp->is_static_front_page() ) {
if ( !empty( $this->options ) && !empty( $this->options['aiosp_opengraph_categories'] ) )
- 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_addl_pages
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
function get_addl_pages() {
$home = Array();
$home = Array(
'loc' => get_home_url(),
'priority' => $this->get_default_priority( '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
Function aioseop_do_condshow_match
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function aioseop_do_condshow_match( index, value ) {
if ( typeof value != 'undefined' ) {
matches = true;
jQuery.each(value, function(subopt, setting) {
var statement;
Method handle_settings_updates
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function handle_settings_updates( $location = null ) {
$message = '';
if ( (isset($_POST['action']) && $_POST['action'] == 'aiosp_update_module' &&
( isset( $_POST['Submit_Default'] ) || isset( $_POST['Submit_All_Default'] ) || !empty( $_POST['Submit'] ) ) ) ) {
$nonce = $_POST['nonce-aioseop'];
Method get_child_sitemap_urls
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function get_child_sitemap_urls() {
$siteurls = Array();
$blogs = $this->get_child_blogs();
if ( !empty( $blogs ) ) {
$option_name = $this->get_option_name();
Method recursive_parse
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function recursive_parse( $array ) {
$returnArray = array();
if (is_array($array)) {
foreach ($array as $key => $value) {
if (is_array($value)) {
Method from_request
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function from_request($http_method=NULL, $http_url=NULL, $parameters=NULL) {
$scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on")
? 'http'
: 'https';
$http_url = ($http_url) ? $http_url : $scheme .
Method convert_case
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function convert_case( $str, $mode = 'upper' ) {
static $charset = null;
if ( $charset == null ) $charset = get_bloginfo( 'charset' );
$str = (string)$str;
if ( $mode == 'title' ) {
Method title_placeholder_helper
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function title_placeholder_helper( $title, $post, $type = 'post', $title_format = '', $category = '' ) {
if ( !empty( $post ) )
$authordata = get_userdata( $post->post_author );
else
$authordata = new WP_User();
Method check_rewrite_handler
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function check_rewrite_handler() {
global $aioseop_options;
$force_rewrites = 1;
if ( isset( $aioseop_options['aiosp_force_rewrites'] ) )
Method get_headers
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function get_headers() {
if (function_exists('apache_request_headers')) {
// we need this to get the actual Authorization: header
// because apache tends to tell us it doesn't exist
$headers = apache_request_headers();
Method post_data_export
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function post_data_export( $prefix = '_aioseop', $query = Array( 'posts_per_page' => -1 ) ) {
$buf = '';
$posts_query = new WP_Query( $query );
while ($posts_query->have_posts() ) {
$posts_query->the_post();
Method get_admin_links
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function get_admin_links() {
if ( !empty( $this->menu_name ) )
$name = $this->menu_name;
else
$name = $this->name;
Method aioseop_ajax_delete_url
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function aioseop_ajax_delete_url() {
aioseop_ajax_init();
$options = Array();
$options = esc_attr( $_POST['options'] );
$_POST['action'] = 'aiosp_update_module';
Method add_post_types
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function add_post_types() {
$post_type_titles = $this->get_post_type_titles( Array( 'public' => true ) );
$taxonomy_titles = $this->get_taxonomy_titles( Array( 'public' => true ) );
if ( isset( $post_type_titles['attachment'] ) ) $post_type_titles['attachment'] = __( "Media / Attachments", 'all-in-one-seo-pack' );
$this->default_options['posttypes' ]['initial_options'] = array_merge( Array( 'all' => __( 'All Post Types', 'all-in-one-seo-pack' ) ), $post_type_titles );
Method do_sitemaps
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function do_sitemaps( $message = '' ) {
if ( !empty( $this->options["{$this->prefix}indexes"] ) && !empty( $this->options["{$this->prefix}paginate"] ) ) {
$this->paginate = true;
if ( ( $this->options["{$this->prefix}max_posts"] ) && ( $this->options["{$this->prefix}max_posts"] > 0 ) && ( $this->options["{$this->prefix}max_posts"] < 50000 ) )
$this->max_posts = $this->options["{$this->prefix}max_posts"];
Method filter_display_options
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function filter_display_options( $options ) {
if ( is_multisite() ) $options[ $this->prefix . 'rewrite'] = 'On';
if ( isset( $options[ $this->prefix . 'max_posts'] ) && ( ( $options[ $this->prefix . 'max_posts'] <= 0 ) || ( $options[ $this->prefix . 'max_posts'] >= 50000 ) ) )
$options[ $this->prefix . 'max_posts'] = 50000;
$url = trailingslashit( get_home_url() ) . $options[ $this->prefix . 'filename' ] . '.xml';
Method parse_ini_helper
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function parse_ini_helper( $array ) {
$returnArray = array();
if (is_array($array)) {
foreach ($array as $key => $value) {
$e = explode(':', $key);
Method default_bad_referers
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function default_bad_referers() {
$referlist = Array(
'semalt.com',
'kambasoft.com',
'savetubevideo.com',
Method sitemap_output_hook
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function sitemap_output_hook($query) {
$page = 0;
if ( ( $this->options["{$this->prefix}rewrite"] ) )
if( !empty( $query->query_vars["{$this->prefix}path"] ) ) {
if( !empty( $query->query_vars["{$this->prefix}page"] ) )