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

View on GitHub

Showing 427 of 427 total issues

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

    function aioseop_output_dismissable_notice( $message, $id = "", $class = "updated fade") {
        global $current_user;
        if ( !empty( $current_user ) ) {
            $user_id = $current_user->ID;
            $msgid = md5( $message );
Severity: Minor
Found in aioseop_functions.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 aioseop_load_json_services has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function aioseop_load_json_services() {
        static $services_json = null;
        if ( $services_json ) return $services_json;
        if ( !class_exists( 'Services_JSON' ) ) require_once( 'JSON.php' );
        if ( !$services_json ) $services_json = new Services_JSON();
Severity: Minor
Found in aioseop_functions.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_the_image_by_scan has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        function get_the_image_by_scan( $p = null ) {

            if ( $p === null ) {
                global $post;
            } else {
Severity: Minor
Found in aioseop_module_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 is_bad_referer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        function is_bad_referer() {
            $referlist = $this->default_bad_referers();
            $referlist = apply_filters( $this->prefix . "badreferlist", $referlist );

            if ( !empty( $referlist ) && !empty( $_SERVER ) && !empty( $_SERVER['HTTP_REFERER'] ) ) {
Severity: Minor
Found in aioseop_module_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 aioseop_list_pages has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function aioseop_list_pages( $content ) {
        global $wp_version;
        $matches = array();
        if ( preg_match_all( '/<li class="page_item page-item-(\d+)/i', $content, $matches ) ) {
            update_postmeta_cache( array_values( $matches[1] ) );
Severity: Minor
Found in aioseop_functions.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 add_post_types has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        function add_post_types() {
            $post_type_titles = $this->get_post_type_titles( Array( 'public' => true ) );
            $taxonomy_titles = $this->get_taxonomy_titles(  Array( 'public' => true ) );
            if ( isset( $post_type_titles['attachment'] ) ) $post_type_titles['attachment'] = __( "Media / Attachments", 'all-in-one-seo-pack' );
            $this->default_options['posttypes' ]['initial_options'] = array_merge( Array( 'all' => __( 'All Post Types', 'all-in-one-seo-pack' ) ), $post_type_titles );
Severity: Minor
Found in aioseop_sitemap.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 flush_rules_hook has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        function flush_rules_hook() {
            global $wp_rewrite;
            $sitemap_rules = $this->get_rewrite_rules( $wp_rewrite );
            if ( !empty( $sitemap_rules ) ) {
                $rules = get_option( 'rewrite_rules' );
Severity: Minor
Found in aioseop_sitemap.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

Severity
Category
Status
Source
Language