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

View on GitHub

Showing 427 of 427 total issues

Avoid deeply nested control flow statements.
Open

                                if( is_array( $module_options ) ) {
                                    foreach( $module_options as $key => $value ) {
                                        /* Update Post Data */
                                        if( $label == 'post_data' ) {
                                            $post_exists = post_exists( $module_options[$key]['post_title'], '', $module_options[$key]['post_date'] );
Severity: Major
Found in aioseop_importer_exporter.php - About 45 mins to fix

    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( $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 (reset($stk) == SERVICES_JSON_IN_ARR) {
                                      // we are in an array, so just push an element onto the stack
                                      array_push($arr, $this->decode($slice));
      
                                  } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
      Severity: Major
      Found in JSON.php - About 45 mins to fix

        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 ( !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

              Avoid deeply nested control flow statements.
              Open

                                          for ($i = $top['where']; $i <= $c; ++$i)
                                              $chrs = substr_replace($chrs, ' ', $i, 1);
              Severity: Major
              Found in JSON.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

                  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 ( preg_match( '/' . $hosts . '/i', $hostname ) )
                                                  return true;
                      Severity: Major
                      Found in aioseop_module_class.php - About 45 mins to fix

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

                                function update_options( $opts = Array(), $location = null, $defaults = null ) {
                                    if ($location === null )
                                        $type = 'settings';
                                    else
                                        $type = $this->locations[$location][$type];
                        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 ( isset( $options['meta_key'] ) ) {
                                                    $meta_key = $options['meta_key'];
                                                }
                        Severity: Major
                        Found in aioseop_module_class.php - About 45 mins to fix

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

                                    function get_class_option( ) {
                                        $option_name = $this->get_option_name();
                                        if ( $this->store_option || $option_name == $this->parent_option ) {
                                            return get_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 ( 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 ( !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

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