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

View on GitHub

Showing 399 of 427 total issues

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

        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

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

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

                    function display_custom_options( $buf, $args ) {
                        if ( $args['name'] == "{$this->prefix}addl_pages" ) {
                            $buf .= "<div id='{$this->prefix}addl_pages'>";
                            if ( !empty( $args['value'] ) ) {
                                $buf .= "<table class='aioseop_table' cellpadding=0 cellspacing=0>\n";
            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_all_images has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

                    function get_all_images( $options = null, $p = null ) {
                        static $img = Array();
                        if ( !is_array( $options ) ) $options = Array();
                        if ( !empty( $this->options['aiosp_opengraph_meta_key'] ) )
                            $options['meta_key'] = $this->options['aiosp_opengraph_meta_key'];
            Severity: Minor
            Found in aioseop_opengraph.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

            File aioseop_importer_exporter.php has 274 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
             * @package All-in-One-SEO-Pack 
             */
            /**
            Severity: Minor
            Found in aioseop_importer_exporter.php - About 2 hrs to fix

              Method display_options has 62 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      function display_options( $location = null, $meta_args = null ) {
                              static $location_settings = Array();
                              $defaults = null;
                              $prefix = $this->get_prefix( $location );
                              $help_link = '';
              Severity: Major
              Found in aioseop_module_class.php - About 2 hrs to fix

                Method display_right_sidebar has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function display_right_sidebar( ) { ?>
                        
                <?php
                /* <label class="aioseop_generic_label"><?php _e('Click on option titles to get help!', 'all-in-one-seo-pack' ); ?></label> */
                        global $wpdb;
                Severity: Major
                Found in aioseop_class.php - About 2 hrs to fix

                  Method __construct has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          function __construct( ) {
                              $this->name = __('Robots.txt', 'all-in-one-seo-pack');    // Human-readable name of the plugin
                              $this->prefix = 'aiosp_robots_';                        // option prefix
                              $this->file = __FILE__;                                    // the current file
                              parent::__construct();
                  Severity: Major
                  Found in aioseop_robots.php - About 2 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language