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

View on GitHub

Showing 427 of 427 total issues

Function get_all_post_priority_data has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        function get_all_post_priority_data( $include = 'any', $status = 'publish', $page = 0 ) {
            $posts = $page_query = Array();
            if ( $this->paginate )
                $page_query = Array( 'offset' => $page * $this->max_posts );
            if ( ( $status == 'publish' ) && ( $include == 'attachment' ) ) $status = 'inherit';
Severity: Minor
Found in aioseop_sitemap.php - About 35 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_archive_permalinks has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        function get_archive_permalinks( $posts ) {
            $links = Array();
            $archives = Array();
            if (is_array( $posts) )
                foreach ( $posts as $post ) {
Severity: Minor
Found in aioseop_sitemap.php - About 35 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_author_permalinks has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        function get_author_permalinks( $posts ) {
            $links = Array();
            $authors = Array();
            if (is_array( $posts) )
                foreach ( $posts as $post )
Severity: Minor
Found in aioseop_sitemap.php - About 35 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 set_post_args has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        function set_post_args( $args ) {
            if ( $this->option_isset( 'excl_categories' ) ) {
                $cats = Array();
                foreach( $this->options[ $this->prefix . 'excl_categories'] as $c ) $cats[] = -$c;
                $args['category'] = implode( ',', $cats );
Severity: Minor
Found in aioseop_sitemap.php - About 35 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 sitemap_warning has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        function sitemap_warning( $files ) {
            $msg = '';
            $conflict = false;
            $problem_files = $this->get_problem_files( $files, $msg );
            if ( !empty( $problem_files ) ) $conflict = true;
Severity: Minor
Found in aioseop_sitemap.php - About 35 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 blocked_message has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        function blocked_message( $msg ) {
            if ( empty( $this->options["{$this->prefix}blocked_log"] ) ) $this->options["{$this->prefix}blocked_log"] = '';
            $this->options["{$this->prefix}blocked_log"] = date( 'Y-m-d H:i:s' ) . " {$msg}\n" . $this->options["{$this->prefix}blocked_log"];
            if ( $this->strlen( $this->options["{$this->prefix}blocked_log"] ) > 4096 ) {
                $end = $this->strrpos( $this->options["{$this->prefix}blocked_log"], "\n" );
Severity: Minor
Found in aioseop_bad_robots.php - About 35 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 debug_message has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        function debug_message( $msg ) {
            if ( empty( $this->options["{$this->prefix}debug"] ) ) $this->options["{$this->prefix}debug"] = '';
            $this->options["{$this->prefix}debug"] = date( 'Y-m-d H:i:s' ) . " {$msg}\n" . $this->options["{$this->prefix}debug"];
            if ( $this->strlen( $this->options["{$this->prefix}debug"] ) > 2048 ) {
                $end = $this->strrpos( $this->options["{$this->prefix}debug"], "\n" );
Severity: Minor
Found in aioseop_sitemap.php - About 35 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 too many return statements within this method.
Open

        return true;
Severity: Major
Found in aioseop_class.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                    return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS)
                        ? 'null'
                        : new Services_JSON_Error(gettype($var)." can not be encoded as JSON string");
    Severity: Major
    Found in JSON.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  if ( $post === null ) return false;
      Severity: Major
      Found in aioseop_class.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return $title;
        Severity: Major
        Found in aioseop_class.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return $title;
          Severity: Major
          Found in aioseop_class.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return '{' . join(',', $properties) . '}';
            Severity: Major
            Found in JSON.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                                  return $utf8;
              Severity: Major
              Found in JSON.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                            return $obj;
                Severity: Major
                Found in JSON.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                      return '{' . join(',', $properties) . '}';
                  Severity: Major
                  Found in JSON.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                                return $property;
                    Severity: Major
                    Found in JSON.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                  return $new_title;
                      Severity: Major
                      Found in aioseop_class.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                return false;
                        Severity: Major
                        Found in aioseop_class.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                                      return $arr;
                          Severity: Major
                          Found in JSON.php - About 30 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language