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

View on GitHub

Showing 427 of 427 total issues

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

    function aioseop_init_class() {
        global $aiosp;
        require_once( AIOSEOP_PLUGIN_DIR . 'aioseop_functions.php' );
        require_once( AIOSEOP_PLUGIN_DIR . 'aioseop_class.php' );
        $aiosp = new All_in_One_SEO_Pack();
Severity: Minor
Found in all_in_one_seo_pack.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( $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 (($delim == '"' && $substr_chrs_c_2 != '\\\'') ||
                                         ($delim == "'" && $substr_chrs_c_2 != '\\"')) {
                                          $utf8 .= $chrs{++$c};
                                      }
      Severity: Major
      Found in JSON.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if ( preg_match( '/' . $hosts . '/i', $hostname ) )
                                    return true;
        Severity: Major
        Found in aioseop_module_class.php - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if ( !empty( $post_thumbnail_id ) )    {
                                      $image = wp_get_attachment_image_src( $post_thumbnail_id, $size );
                                      if ( is_array( $image ) ) {
                                          $img[] = Array( 'type' => 'featured', 'id' => $post_thumbnail_id, 'link' => $image[0] );
                                      }
          Severity: Major
          Found in aioseop_module_class.php - About 45 mins to fix

            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 ( $optimize ) $options[$prefix . 'robotgen'] = $robotgen;
            Severity: Major
            Found in aioseop_robots.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 ( empty( $options[$prefix . 'robotgen'] ) ) 
                                              $options = $this->load_files( $options, Array( 'robotgen' => 'robots.txt' ), $prefix );                            
              Severity: Major
              Found in aioseop_robots.php - About 45 mins to fix

                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

                  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 ( is_array( $image ) ) {
                                                  $img[] = Array( 'type' => 'attachment', 'id' => $id, 'link' => $image[0] );
                                              }
                  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

                      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

                        Avoid deeply nested control flow statements.
                        Open

                                          if ( is_array($output) )
                                              $output[$t][] = $v;
                        Severity: Major
                        Found in aioseop_module_class.php - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if ( !empty( $image ) ) {
                                                      $img[] = Array( 'type' => 'meta_key', 'id' => $meta_key, 'link' => $image );
                                                  }
                          Severity: Major
                          Found in aioseop_module_class.php - About 45 mins to fix

                            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

                              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
                                Severity
                                Category
                                Status
                                Source
                                Language