wp-plugins/all-in-one-seo-pack

View on GitHub
aioseop_class.php

Summary

Maintainability
F
2 mos
Test Coverage

Function get_aioseop_title has a Cognitive Complexity of 519 (exceeds 5 allowed). Consider refactoring.
Open

    function get_aioseop_title( $post ) {
        global $aioseop_options;
        // the_search_query() is not suitable, it cannot just return
        global $s, $STagging;
        $opts = $this->meta_opts;
Severity: Minor
Found in aioseop_class.php - About 1 wk to fix

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

File aioseop_class.php has 3243 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * @package All-in-One-SEO-Pack
 */
/**
Severity: Major
Found in aioseop_class.php - About 1 wk to fix

    Method __construct has 730 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function __construct() {
            global $aioseop_options;
            $this->log_file = dirname( __FILE__ ) . '/all_in_one_seo_pack.log';
        
            if ( !empty( $aioseop_options ) && isset( $aioseop_options['aiosp_do_log'] ) && $aioseop_options['aiosp_do_log'] )
    Severity: Major
    Found in aioseop_class.php - About 3 days to fix

      Function get_original_title has a Cognitive Complexity of 175 (exceeds 5 allowed). Consider refactoring.
      Open

          function get_original_title( $sep = '|', $echo = false, $seplocation = '' ) {
              global $aioseop_options;
              if ( !empty( $aioseop_options['aiosp_use_original_title'] ) ) {
                  $has_filter = has_filter( 'wp_title', Array( $this, 'wp_title' ) );
                  if ( $has_filter !== false )
      Severity: Minor
      Found in aioseop_class.php - About 3 days to fix

      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 oauth_init has a Cognitive Complexity of 109 (exceeds 5 allowed). Consider refactoring.
      Open

          function oauth_init() {
              if ( !is_user_logged_in() || !current_user_can( 'manage_options' ) ) return false;
              $this->token = "anonymous";
              $this->secret = "anonymous";
              $preload = $this->get_class_option();
      Severity: Minor
      Found in aioseop_class.php - About 2 days to fix

      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 admin_menu has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring.
      Open

          function admin_menu() {
              $file = plugin_basename( __FILE__ );
              $menu_name = __( 'All in One SEO', 'all-in-one-seo-pack' );
      
              $this->locations['aiosp']['default_options']['nonce-aioseop-edit']['default'] = wp_create_nonce('edit-aioseop-nonce');
      Severity: Minor
      Found in aioseop_class.php - About 1 day to fix

      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

      All_in_One_SEO_Pack has 90 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
      
          /** The current version of the plugin. **/
           var $version = AIOSEOP_VERSION;
           
      Severity: Major
      Found in aioseop_class.php - About 1 day to fix

        Function get_page_snippet_info has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
        Open

            function get_page_snippet_info() {
                static $info = Array();
                if ( !empty( $info ) )
                    return $info;
                global $post, $aioseop_options, $wp_query;
        Severity: Minor
        Found in aioseop_class.php - About 1 day to fix

        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 wp_head has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
        Open

            function wp_head() {
                    if ( !$this->is_page_included() ) return;
                    $opts = $this->meta_opts;
                    global $wp_query, $aioseop_options, $posts;
                    static $aioseop_dup_counter = 0;
        Severity: Minor
        Found in aioseop_class.php - About 1 day to fix

        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 universal_analytics has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
        Open

            function universal_analytics() {
                global $aioseop_options;
                $analytics = '';
                if ( !empty( $aioseop_options['aiosp_ga_use_universal_analytics'] ) ) {
                    $allow_linker = $cookie_domain = $domain = $addl_domains = $domain_list = '';
        Severity: Minor
        Found in aioseop_class.php - About 1 day to fix

        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_all_keywords has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
        Open

            function get_all_keywords() {
                global $posts;
                global $aioseop_options;
                if ( is_404() ) return null;
                // if we are on synthetic pages
        Severity: Minor
        Found in aioseop_class.php - About 1 day to fix

        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_prev_next_links has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
        Open

            function get_prev_next_links( $post = null ) {
                $prev = $next = '';
                $page = $this->get_page_number();
                if ( is_home() || is_archive() || is_paged() ) {
                    global $wp_query;
        Severity: Minor
        Found in aioseop_class.php - About 1 day to fix

        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_robots_meta has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
        Open

            function get_robots_meta() {
                global $aioseop_options;
                $opts = $this->meta_opts;
                $page = $this->get_page_number();
                $robots_meta = $tax_noindex = '';
        Severity: Minor
        Found in aioseop_class.php - About 7 hrs to fix

        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_aioseop_title has 178 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function get_aioseop_title( $post ) {
                global $aioseop_options;
                // the_search_query() is not suitable, it cannot just return
                global $s, $STagging;
                $opts = $this->meta_opts;
        Severity: Major
        Found in aioseop_class.php - About 7 hrs to fix

          Function aiosp_mrt_get_url has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
          Open

              function aiosp_mrt_get_url( $query, $show_page = true ) {
                  if ( $query->is_404 || $query->is_search )
                      return false;
                  
                  $link = '';
          Severity: Minor
          Found in aioseop_class.php - About 7 hrs to fix

          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 aiosp_google_analytics has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
          Open

          function aiosp_google_analytics() {
              global $aioseop_options;
              $analytics = '';
              if ( !empty( $aioseop_options['aiosp_ga_advanced_options'] ) && !empty( $aioseop_options['aiosp_ga_exclude_users'] ) ) {
                  if ( is_user_logged_in() ) {
          Severity: Minor
          Found in aioseop_class.php - About 6 hrs to fix

          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

          Consider simplifying this complex logical expression.
          Open

                  if ( ( is_category() && !empty( $aioseop_options['aiosp_category_noindex'] ) ) || ( !is_category() && is_archive() && !is_tag() && !is_tax()
                      && ( ( is_date() && !empty( $aioseop_options['aiosp_archive_date_noindex'] ) ) || ( is_author() && !empty( $aioseop_options['aiosp_archive_author_noindex'] ) ) ) ) 
                      || ( is_tag() && !empty( $aioseop_options['aiosp_tags_noindex'] ) ) 
                      || ( is_search() && !empty( $aioseop_options['aiosp_search_noindex'] ) )
                       || ( is_404() && !empty( $aioseop_options['aiosp_404_noindex'] ) )
          Severity: Critical
          Found in aioseop_class.php - About 6 hrs to fix

            Method oauth_init has 132 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function oauth_init() {
                    if ( !is_user_logged_in() || !current_user_can( 'manage_options' ) ) return false;
                    $this->token = "anonymous";
                    $this->secret = "anonymous";
                    $preload = $this->get_class_option();
            Severity: Major
            Found in aioseop_class.php - About 5 hrs to fix

              Function filter_settings has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
              Open

                  function filter_settings( $settings, $location, $current ) {
                      if ( $location == null ) {
                          $prefix = $this->prefix;
                          
                          foreach ( Array( 'seopostcol', 'seocustptcol', 'debug_info', 'max_words_excerpt' ) as $opt )
              Severity: Minor
              Found in aioseop_class.php - About 5 hrs to fix

              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 title_placeholder_helper has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
              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();
              Severity: Minor
              Found in aioseop_class.php - About 5 hrs to fix

              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_google_authorship has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
              Open

                  function get_google_authorship( $post ) {
                      global $aioseop_options;
                      $page = $this->get_page_number();
                      // handle authorship
                      $googleplus = $publisher = $author = '';
              Severity: Minor
              Found in aioseop_class.php - About 5 hrs to fix

              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 custom_output_option has a Cognitive Complexity of 33 (exceeds 5 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;
              Severity: Minor
              Found in aioseop_class.php - About 4 hrs to fix

              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 aiosp_google_analytics has 120 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function aiosp_google_analytics() {
                  global $aioseop_options;
                  $analytics = '';
                  if ( !empty( $aioseop_options['aiosp_ga_advanced_options'] ) && !empty( $aioseop_options['aiosp_ga_exclude_users'] ) ) {
                      if ( is_user_logged_in() ) {
              Severity: Major
              Found in aioseop_class.php - About 4 hrs to fix

                Method wp_head has 118 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function wp_head() {
                            if ( !$this->is_page_included() ) return;
                            $opts = $this->meta_opts;
                            global $wp_query, $aioseop_options, $posts;
                            static $aioseop_dup_counter = 0;
                Severity: Major
                Found in aioseop_class.php - About 4 hrs to fix

                  Function save_post_data has a Cognitive Complexity of 30 (exceeds 5 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'];
                  Severity: Minor
                  Found in aioseop_class.php - About 4 hrs to fix

                  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

                  Consider simplifying this complex logical expression.
                  Open

                          if ( get_query_var( 'm' ) ) {
                              $m = preg_replace( '/[^0-9]/', '', get_query_var( 'm' ) );
                              switch ( $this->strlen( $m ) ) {
                                  case 4: $link = get_year_link( $m ); break;
                                  case 6: $link = get_month_link( $this->substr( $m, 0, 4), $this->substr($m, 4, 2 ) ); break;
                  Severity: Critical
                  Found in aioseop_class.php - About 4 hrs to fix

                    Function get_main_description has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                    Open

                        function get_main_description( $post = null ) {
                            global $aioseop_options;
                            $opts = $this->meta_opts;
                            $description = '';
                            if ( is_author()  && $this->show_page_description() ) {
                    Severity: Minor
                    Found in aioseop_class.php - About 4 hrs to fix

                    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 add_page_icon has 101 lines of code (exceeds 25 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();
                            ?>
                    Severity: Major
                    Found in aioseop_class.php - About 4 hrs to fix

                      Method admin_menu has 97 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function admin_menu() {
                              $file = plugin_basename( __FILE__ );
                              $menu_name = __( 'All in One SEO', 'all-in-one-seo-pack' );
                      
                              $this->locations['aiosp']['default_options']['nonce-aioseop-edit']['default'] = wp_create_nonce('edit-aioseop-nonce');
                      Severity: Major
                      Found in aioseop_class.php - About 3 hrs to fix

                        Function is_page_included has a Cognitive Complexity of 26 (exceeds 5 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();
                        Severity: Minor
                        Found in aioseop_class.php - About 3 hrs to fix

                        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_page_snippet_info has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function get_page_snippet_info() {
                                static $info = Array();
                                if ( !empty( $info ) )
                                    return $info;
                                global $post, $aioseop_options, $wp_query;
                        Severity: Major
                        Found in aioseop_class.php - About 3 hrs to fix

                          Function filter_options has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                          Open

                              function filter_options( $options, $location ) {
                                  if ( $location == 'aiosp' ) {
                                      global $post;
                                      if ( !empty( $post ) ) {
                                          $prefix = $this->prefix;
                          Severity: Minor
                          Found in aioseop_class.php - About 3 hrs to fix

                          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 add_page_hooks has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function add_page_hooks() {
                          //        $this->oauth_init();
                                  $post_objs = get_post_types( '', 'objects' );
                                  $pt = array_keys( $post_objs );
                                  $rempost = array( 'revision', 'nav_menu_item' );
                          Severity: Major
                          Found in aioseop_class.php - About 2 hrs to fix

                            Method display_extra_metaboxes has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function display_extra_metaboxes( $add, $meta ) {
                                    echo "<div class='aioseop_metabox_wrapper' >";
                                    switch ( $meta['id'] ) {
                                        case "aioseop-about":
                                            ?><div class="aioseop_metabox_text">
                            Severity: Major
                            Found in aioseop_class.php - About 2 hrs to fix

                              Method universal_analytics has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function universal_analytics() {
                                      global $aioseop_options;
                                      $analytics = '';
                                      if ( !empty( $aioseop_options['aiosp_ga_use_universal_analytics'] ) ) {
                                          $allow_linker = $cookie_domain = $domain = $addl_domains = $domain_list = '';
                              Severity: Major
                              Found in aioseop_class.php - About 2 hrs to fix

                                Method aiosp_mrt_get_url has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function aiosp_mrt_get_url( $query, $show_page = true ) {
                                        if ( $query->is_404 || $query->is_search )
                                            return false;
                                        
                                        $link = '';
                                Severity: Major
                                Found in aioseop_class.php - About 2 hrs to fix

                                  Function add_page_hooks has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      function add_page_hooks() {
                                  //        $this->oauth_init();
                                          $post_objs = get_post_types( '', 'objects' );
                                          $pt = array_keys( $post_objs );
                                          $rempost = array( 'revision', 'nav_menu_item' );
                                  Severity: Minor
                                  Found in aioseop_class.php - About 2 hrs to fix

                                  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_original_title has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      function get_original_title( $sep = '|', $echo = false, $seplocation = '' ) {
                                          global $aioseop_options;
                                          if ( !empty( $aioseop_options['aiosp_use_original_title'] ) ) {
                                              $has_filter = has_filter( 'wp_title', Array( $this, 'wp_title' ) );
                                              if ( $has_filter !== false )
                                  Severity: Major
                                  Found in aioseop_class.php - About 2 hrs to fix

                                    Function check_rewrite_handler has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        function check_rewrite_handler() {
                                            global $aioseop_options;
                                    
                                            $force_rewrites = 1;
                                            if ( isset( $aioseop_options['aiosp_force_rewrites'] ) )
                                    Severity: Minor
                                    Found in aioseop_class.php - About 2 hrs to fix

                                    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 display_right_sidebar has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        function display_right_sidebar( ) { ?>
                                            
                                    <?php
                                    /* <label class="aioseop_generic_label"><?php _e('Click on option titles to get help!', 'all-in-one-seo-pack' ); ?></label> */
                                            global $wpdb;
                                    Severity: Major
                                    Found in aioseop_class.php - About 2 hrs to fix

                                      Method filter_settings has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          function filter_settings( $settings, $location, $current ) {
                                              if ( $location == null ) {
                                                  $prefix = $this->prefix;
                                                  
                                                  foreach ( Array( 'seopostcol', 'seocustptcol', 'debug_info', 'max_words_excerpt' ) as $opt )
                                      Severity: Major
                                      Found in aioseop_class.php - About 2 hrs to fix

                                        Method get_prev_next_links has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            function get_prev_next_links( $post = null ) {
                                                $prev = $next = '';
                                                $page = $this->get_page_number();
                                                if ( is_home() || is_archive() || is_paged() ) {
                                                    global $wp_query;
                                        Severity: Major
                                        Found in aioseop_class.php - About 2 hrs to fix

                                          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( ']]>', ']]&gt;', $text );
                                                          $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text );
                                                  $text = wp_strip_all_tags( $text );
                                                  if ( !$max ) $max = $this->maximum_description_length;
                                          Severity: Minor
                                          Found in aioseop_class.php - About 2 hrs to fix

                                          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
                                          Severity: Major
                                          Found in aioseop_class.php - About 2 hrs to fix

                                            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'] ) ) ) )
                                            Severity: Critical
                                            Found in aioseop_class.php - About 2 hrs to fix

                                              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"] ) )
                                              Severity: Minor
                                              Found in aioseop_class.php - About 1 hr to fix

                                              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 = '';
                                              Severity: Minor
                                              Found in aioseop_class.php - About 1 hr to fix

                                                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__ );
                                                            
                                                Severity: Minor
                                                Found in aioseop_class.php - About 1 hr to fix

                                                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%";
                                                Severity: Minor
                                                Found in aioseop_class.php - About 1 hr to fix

                                                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 = '';
                                                Severity: Minor
                                                Found in aioseop_class.php - About 1 hr to fix

                                                  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'];
                                                  Severity: Minor
                                                  Found in aioseop_class.php - About 1 hr to fix

                                                    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;
                                                    Severity: Minor
                                                    Found in aioseop_class.php - About 1 hr to fix

                                                      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"] ) ) {
                                                      Severity: Minor
                                                      Found in aioseop_class.php - About 1 hr to fix

                                                        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;
                                                        Severity: Minor
                                                        Found in aioseop_class.php - About 1 hr to fix

                                                          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;
                                                          Severity: Minor
                                                          Found in aioseop_class.php - About 1 hr to fix

                                                          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_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;
                                                          Severity: Minor
                                                          Found in aioseop_class.php - About 1 hr to fix

                                                          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

                                                          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'] ) );                
                                                          Severity: Critical
                                                          Found in aioseop_class.php - About 1 hr to fix

                                                            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();
                                                            Severity: Minor
                                                            Found in aioseop_class.php - About 1 hr to fix

                                                              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 '';            
                                                              Severity: Minor
                                                              Found in aioseop_class.php - About 1 hr to fix

                                                              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;
                                                                          }
                                                              Severity: Minor
                                                              Found in aioseop_class.php - About 1 hr to fix

                                                              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 title_placeholder_helper has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                              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();
                                                              Severity: Minor
                                                              Found in aioseop_class.php - About 1 hr to fix

                                                                Method check_rewrite_handler has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                Open

                                                                    function check_rewrite_handler() {
                                                                        global $aioseop_options;
                                                                
                                                                        $force_rewrites = 1;
                                                                        if ( isset( $aioseop_options['aiosp_force_rewrites'] ) )
                                                                Severity: Minor
                                                                Found in aioseop_class.php - About 1 hr to fix

                                                                  Function get_all_tags has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                                                  Open

                                                                      function get_all_tags( $id = 0 ) {
                                                                          $keywords = Array();
                                                                          $tags = get_the_tags( $id );
                                                                          if ( !empty( $tags ) && is_array( $tags) )
                                                                              foreach ( $tags as $tag )
                                                                  Severity: Minor
                                                                  Found in aioseop_class.php - About 1 hr to fix

                                                                  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

                                                                  Consider simplifying this complex logical expression.
                                                                  Open

                                                                          if ( !is_home() && !is_page() && !is_single() && !$this->is_static_front_page() && !$this->is_static_posts_page() && !is_archive() && !is_post_type_archive() )
                                                                              return null;
                                                                  Severity: Major
                                                                  Found in aioseop_class.php - About 1 hr to fix

                                                                    Function get_blog_page has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                                    Open

                                                                        function get_blog_page( $p = null ) {
                                                                            static $blog_page = '';
                                                                            static $page_for_posts = '';
                                                                            if ( $p === null ) {
                                                                                global $post;
                                                                    Severity: Minor
                                                                    Found in aioseop_class.php - About 55 mins to fix

                                                                    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_hooks has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                                    Open

                                                                        function add_hooks() {
                                                                            global $aioseop_options;
                                                                            aioseop_update_settings_check();
                                                                            add_filter( 'user_contactmethods', 'aioseop_add_contactmethods' );
                                                                            if ( is_user_logged_in() && function_exists( 'is_admin_bar_showing' ) && is_admin_bar_showing() && current_user_can( 'manage_options' ) )
                                                                    Severity: Minor
                                                                    Found in aioseop_class.php - About 55 mins to fix

                                                                    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

                                                                    Avoid deeply nested control flow statements.
                                                                    Open

                                                                                                if ( !empty( $d ) ) {
                                                                                                    if ( !empty( $domain_list ) )
                                                                                                        $domain_list .= ", ";
                                                                                                    $domain_list .= "'" . $d . "'";
                                                                                                }
                                                                    Severity: Major
                                                                    Found in aioseop_class.php - About 45 mins to fix

                                                                      Avoid deeply nested control flow statements.
                                                                      Open

                                                                                                  if ( !empty( $this->$v) )  $preload["{$this->prefix}{$v}"] = $this->$v;
                                                                      Severity: Major
                                                                      Found in aioseop_class.php - About 45 mins to fix

                                                                        Avoid deeply nested control flow statements.
                                                                        Open

                                                                                                    if ( count( $terms ) > 0 )
                                                                                                        $term = $terms[0];
                                                                        Severity: Major
                                                                        Found in aioseop_class.php - About 45 mins to fix

                                                                          Function __construct has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                                          Open

                                                                              function __construct() {
                                                                                  global $aioseop_options;
                                                                                  $this->log_file = dirname( __FILE__ ) . '/all_in_one_seo_pack.log';
                                                                              
                                                                                  if ( !empty( $aioseop_options ) && isset( $aioseop_options['aiosp_do_log'] ) && $aioseop_options['aiosp_do_log'] )
                                                                          Severity: Minor
                                                                          Found in aioseop_class.php - About 45 mins to fix

                                                                          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

                                                                          Avoid deeply nested control flow statements.
                                                                          Open

                                                                                                      if ( empty( $keywords_i ) )
                                                                                                          $keywords_i = stripslashes( $this->internationalize( get_post_meta( $id, "_aioseop_keywords", true ) ) );
                                                                          Severity: Major
                                                                          Found in aioseop_class.php - About 45 mins to fix

                                                                            Consider simplifying this complex logical expression.
                                                                            Open

                                                                                            if ( ( ( $title_type == 'archive' ) && is_post_type_archive( $wp_post_types ) && $prefix = "aiosp_{$title_type}_" ) ||
                                                                                                 ( ( $title_type == 'post' ) && $this->is_singular( $wp_post_types, $p ) && $prefix = "aiosp_" ) ) {
                                                                                                    $post_type = get_post_type( $p );
                                                                                                    if ( !empty( $aioseop_options["{$prefix}{$post_type}_title_format"] ) ) {
                                                                                                        $title_format = $aioseop_options["{$prefix}{$post_type}_title_format"];
                                                                            Severity: Major
                                                                            Found in aioseop_class.php - About 40 mins to fix

                                                                              Consider simplifying this complex logical expression.
                                                                              Open

                                                                                              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'] ) ) ) )
                                                                                                  $noindex = "no" . $noindex;
                                                                              Severity: Major
                                                                              Found in aioseop_class.php - About 40 mins to fix

                                                                                Consider simplifying this complex logical expression.
                                                                                Open

                                                                                        if ( !is_object( $post ) && is_admin() && !empty( $_GET ) && !empty( $_GET['post_type'] ) && !empty( $_GET['taxonomy'] ) && !empty( $_GET['tag_ID'] ) ) {
                                                                                            $term = get_term_by( 'id', $_GET['tag_ID'], $_GET['taxonomy'] );
                                                                                        }
                                                                                Severity: Major
                                                                                Found in aioseop_class.php - About 40 mins to fix

                                                                                  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;
                                                                                  Severity: Major
                                                                                  Found in aioseop_class.php - About 40 mins to fix

                                                                                    Method title_placeholder_helper has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                    Open

                                                                                        function title_placeholder_helper( $title, $post, $type = 'post', $title_format = '', $category = '' ) {
                                                                                    Severity: Minor
                                                                                    Found in aioseop_class.php - About 35 mins to fix

                                                                                      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
                                                                                      Severity: Minor
                                                                                      Found in aioseop_class.php - About 35 mins to fix

                                                                                      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();
                                                                                              ?>
                                                                                      Severity: Minor
                                                                                      Found in aioseop_class.php - About 35 mins to fix

                                                                                      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();
                                                                                              
                                                                                      Severity: Minor
                                                                                      Found in aioseop_class.php - About 35 mins to fix

                                                                                      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"] ) ) {
                                                                                      Severity: Minor
                                                                                      Found in aioseop_class.php - About 35 mins to fix

                                                                                      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

                                                                                      Avoid too many return statements within this method.
                                                                                      Open

                                                                                              return true;
                                                                                      Severity: Major
                                                                                      Found in aioseop_class.php - About 30 mins to fix

                                                                                        Avoid too many return statements within this method.
                                                                                        Open

                                                                                                    if ( $post === null ) return false;
                                                                                        Severity: Major
                                                                                        Found in aioseop_class.php - About 30 mins to fix

                                                                                          Avoid too many return statements within this method.
                                                                                          Open

                                                                                                      return $title;
                                                                                          Severity: Major
                                                                                          Found in aioseop_class.php - About 30 mins to fix

                                                                                            Avoid too many return statements within this method.
                                                                                            Open

                                                                                                        return $title;
                                                                                            Severity: Major
                                                                                            Found in aioseop_class.php - About 30 mins to fix

                                                                                              Avoid too many return statements within this method.
                                                                                              Open

                                                                                                          return $new_title;
                                                                                              Severity: Major
                                                                                              Found in aioseop_class.php - About 30 mins to fix

                                                                                                Avoid too many return statements within this method.
                                                                                                Open

                                                                                                        return false;
                                                                                                Severity: Major
                                                                                                Found in aioseop_class.php - About 30 mins to fix

                                                                                                  Avoid too many return statements within this method.
                                                                                                  Open

                                                                                                              return false;
                                                                                                  Severity: Major
                                                                                                  Found in aioseop_class.php - About 30 mins to fix

                                                                                                    Avoid too many return statements within this method.
                                                                                                    Open

                                                                                                                if ( is_post_type_archive() && !is_post_type_archive( $wp_post_types ) ) return false;
                                                                                                    Severity: Major
                                                                                                    Found in aioseop_class.php - About 30 mins to fix

                                                                                                      Avoid too many return statements within this method.
                                                                                                      Open

                                                                                                                      return $title;
                                                                                                      Severity: Major
                                                                                                      Found in aioseop_class.php - About 30 mins to fix

                                                                                                        Avoid too many return statements within this method.
                                                                                                        Open

                                                                                                                        return $title;
                                                                                                        Severity: Major
                                                                                                        Found in aioseop_class.php - About 30 mins to fix

                                                                                                          Avoid too many return statements within this method.
                                                                                                          Open

                                                                                                                          return $title;
                                                                                                          Severity: Major
                                                                                                          Found in aioseop_class.php - About 30 mins to fix

                                                                                                            Avoid too many return statements within this method.
                                                                                                            Open

                                                                                                                    if ( !empty( $this->meta_opts ) && $this->meta_opts['aiosp_disable'] == true ) return false;
                                                                                                            Severity: Major
                                                                                                            Found in aioseop_class.php - About 30 mins to fix

                                                                                                              Avoid too many return statements within this method.
                                                                                                              Open

                                                                                                                              return apply_filters( 'aioseop_home_page_title', $home_title );
                                                                                                              Severity: Major
                                                                                                              Found in aioseop_class.php - About 30 mins to fix

                                                                                                                Avoid too many return statements within this method.
                                                                                                                Open

                                                                                                                        if ( empty( $link ) || !is_string( $link ) ) return false;
                                                                                                                Severity: Major
                                                                                                                Found in aioseop_class.php - About 30 mins to fix

                                                                                                                  Avoid too many return statements within this method.
                                                                                                                  Open

                                                                                                                              return apply_filters( 'aioseop_title_single', $title );
                                                                                                                  Severity: Major
                                                                                                                  Found in aioseop_class.php - About 30 mins to fix

                                                                                                                    Avoid too many return statements within this method.
                                                                                                                    Open

                                                                                                                                return $title;
                                                                                                                    Severity: Major
                                                                                                                    Found in aioseop_class.php - About 30 mins to fix

                                                                                                                      Avoid too many return statements within this method.
                                                                                                                      Open

                                                                                                                              return $link;
                                                                                                                      Severity: Major
                                                                                                                      Found in aioseop_class.php - About 30 mins to fix

                                                                                                                        Avoid too many return statements within this method.
                                                                                                                        Open

                                                                                                                                    return $this->get_tax_title();
                                                                                                                        Severity: Major
                                                                                                                        Found in aioseop_class.php - About 30 mins to fix

                                                                                                                          Avoid too many return statements within this method.
                                                                                                                          Open

                                                                                                                                      } else return false;
                                                                                                                          Severity: Major
                                                                                                                          Found in aioseop_class.php - About 30 mins to fix

                                                                                                                            Function apply_tax_title_format has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                            Open

                                                                                                                                function apply_tax_title_format( $category_name, $category_description, $tax = '' ) {
                                                                                                                                    if ( empty( $tax ) ) $tax = get_query_var( 'taxonomy' );
                                                                                                                                    $title_format = $this->get_tax_title_format( $tax );
                                                                                                                                    $title = str_replace( '%taxonomy_title%', $category_name, $title_format );
                                                                                                                                    if ( strpos( $title, '%taxonomy_description%' ) !== false ) $title = str_replace( '%taxonomy_description%', $category_description, $title );
                                                                                                                            Severity: Minor
                                                                                                                            Found in aioseop_class.php - About 25 mins to fix

                                                                                                                            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_paged has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                            Open

                                                                                                                                function get_paged( $link ) {
                                                                                                                                    global $wp_rewrite;
                                                                                                                                    $page = $this->get_page_number();
                                                                                                                                    $page_name = 'page';
                                                                                                                                    if ( !empty( $wp_rewrite ) && !empty( $wp_rewrite->pagination_base ) ) $page_name = $wp_rewrite->pagination_base;
                                                                                                                            Severity: Minor
                                                                                                                            Found in aioseop_class.php - About 25 mins to fix

                                                                                                                            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

                                                                                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                            Open

                                                                                                                                        "home_page_title_format"        =>
                                                                                                                                            __( "This controls the format of the title tag for your Home Page.<br />The following macros are supported:", 'all-in-one-seo-pack' )
                                                                                                                                            . '<ul><li>' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '</li><li>' . 
                                                                                                                                            __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '</li><li>' . 
                                                                                                                                            __( '%page_title% - The original title of the page', 'all-in-one-seo-pack' ) . '</li><li>' . 
                                                                                                                            Severity: Major
                                                                                                                            Found in aioseop_class.php and 1 other location - About 3 hrs to fix
                                                                                                                            aioseop_class.php on lines 102..111

                                                                                                                            Duplicated Code

                                                                                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                            Tuning

                                                                                                                            This issue has a mass of 149.

                                                                                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                            Refactorings

                                                                                                                            Further Reading

                                                                                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                            Open

                                                                                                                                        "page_title_format"        =>
                                                                                                                                            __( "This controls the format of the title tag for Pages.<br />The following macros are supported:", 'all-in-one-seo-pack' )
                                                                                                                                            . '<ul><li>' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '</li><li>' . 
                                                                                                                                            __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '</li><li>' . 
                                                                                                                                            __( '%page_title% - The original title of the page', 'all-in-one-seo-pack' ) . '</li><li>' . 
                                                                                                                            Severity: Major
                                                                                                                            Found in aioseop_class.php and 1 other location - About 3 hrs to fix
                                                                                                                            aioseop_class.php on lines 92..101

                                                                                                                            Duplicated Code

                                                                                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                            Tuning

                                                                                                                            This issue has a mass of 149.

                                                                                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                            Refactorings

                                                                                                                            Further Reading

                                                                                                                            Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                                                            Open

                                                                                                                                            if ( !empty( $this->options['aiosp_cpostnoindex'] ) && ( in_array( $post_type, $this->options['aiosp_cpostnoindex'] ) ) ) {
                                                                                                                                                $settings["{$prefix}noindex"]['type'] = 'select';
                                                                                                                                                $settings["{$prefix}noindex"]['initial_options'] = Array( '' => __( 'Default - noindex', 'all-in-one-seo-pack' ), 'off' => __( 'index', 'all-in-one-seo-pack' ), 'on' => __( 'noindex', 'all-in-one-seo-pack' ) );
                                                                                                                                            }
                                                                                                                            Severity: Major
                                                                                                                            Found in aioseop_class.php and 3 other locations - About 1 hr to fix
                                                                                                                            aioseop_class.php on lines 1224..1227
                                                                                                                            aioseop_class.php on lines 1228..1231
                                                                                                                            aioseop_class.php on lines 1232..1235

                                                                                                                            Duplicated Code

                                                                                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                            Tuning

                                                                                                                            This issue has a mass of 117.

                                                                                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                            Refactorings

                                                                                                                            Further Reading

                                                                                                                            Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                                                            Open

                                                                                                                                            if ( !empty( $this->options['aiosp_cpostnoydir'] ) && ( in_array( $post_type, $this->options['aiosp_cpostnoydir'] ) ) ) {
                                                                                                                                                $settings["{$prefix}noydir"]['type'] = 'select';
                                                                                                                                                $settings["{$prefix}noydir"]['initial_options'] = Array( '' => __( 'Default - noydir', 'all-in-one-seo-pack' ), 'off' => __( 'ydir', 'all-in-one-seo-pack' ), 'on' => __( 'noydir', 'all-in-one-seo-pack' ) );
                                                                                                                                            }
                                                                                                                            Severity: Major
                                                                                                                            Found in aioseop_class.php and 3 other locations - About 1 hr to fix
                                                                                                                            aioseop_class.php on lines 1220..1223
                                                                                                                            aioseop_class.php on lines 1224..1227
                                                                                                                            aioseop_class.php on lines 1228..1231

                                                                                                                            Duplicated Code

                                                                                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                            Tuning

                                                                                                                            This issue has a mass of 117.

                                                                                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                            Refactorings

                                                                                                                            Further Reading

                                                                                                                            Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                                                            Open

                                                                                                                                            if ( !empty( $this->options['aiosp_cpostnofollow'] ) && ( in_array( $post_type, $this->options['aiosp_cpostnofollow'] ) ) ) {
                                                                                                                                                $settings["{$prefix}nofollow"]['type'] = 'select';
                                                                                                                                                $settings["{$prefix}nofollow"]['initial_options'] = Array( '' => __( 'Default - nofollow', 'all-in-one-seo-pack' ), 'off' => __( 'follow', 'all-in-one-seo-pack' ), 'on' => __( 'nofollow', 'all-in-one-seo-pack' ) );
                                                                                                                                            }
                                                                                                                            Severity: Major
                                                                                                                            Found in aioseop_class.php and 3 other locations - About 1 hr to fix
                                                                                                                            aioseop_class.php on lines 1220..1223
                                                                                                                            aioseop_class.php on lines 1228..1231
                                                                                                                            aioseop_class.php on lines 1232..1235

                                                                                                                            Duplicated Code

                                                                                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                            Tuning

                                                                                                                            This issue has a mass of 117.

                                                                                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                            Refactorings

                                                                                                                            Further Reading

                                                                                                                            Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                                                            Open

                                                                                                                                            if ( !empty( $this->options['aiosp_cpostnoodp'] ) && ( in_array( $post_type, $this->options['aiosp_cpostnoodp'] ) ) ) {
                                                                                                                                                $settings["{$prefix}noodp"]['type'] = 'select';
                                                                                                                                                $settings["{$prefix}noodp"]['initial_options'] = Array( '' => __( 'Default - noodp', 'all-in-one-seo-pack' ), 'off' => __( 'odp', 'all-in-one-seo-pack' ), 'on' => __( 'noodp', 'all-in-one-seo-pack' ) );
                                                                                                                                            }
                                                                                                                            Severity: Major
                                                                                                                            Found in aioseop_class.php and 3 other locations - About 1 hr to fix
                                                                                                                            aioseop_class.php on lines 1220..1223
                                                                                                                            aioseop_class.php on lines 1224..1227
                                                                                                                            aioseop_class.php on lines 1232..1235

                                                                                                                            Duplicated Code

                                                                                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                            Tuning

                                                                                                                            This issue has a mass of 117.

                                                                                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                            Refactorings

                                                                                                                            Further Reading

                                                                                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                            Open

                                                                                                                                        "404_title_format"    => __( "This controls the format of the title tag for the 404 page.<br />The following macros are supported:", 'all-in-one-seo-pack' ) .
                                                                                                                                            '<ul><li>' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '</li><li>' . 
                                                                                                                                            __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '</li><li>' . 
                                                                                                                                            __( '%request_url% - The original URL path, like "/url-that-does-not-exist/"', 'all-in-one-seo-pack' ) . '</li><li>' . 
                                                                                                                                            __( '%request_words% - The URL path in human readable form, like "Url That Does Not Exist"', 'all-in-one-seo-pack' ) . '</li><li>' . 
                                                                                                                            Severity: Major
                                                                                                                            Found in aioseop_class.php and 1 other location - About 1 hr to fix
                                                                                                                            aioseop_class.php on lines 158..163

                                                                                                                            Duplicated Code

                                                                                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                            Tuning

                                                                                                                            This issue has a mass of 109.

                                                                                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                            Refactorings

                                                                                                                            Further Reading

                                                                                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                            Open

                                                                                                                                        "description_format"    => __( "This controls the format of Meta Descriptions.The following macros are supported:", 'all-in-one-seo-pack' ) . 
                                                                                                                                            '<ul><li>' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '</li><li>' . 
                                                                                                                                            __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '</li><li>' . 
                                                                                                                                            __( '%description% - The original description as determined by the plugin, e.g. the excerpt if one is set or an auto-generated one if that option is set', 'all-in-one-seo-pack' ) . '</li><li>' . 
                                                                                                                                            __( '%post_title% - The original title of the post', 'all-in-one-seo-pack' ) . '</li><li>' . 
                                                                                                                            Severity: Major
                                                                                                                            Found in aioseop_class.php and 1 other location - About 1 hr to fix
                                                                                                                            aioseop_class.php on lines 164..169

                                                                                                                            Duplicated Code

                                                                                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                            Tuning

                                                                                                                            This issue has a mass of 109.

                                                                                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                            Refactorings

                                                                                                                            Further Reading

                                                                                                                            Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                            Open

                                                                                                                                function reset_options( $location = null, $delete = false ) {
                                                                                                                                    if ( $delete === true ) {
                                                                                                                                        $this->delete_class_option( $delete );
                                                                                                                                        $this->options = Array();
                                                                                                                                    }
                                                                                                                            Severity: Minor
                                                                                                                            Found in aioseop_class.php and 1 other location - About 55 mins to fix
                                                                                                                            aioseop_module_class.php on lines 1738..1748

                                                                                                                            Duplicated Code

                                                                                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                            Tuning

                                                                                                                            This issue has a mass of 98.

                                                                                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                            Refactorings

                                                                                                                            Further Reading

                                                                                                                            There are no issues that match your filters.

                                                                                                                            Category
                                                                                                                            Status