Showing 399 of 427 total issues
Method filter_options
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function filter_options( $options ) {
if ( !isset( $this->default_options['posttypes' ]['initial_options'] ) ) $this->add_post_types();
if ( is_array( $options["{$this->prefix}posttypes"] ) && in_array( 'all', $options["{$this->prefix}posttypes"] ) && is_array( $this->default_options['posttypes' ]['initial_options'] ) )
$options["{$this->prefix}posttypes"] = array_keys( $this->default_options['posttypes' ]['initial_options'] );
if ( is_array( $options["{$this->prefix}taxonomies"] ) && in_array( 'all', $options["{$this->prefix}taxonomies"] ) && is_array( $this->default_options['taxonomies' ]['initial_options'] ) )
Function get_option_row
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function get_option_row( $name, $opts, $args ) {
$label_text = $input_attr = $help_text_2 = $id_attr = '';
if ( $opts['label'] == 'top' )
$align = 'left';
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 aioseop_mrt_pccolumn
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function aioseop_mrt_pccolumn($aioseopcn, $aioseoppi) {
$id = $aioseoppi;
$target = null;
if( $aioseopcn == 'seotitle' ) $target = 'title';
if( $aioseopcn == 'seokeywords' ) $target = 'keywords';
- 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 annotate_robots
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function annotate_robots( $robots ) {
$state = 0;
$rules = Array();
foreach ($robots as $l) {
$l = trim($l);
Method get_prio_calc
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_prio_calc( $date, $stats = 0 ) {
static $cur_time = null;
if ($cur_time === null) $cur_time = time();
$time = $cur_time - mysql2date( 'U', $date );
if ( !empty( $stats ) && isset( $stats['max'] ) && ( $stats['max'] ) ) {
Method get_problem_files
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_problem_files( $files, &$msg ) {
$problem_files = Array();
$use_wpfs = true;
$wpfs = $this->get_filesystem_object();
if ( !is_object( $wpfs ) ) {
Function admin_bar_menu
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function admin_bar_menu() {
global $wp_admin_bar, $aioseop_admin_menu, $aioseop_options, $post;
if ( !empty( $aioseop_options['aiosp_admin_bar'] ) ) {
$menu_slug = plugin_basename( __FILE__ );
- 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 apply_description_format
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function apply_description_format( $description, $post = null ) {
global $aioseop_options, $wp_query;
$description_format = $aioseop_options['aiosp_description_format'];
if ( !isset( $description_format ) || empty( $description_format ) ) {
$description_format = "%description%";
- 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_mrt_mkarry
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function aioseop_mrt_mkarry() {
global $aiosp;
global $aioseop_options;
$naioseop_options = $aiosp->default_options();
- 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 parse_parameters
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function parse_parameters( $input ) {
if (!isset($input) || !$input) return array();
$pairs = explode('&', $input);
- 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_tabs
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function display_tabs( $location ) {
if ( ( $location != null ) && isset( $locations[$location]['tabs'] ) )
$tabs = $locations['location']['tabs'];
else
$tabs = $this->tabs;
- 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_google_authorship
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_google_authorship( $post ) {
global $aioseop_options;
$page = $this->get_page_number();
// handle authorship
$googleplus = $publisher = $author = '';
Method save_post_data
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function save_post_data( $id ) {
$awmp_edit = $nonce = null;
if ( empty( $_POST ) ) return false;
if ( isset( $_POST[ 'aiosp_edit' ] ) ) $awmp_edit = $_POST['aiosp_edit'];
if ( isset( $_POST[ 'nonce-aioseop-edit' ] ) ) $nonce = $_POST['nonce-aioseop-edit'];
Method oauth_connect
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function oauth_connect( $count = 0 ) {
global $aiosp_activation;
if ( !class_exists( 'OAuthConsumer' ) ) require_once( 'OAuth.php' );
$url = '';
$callback_url = NULL;
Method All_in_One_SEO_Pack_File_Editor
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function All_in_One_SEO_Pack_File_Editor( ) {
$this->name = __('File Editor', 'all-in-one-seo-pack'); // Human-readable name of the plugin
$this->prefix = 'aiosp_file_editor_'; // option prefix
$this->file = __FILE__; // the current file
parent::__construct();
Method do_sitemap_scan
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function do_sitemap_scan() {
$msg = '';
if ( !empty( $this->options["{$this->prefix}rewrite"] ) && ( get_option('permalink_structure') == '' ) ) {
$msg = '<p>' . __( 'Warning: dynamic sitemap generation must have permalinks enabled.', 'all-in-one-seo-pack' ) . '</p>';
}
Method sitelinks_search_box
has 37 lines of code (exceeds 25 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"] ) ) {
Method custom_output_option
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function custom_output_option( $buf, $args ) {
if ( $args['name'] == 'aiosp_snippet' ) {
$args['options']['type'] = 'html';
$args['options']['nowrap'] = false;
$args['options']['save'] = false;
Method domnode_to_array
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function domnode_to_array( $node ) {
switch ( $node->nodeType ) {
case XML_CDATA_SECTION_NODE:
case XML_TEXT_NODE:
return trim( $node->textContent );
Function oauth_connect
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function oauth_connect( $count = 0 ) {
global $aiosp_activation;
if ( !class_exists( 'OAuthConsumer' ) ) require_once( 'OAuth.php' );
$url = '';
$callback_url = NULL;
- 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"