Showing 399 of 427 total issues
Function get_main_keywords
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function get_main_keywords() {
global $aioseop_options;
global $aioseop_keywords;
global $post;
$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
Function build_http_query
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function build_http_query($params) {
if (!$params) return '';
// Urlencode both keys and values
$keys = OAuthUtil::urlencode_rfc3986(array_keys($params));
- 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 to_header
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function to_header($realm=null) {
$first = true;
if($realm) {
$out = 'Authorization: OAuth realm="' . OAuthUtil::urlencode_rfc3986($realm) . '"';
$first = 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 aioseop_ajax_init
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function aioseop_ajax_init() {
if ( !empty( $_POST ) && !empty( $_POST['settings'] ) && (!empty( $_POST['nonce-aioseop'])||(!empty( $_POST['nonce-aioseop-edit']))) && !empty( $_POST['options'] ) ) {
$_POST = stripslashes_deep( $_POST );
$settings = esc_attr( $_POST['settings'] );
if ( ! defined( 'AIOSEOP_AJAX_MSG_TMPL' ) )
- 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_build_sitemap
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function do_build_sitemap( $sitemap_type, $page = 0, $filename = '', $comment = '' ) {
if ( empty( $filename ) ) {
if ( $sitemap_type == 'root' ) {
$filename = $this->options["{$this->prefix}filename"];
} 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
Method load_module
has 35 lines of code (exceeds 25 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 ];
Method filter_settings
has 35 lines of code (exceeds 25 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' ) {
Method add_attributes
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function add_attributes( $output ) { // avoid having duplicate meta tags
$type = $this->type;
if ( empty( $type ) ) $type = 'website';
$schema_types = Array(
Consider simplifying this complex logical expression. Open
if ( ( ( is_front_page() && $aioseop_options['aiosp_home_keywords'] && !$this->is_static_posts_page() ) || $this->is_static_front_page() ) ) {
if ( !empty( $aioseop_options['aiosp_use_static_home_info'] ) ) {
$keywords = $this->get_all_keywords();
} else {
$keywords = trim( $this->internationalize( $aioseop_options['aiosp_home_keywords'] ) );
Method All_in_One_SEO_Pack_Importer_Exporter
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function All_in_One_SEO_Pack_Importer_Exporter( ) {
$this->name = __( 'Importer & Exporter', 'all-in-one-seo-pack' ); // Human-readable name of the module
$this->prefix = 'aiosp_importer_exporter_'; // option prefix
$this->file = __FILE__;
parent::__construct();
Method is_page_included
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function is_page_included() {
global $aioseop_options;
if ( is_feed() ) return false;
if ( aioseop_mrt_exclude_this_page() ) return false;
$post = $this->get_queried_object();
Method aioseop_mrt_exclude_this_page
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function aioseop_mrt_exclude_this_page( $url = null ) {
static $excluded = false;
if ( $excluded === false ) {
global $aioseop_options;
$ex_pages = '';
Method settings_export
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function settings_export( $buf ) {
global $aiosp;
$post_types = null;
$has_data = null;
$general_settings = null;
Method generate_htaccess_blocklist
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generate_htaccess_blocklist() {
if ( !$this->option_isset( 'htaccess_rules' ) ) return;
if ( function_exists( 'apache_get_modules' ) ) {
$modules = apache_get_modules();
foreach( Array( 'mod_authz_host', 'mod_setenvif' ) as $m ) {
Function aioseop_eval_condshow_logic
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function aioseop_eval_condshow_logic( statement ) {
var lhs, rhs;
if ( ( typeof statement ) == 'object' ) {
lhs = statement['lhs'];
rhs = statement['rhs'];
- 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_post_description
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function get_post_description( $post ) {
global $aioseop_options;
$description = '';
if ( !$this->show_page_description() ) {
return '';
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
function get_current_options( $opts = Array(), $location = null, $defaults = null, $post = null ) {
if ( ( $location === 'aiosp' ) && ( $this->locations[$location]['type'] == 'metabox' ) ) {
if ( $post == null ) {
global $post;
}
- 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_hooks
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function add_page_hooks() {
$memory_usage = memory_get_peak_usage() / 1024 / 1024;
if ( $memory_usage > 32 ) {
unset( $this->default_options['memory_limit']['initial_options']['32M'] );
if ( $memory_usage > 64 ) unset( $this->default_options['memory_limit']['initial_options']['64M'] );
- 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 delete_file
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function delete_file( $filename ) {
$wpfs = $this->get_filesystem_object();
if ( is_object( $wpfs ) ) {
if ( $wpfs->exists( $filename ) ) {
if ( $wpfs->delete( $filename ) === 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 save_file
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function save_file( $filename, $contents ) {
$failed_str = __( sprintf( "Failed to write file %s!\n", $filename ), 'all-in-one-seo-pack' );
$readonly_str = __( sprintf( "File %s isn't writable!\n", $filename ), 'all-in-one-seo-pack' );
$wpfs = $this->get_filesystem_object();
if ( is_object( $wpfs ) ) {
- 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"