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

View on GitHub

Showing 399 of 427 total issues

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

        function get_loaded_module_list() {
            $module_list = Array();
            if ( !empty( $this->modules ) ) {
                foreach( $this->modules as $k => $v )
                    if ( !empty( $v ) )
Severity: Minor
Found in aioseop_module_manager.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

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

    function aioseop_ajax_save_meta() {
        if ( !empty( $_POST['_inline_edit'] ) && ( $_POST['_inline_edit'] != 'undefined' ) )
            check_ajax_referer( 'inlineeditnonce', '_inline_edit' );
        $post_id = intval( $_POST['post_id'] );
        $new_meta = strip_tags( $_POST['new_meta'] );
Severity: Minor
Found in aioseop_functions.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 aioseop_filter_callback has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    function aioseop_filter_callback( $matches ) {
        if ( $matches[1] && !empty( $matches[1] ) ) $postID = $matches[1];
        if ( empty( $postID ) ) $postID = get_option( "page_on_front" );
        $title_attrib = stripslashes( get_post_meta($postID, '_aioseop_titleatr', true ) );
        if ( empty( $title_attrib ) && !empty( $matches[4] ) ) $title_attrib = $matches[4];
Severity: Minor
Found in aioseop_functions.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 filter_settings has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        function filter_settings( $settings, $location ) {
            if ( $location == 'generator' ) {
                $prefix = $this->get_prefix( $location ) . $location . '_';
                if ( isset( $_POST['Submit_Optimize'] ) ) {
                    if ( isset( $settings[ $prefix . 'robotgen' ] ) ) {
Severity: Minor
Found in aioseop_robots.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 do_robots has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        function do_robots( $options, $location ) {
            if ( $location ) $prefix = $this->get_prefix( $location ) . $location . '_';
            if ( $location === 'generator' ) {
                if ( isset( $_POST['Submit_Update'] ) || isset( $_POST['Submit_Opt_Update'] ) ) {
                    $this->save_files( Array( 'robotgen' => 'robots.txt' ), $prefix );
Severity: Minor
Found in aioseop_robots.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_admin_bar_submenu has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        function add_admin_bar_submenu() {
            global $aioseop_admin_menu, $wp_admin_bar;
            
            if ( $aioseop_admin_menu ) {
                $links = $this->get_admin_links();
Severity: Minor
Found in aioseop_module_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 update_class_option has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        function update_class_option( $option_data, $option_name = false ) {
            if ( $option_name == false )
                $option_name = $this->get_option_name();
            if ( $this->store_option || $option_name == $this->parent_option ) {
                return update_option( $option_name, $option_data );
Severity: Minor
Found in aioseop_module_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 csv_to_array has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        function csv_to_array( $csv ) {
            $args = Array();
            if ( !function_exists( 'str_getcsv' ) )
                $v = $this->str_getcsv( $csv );
            else
Severity: Minor
Found in aioseop_module_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 filter_pointers has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        function filter_pointers() {
            if ( !empty( $this->pointers ) ) {
                $dismissed = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
                foreach( $dismissed as $d )
                    if ( isset( $this->pointers[$d] ) )
Severity: Minor
Found in aioseop_module_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 get_the_image_by_author has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        function get_the_image_by_author( $options = null, $p = null ) {
            if ( $p === null ) {
                global $post;
            } else {
                $post = $p;
Severity: Minor
Found in aioseop_opengraph.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 get_rewrite_url has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        function get_rewrite_url( $url ) {
            global $wp_rewrite;
            $url = parse_url( esc_url( $url ), PHP_URL_PATH );
            $url = ltrim( $url, '/' );
            if ( !empty( $wp_rewrite ) ) {
Severity: Minor
Found in aioseop_sitemap.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( 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
                Severity
                Category
                Status
                Source
                Language