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

View on GitHub

Showing 427 of 427 total issues

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

    function aioseop_handle_ignore_notice() {
        if ( !empty( $_GET ) ) {
            global $current_user;
            $user_id = $current_user->ID;
            if ( !empty( $_GET["aioseop_reset_notices"] ) ) {
Severity: Minor
Found in aioseop_functions.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 ( $m[$tags['name']] == $tv )
                                    $meta .= "<tr><th style='color:red;'>" . sprintf( __( 'Duplicate %s Meta'), ucwords( $type ) ) . "</th><td>" . ucwords( $tk ) . "</td><td>{$m[$tags['name']]}</td><td>{$m[$tags['value']]}</td></tr>\n";
Severity: Major
Found in aioseop_functions.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if ( empty( $excluded[$k] ) ) unset( $excluded[$k] );
    Severity: Major
    Found in aioseop_functions.php - About 45 mins to fix

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

              function delete_class_option( $delete = false ) {
                  $option_name = $this->get_option_name();
                  if ( $this->store_option || $delete ) {
                      delete_option( $option_name );
                  } else {
      Severity: Minor
      Found in aioseop_module_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 ( $post->ID == get_option( 'page_for_posts' ) )
                                  $wp_query->is_home = true;
      Severity: Major
      Found in aioseop_module_class.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                    if ( empty( $link_list[$l['order']] ) ) $link_list[$l['order']] = Array();
        Severity: Major
        Found in aioseop_functions.php - About 45 mins to fix

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

                public static function split_header($header, $only_allow_oauth_parameters = true) {
                  $params = array();
                  if (preg_match_all('/('.($only_allow_oauth_parameters ? 'oauth_' : '').'[a-z_-]*)=(:?"([^"]*)"|([^,]*))/', $header, $matches)) {
                    foreach ($matches[1] as $i => $h) {
                      $params[$h] = OAuthUtil::urldecode_rfc3986(empty($matches[3][$i]) ? $matches[4][$i] : $matches[3][$i]);
          Severity: Minor
          Found in OAuth.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(!isset($output[$t]))
                              $output[$t] = array();
          Severity: Major
          Found in aioseop_module_class.php - About 45 mins to fix

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

                    function do_write_sitemap( $sitemap_type, $page = 0, $filename = '', $comment = '' ) {
                        if ( empty( $filename ) ) {
                            if ( $sitemap_type == 'root' ) {
                                $filename = $this->options["{$this->prefix}filename"];                    
                            } else {
            Severity: Minor
            Found in aioseop_sitemap.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 ( !$siteurl ) $siteurl = get_home_url( $blog_id );
            Severity: Major
            Found in aioseop_sitemap.php - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                          if ( !empty( $legacy[$thumbnail] ) )
                                              $thumbnail = $legacy[$thumbnail];
              Severity: Major
              Found in aioseop_opengraph.php - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if ( !empty( $keywords ) && !empty( $tag ) ) {
                                            $tag .= ',' . $keywords;
                                        } elseif ( empty( $tag ) ) {
                                            $tag = $keywords;
                                        }
                Severity: Major
                Found in aioseop_opengraph.php - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                              if ( $sitemap_options["{$this->prefix}gzipped"] ) $url .= '.gz';
                  Severity: Major
                  Found in aioseop_sitemap.php - About 45 mins to fix

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

                            function All_in_One_SEO_Pack_File_Editor( ) {
                                $this->name = __('File Editor', 'all-in-one-seo-pack');        // Human-readable name of the plugin
                                $this->prefix = 'aiosp_file_editor_';                        // option prefix
                                $this->file = __FILE__;                                        // the current file
                                parent::__construct();
                    Severity: Minor
                    Found in aioseop_file_editor.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 ( defined( 'SUNRISE' ) && SUNRISE && is_object( $wpdb ) && isset( $wpdb->dmtable ) && !empty( $wpdb->dmtable ) ) {
                                                    $domain = $wpdb->get_var( "SELECT domain FROM {$wpdb->dmtable} WHERE blog_id = '$blog_id' AND active = 1 LIMIT 1" );
                                                    if ( $domain ) {
                                                        if ( false == isset( $_SERVER[ 'HTTPS' ] ) )
                                                            $_SERVER[ 'HTTPS' ] = 'Off';
                    Severity: Major
                    Found in aioseop_sitemap.php - About 45 mins to fix

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

                              function cache_options() {
                                  static $start = true;
                                  if ( $start ) {
                                      $this->cache_struct = get_option( 'permalink_structure' );
                                      if ( !empty( $this->cache_struct ) ) add_filter( 'pre_option_permalink_structure', Array( $this, 'cache_structure' ) );
                      Severity: Minor
                      Found in aioseop_sitemap.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

                      Method get_default_values has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              function get_default_values( $defaults, $prefix, &$cache, $item, $nodefaults = false, $type = '' ) {
                      Severity: Minor
                      Found in aioseop_sitemap.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
                              Severity
                              Category
                              Status
                              Source
                              Language