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

View on GitHub

Showing 427 of 427 total issues

Function get_all_term_counts has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

        function get_all_term_counts( $args ) {
            $term_counts = null;
            if ( !empty( $args ) && !empty( $args['taxonomy'] ) )
                if ( !is_array( $args['taxonomy'] ) || ( count( $args['taxonomy'] ) == 1 ) ) {
                    if ( is_array( $args['taxonomy'] ) )
Severity: Minor
Found in aioseop_sitemap.php - About 3 hrs 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

Consider simplifying this complex logical expression.
Open

                        if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == SERVICES_JSON_SLICE))) {
                            // found a comma that is not inside a string, array, etc.,
                            // OR we've reached the end of the character list
                            $slice = substr($chrs, $top['where'], ($c - $top['where']));
                            array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => ($c + 1), 'delim' => false));
Severity: Critical
Found in JSON.php - About 3 hrs to fix

    Method add_page_hooks has 74 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function add_page_hooks() {
    //        $this->oauth_init();
            $post_objs = get_post_types( '', 'objects' );
            $pt = array_keys( $post_objs );
            $rempost = array( 'revision', 'nav_menu_item' );
    Severity: Major
    Found in aioseop_class.php - About 2 hrs to fix

      Method display_extra_metaboxes has 73 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function display_extra_metaboxes( $add, $meta ) {
              echo "<div class='aioseop_metabox_wrapper' >";
              switch ( $meta['id'] ) {
                  case "aioseop-about":
                      ?><div class="aioseop_metabox_text">
      Severity: Major
      Found in aioseop_class.php - About 2 hrs to fix

        Function __construct has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

                function __construct( $mod ) {
                    $this->modules['feature_manager'] = null;
                    foreach ( $mod as $m ) $this->modules[$m] = null;
                    $reset = false;
                    $reset_all = ( isset( $_POST['Submit_All_Default'] ) && $_POST['Submit_All_Default']!='' );
        Severity: Minor
        Found in aioseop_module_manager.php - About 2 hrs 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 opt_robot_rule has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

                function opt_robot_rule($dis) {
                    if ( is_array($dis) ) { // unique rules only
                        $dis = array_unique( $dis, SORT_STRING );
                        $pd = null;
                        foreach( $dis as $k => $d ) { 
        Severity: Minor
        Found in aioseop_robots.php - About 2 hrs 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 __construct has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

                function __construct( ) {
                    $this->name = __('Bad Bot Blocker', 'all-in-one-seo-pack');    // Human-readable name of the plugin
                    $this->prefix = 'aiosp_bad_robots_';                        // option prefix
                    $this->file = __FILE__;                                    // the current file
                    parent::__construct();
        Severity: Minor
        Found in aioseop_bad_robots.php - About 2 hrs 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

        Method universal_analytics has 72 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function universal_analytics() {
                global $aioseop_options;
                $analytics = '';
                if ( !empty( $aioseop_options['aiosp_ga_use_universal_analytics'] ) ) {
                    $allow_linker = $cookie_domain = $domain = $addl_domains = $domain_list = '';
        Severity: Major
        Found in aioseop_class.php - About 2 hrs to fix

          Method aioseop_ajax_scan_header has 71 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function aioseop_ajax_scan_header() {
                  $_POST["options"] = "foo";
                  aioseop_ajax_init();
                  $options = Array();
                  parse_str( $_POST['options'], $options );
          Severity: Major
          Found in aioseop_functions.php - About 2 hrs to fix

            Method aiosp_mrt_get_url has 69 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function aiosp_mrt_get_url( $query, $show_page = true ) {
                    if ( $query->is_404 || $query->is_search )
                        return false;
                    
                    $link = '';
            Severity: Major
            Found in aioseop_class.php - About 2 hrs to fix

              Function add_page_hooks has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

                  function add_page_hooks() {
              //        $this->oauth_init();
                      $post_objs = get_post_types( '', 'objects' );
                      $pt = array_keys( $post_objs );
                      $rempost = array( 'revision', 'nav_menu_item' );
              Severity: Minor
              Found in aioseop_class.php - About 2 hrs 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_display_options has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

                      function filter_display_options( $options ) {
                          if ( is_multisite() ) $options[ $this->prefix . 'rewrite'] = 'On';
                          if ( isset( $options[ $this->prefix . 'max_posts'] ) && ( ( $options[ $this->prefix . 'max_posts'] <= 0 ) || ( $options[ $this->prefix . 'max_posts'] >= 50000 ) ) )
                              $options[ $this->prefix . 'max_posts'] = 50000;
                          $url = trailingslashit( get_home_url() ) . $options[ $this->prefix . 'filename' ] . '.xml';
              Severity: Minor
              Found in aioseop_sitemap.php - About 2 hrs 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_prio_from_posts has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

                      function get_author_prio_from_posts( $posts ) {
                          $authors = Array();
                          if ( is_array( $posts ) )
                              foreach( $posts as $p ) {
                                  if ( $p->post_type != 'post' ) continue;
              Severity: Minor
              Found in aioseop_sitemap.php - About 2 hrs 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

              Method get_original_title has 67 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function get_original_title( $sep = '|', $echo = false, $seplocation = '' ) {
                      global $aioseop_options;
                      if ( !empty( $aioseop_options['aiosp_use_original_title'] ) ) {
                          $has_filter = has_filter( 'wp_title', Array( $this, 'wp_title' ) );
                          if ( $has_filter !== false )
              Severity: Major
              Found in aioseop_class.php - About 2 hrs to fix

                Method display_settings_page has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        function display_settings_page( $location = null ) {
                                if ( $location != null ) $location_info = $this->locations[$location];
                                $name = null;
                                if ( ( $location ) && ( isset( $location_info['name'] ) ) ) $name = $location_info['name'];
                                if ( !$name ) $name = $this->name;
                Severity: Major
                Found in aioseop_module_class.php - About 2 hrs to fix

                  Function check_rewrite_handler has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                      function check_rewrite_handler() {
                          global $aioseop_options;
                  
                          $force_rewrites = 1;
                          if ( isset( $aioseop_options['aiosp_force_rewrites'] ) )
                  Severity: Minor
                  Found in aioseop_class.php - About 2 hrs 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_addmycolumns has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                      function aioseop_addmycolumns() {
                          global $aioseop_options, $pagenow;
                          $aiosp_posttypecolumns = Array();
                          if ( !empty( $aioseop_options) && !empty( $aioseop_options['aiosp_posttypecolumns'] ) ) {
                              $aiosp_posttypecolumns = $aioseop_options['aiosp_posttypecolumns'];            
                  Severity: Minor
                  Found in aioseop_functions.php - About 2 hrs 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_headers has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                        public static function get_headers() {
                          if (function_exists('apache_request_headers')) {
                            // we need this to get the actual Authorization: header
                            // because apache tends to tell us it doesn't exist
                            $headers = apache_request_headers();
                  Severity: Minor
                  Found in OAuth.php - About 2 hrs 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_good_bot has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                          function is_good_bot() {
                              $botlist = Array(
                                  "Yahoo! Slurp" => "crawl.yahoo.net",
                                  "googlebot" => ".googlebot.com",
                                  "msnbot" => "search.msn.com"
                  Severity: Minor
                  Found in aioseop_module_class.php - About 2 hrs 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 has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                          function get_the_image( $options = null, $p = null ) {
                              
                              if ( $p === null ) {
                                  global $post;
                              } else {
                  Severity: Minor
                  Found in aioseop_module_class.php - About 2 hrs 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