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

View on GitHub

Showing 399 of 427 total issues

All_in_One_SEO_Pack_Sitemap has 81 functions (exceeds 20 allowed). Consider refactoring.
Open

    class All_in_One_SEO_Pack_Sitemap extends All_in_One_SEO_Pack_Module {
        var $cache_struct = null;
        var $cache_home = null;
        var $comment_string;
        var $start_memory_usage = 0;
Severity: Major
Found in aioseop_sitemap.php - About 1 day to fix

    Function add_menu has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring.
    Open

            function add_menu( $parent_slug ) {
                if ( !empty( $this->menu_name ) )
                    $name = $this->menu_name;
                else
                    $name = $this->name;
    Severity: Minor
    Found in aioseop_module_class.php - About 1 day 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_prio_from_posts has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
    Open

            function get_prio_from_posts( $posts, $prio_override = false, $freq_override = false, $linkfunc = 'get_permalink' ) {
                $prio = Array();
                $args = Array( 'prio_override' => $prio_override, 'freq_override' => $freq_override, 'linkfunc' => $linkfunc );
                if ( ( $prio_override ) && ( $freq_override ) )
                    $stats = 0;
    Severity: Minor
    Found in aioseop_sitemap.php - About 1 day 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_options has a Cognitive Complexity of 72 (exceeds 5 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: Minor
    Found in aioseop_module_class.php - About 1 day 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_sitemap_index_filenames has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring.
    Open

            function get_sitemap_index_filenames() {
                $files = Array();
                $options = $this->options;
                $prefix = $options["{$this->prefix}filename"];
                $suffix = '.xml';
    Severity: Minor
    Found in aioseop_sitemap.php - About 1 day 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 All_in_One_SEO_Pack_Opengraph has 284 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function All_in_One_SEO_Pack_Opengraph( ) {
                $this->name = __('Social Meta', 'all-in-one-seo-pack');    // Human-readable name of the plugin
                $this->prefix = 'aiosp_opengraph_';                        // option prefix
                $this->file = __FILE__;                                    // the current file
                $this->fb_object_types = Array(
    Severity: Major
    Found in aioseop_opengraph.php - About 1 day to fix

      Method add_meta has 265 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function add_meta( ) {
                  global $post, $aiosp, $aioseop_options, $wp_query;
                  $metabox = $this->get_current_options( Array(), 'settings' );
                  $key = $this->options['aiosp_opengraph_key'];
                  $dimg = $this->options['aiosp_opengraph_dimg'];
      Severity: Major
      Found in aioseop_opengraph.php - About 1 day to fix

        Function get_page_snippet_info has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
        Open

            function get_page_snippet_info() {
                static $info = Array();
                if ( !empty( $info ) )
                    return $info;
                global $post, $aioseop_options, $wp_query;
        Severity: Minor
        Found in aioseop_class.php - About 1 day 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 wp_head has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
        Open

            function wp_head() {
                    if ( !$this->is_page_included() ) return;
                    $opts = $this->meta_opts;
                    global $wp_query, $aioseop_options, $posts;
                    static $aioseop_dup_counter = 0;
        Severity: Minor
        Found in aioseop_class.php - About 1 day 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 universal_analytics has a Cognitive Complexity of 65 (exceeds 5 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: Minor
        Found in aioseop_class.php - About 1 day 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_keywords has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
        Open

            function get_all_keywords() {
                global $posts;
                global $aioseop_options;
                if ( is_404() ) return null;
                // if we are on synthetic pages
        Severity: Minor
        Found in aioseop_class.php - About 1 day 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_get_menu_links has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
        Open

            function aioseop_ajax_get_menu_links() {
                aioseop_ajax_init();
                $options = Array();
                parse_str( $_POST['options'], $options );
                $_POST = $options;
        Severity: Minor
        Found in aioseop_functions.php - About 1 day 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_indexed_sitemaps has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
        Open

                function do_indexed_sitemaps() {
                    $this->start_memory_usage = memory_get_peak_usage();
                    $options = $this->options;
                    
                    $this->do_write_sitemap( 'root' );
        Severity: Minor
        Found in aioseop_sitemap.php - About 1 day 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_prev_next_links has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
        Open

            function get_prev_next_links( $post = null ) {
                $prev = $next = '';
                $page = $this->get_page_number();
                if ( is_home() || is_archive() || is_paged() ) {
                    global $wp_query;
        Severity: Minor
        Found in aioseop_class.php - About 1 day 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_sitemap_scan has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
        Open

                function do_sitemap_scan() {
                    $msg = '';
                    if ( !empty(  $this->options["{$this->prefix}rewrite"] ) && ( get_option('permalink_structure') == '' ) ) { 
                        $msg = '<p>' . __( 'Warning: dynamic sitemap generation must have permalinks enabled.', 'all-in-one-seo-pack' ) . '</p>';
                    }
        Severity: Minor
        Found in aioseop_sitemap.php - About 1 day 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 OAuth.php has 542 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /* OAuth PHP Library
         * http://oauth.googlecode.com/svn/code/php/
         *
         * License: The MIT License
        Severity: Major
        Found in OAuth.php - About 1 day to fix

          Function get_problem_files has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
          Open

                  function get_problem_files( $files, &$msg ) {
                      $problem_files = Array();
                      $use_wpfs = true;
                      $wpfs = $this->get_filesystem_object();
                      if ( !is_object( $wpfs ) ) {
          Severity: Minor
          Found in aioseop_sitemap.php - About 1 day 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_mrt_exclude_this_page has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
          Open

              function aioseop_mrt_exclude_this_page( $url = null ) {
                  static $excluded = false;
                  if ( $excluded === false ) {
                      global $aioseop_options;
                      $ex_pages = '';
          Severity: Minor
          Found in aioseop_functions.php - About 7 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 do_multi_input has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
          Open

                  function do_multi_input( $args ) {
                      extract( $args );
                      $buf1 = '';
                      $type = $options['type'];
                      if ( ( $type == 'radio' ) || ( $type == 'checkbox' ) ) {
          Severity: Minor
          Found in aioseop_module_class.php - About 7 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_ini_file has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
          Open

                  function get_ini_file( $assoc_arr, $has_sections=TRUE ) { 
                      $content = ""; 
                      if ($has_sections) { 
                          foreach ($assoc_arr as $key=>$elem) { 
                              $content .= "[".$key."]\n"; 
          Severity: Minor
          Found in aioseop_importer_exporter.php - About 7 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