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

View on GitHub

Showing 399 of 427 total issues

Function get_child_sitemap_urls has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

        function get_child_sitemap_urls() {
            $siteurls = Array();
            $blogs = $this->get_child_blogs();
            if ( !empty( $blogs ) ) {
                $option_name = $this->get_option_name();
Severity: Minor
Found in aioseop_sitemap.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_robots_meta has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
Open

    function get_robots_meta() {
        global $aioseop_options;
        $opts = $this->meta_opts;
        $page = $this->get_page_number();
        $robots_meta = $tax_noindex = '';
Severity: Minor
Found in aioseop_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 filter_options has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
Open

        function filter_options( $options ) {
            if ( !isset( $this->default_options['posttypes' ]['initial_options'] ) ) $this->add_post_types();
            if ( is_array( $options["{$this->prefix}posttypes"] ) && in_array( 'all', $options["{$this->prefix}posttypes"] ) && is_array( $this->default_options['posttypes' ]['initial_options'] ) )
                $options["{$this->prefix}posttypes"] = array_keys( $this->default_options['posttypes' ]['initial_options'] );
            if ( is_array( $options["{$this->prefix}taxonomies"] ) && in_array( 'all', $options["{$this->prefix}taxonomies"] ) && is_array( $this->default_options['taxonomies' ]['initial_options'] ) )
Severity: Minor
Found in aioseop_sitemap.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

Method get_aioseop_title has 178 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function get_aioseop_title( $post ) {
        global $aioseop_options;
        // the_search_query() is not suitable, it cannot just return
        global $s, $STagging;
        $opts = $this->meta_opts;
Severity: Major
Found in aioseop_class.php - About 7 hrs to fix

    Function aiosp_mrt_get_url has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
    Open

        function aiosp_mrt_get_url( $query, $show_page = true ) {
            if ( $query->is_404 || $query->is_search )
                return false;
            
            $link = '';
    Severity: Minor
    Found in aioseop_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 display_settings_page has a Cognitive Complexity of 46 (exceeds 5 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: 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

    Method decode has 171 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function decode($str)
        {
            $str = $this->reduce_string($str);
    
            switch (strtolower($str)) {
    Severity: Major
    Found in JSON.php - About 6 hrs to fix

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

              function __construct( ) {
                  if ( get_class( $this ) === 'All_in_One_SEO_Pack_Sitemap' ) { // Set this up only when instantiated as this class
                      $this->name = __( 'XML Sitemap', 'all-in-one-seo-pack' ); // Human-readable name of the plugin
                      $this->prefix = 'aiosp_sitemap_';                          // option prefix
                      $this->file = __FILE__;                                      // the current file
      Severity: Major
      Found in aioseop_sitemap.php - About 6 hrs to fix

        Function aioseop_ajax_scan_header has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
        Open

            function aioseop_ajax_scan_header() {
                $_POST["options"] = "foo";
                aioseop_ajax_init();
                $options = Array();
                parse_str( $_POST['options'], $options );
        Severity: Minor
        Found in aioseop_functions.php - About 6 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_utility.php has 444 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /**
         * @package All-in-One-SEO-Pack
         */
        $UTF8_TABLES = Array();
        Severity: Minor
        Found in aioseop_utility.php - About 6 hrs to fix

          Function filter_settings has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
          Open

                  function filter_settings( $settings, $location, $current ) {
                      if ( $location == 'opengraph' || $location == 'settings' ) {
                          $prefix = $this->get_prefix( $location ) . $location . '_';
                          if ( $location == 'opengraph' ) return $settings;
                          if ( $location == 'settings'  ) {
          Severity: Minor
          Found in aioseop_opengraph.php - About 6 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 aiosp_google_analytics has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
          Open

          function aiosp_google_analytics() {
              global $aioseop_options;
              $analytics = '';
              if ( !empty( $aioseop_options['aiosp_ga_advanced_options'] ) && !empty( $aioseop_options['aiosp_ga_exclude_users'] ) ) {
                  if ( is_user_logged_in() ) {
          Severity: Minor
          Found in aioseop_class.php - About 6 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 load_module has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
          Open

                  function load_module( $mod ) {
                      static $feature_options = null;
                      static $feature_prefix = null;
                      if ( !is_array( $this->modules ) ) return false;
                      $v = $this->modules[ $mod ];
          Severity: Minor
          Found in aioseop_module_manager.php - About 6 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_simple_sitemap has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
          Open

                  function get_simple_sitemap() {
                      $home = Array(
                                  'loc' => get_home_url(),
                                  'priority' => $this->get_default_priority( 'homepage' ),
                                  'changefreq' => $this->get_default_frequency( 'homepage' )
          Severity: Minor
          Found in aioseop_sitemap.php - About 6 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 ( ( is_category() && !empty( $aioseop_options['aiosp_category_noindex'] ) ) || ( !is_category() && is_archive() && !is_tag() && !is_tax()
                      && ( ( is_date() && !empty( $aioseop_options['aiosp_archive_date_noindex'] ) ) || ( is_author() && !empty( $aioseop_options['aiosp_archive_author_noindex'] ) ) ) ) 
                      || ( is_tag() && !empty( $aioseop_options['aiosp_tags_noindex'] ) ) 
                      || ( is_search() && !empty( $aioseop_options['aiosp_search_noindex'] ) )
                       || ( is_404() && !empty( $aioseop_options['aiosp_404_noindex'] ) )
          Severity: Critical
          Found in aioseop_class.php - About 6 hrs to fix

            Method default_bad_bots has 144 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    function default_bad_bots() {
                        $botlist = Array(
                            "Abonti",
                            "aggregator",
                            "AhrefsBot",
            Severity: Major
            Found in aioseop_module_class.php - About 5 hrs to fix

              Function parse_ini_helper has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
              Open

                      function parse_ini_helper( $array ) {
                          $returnArray = array();
                          if (is_array($array)) {
                              foreach ($array as $key => $value) {
                                  $e = explode(':', $key);
              Severity: Minor
              Found in aioseop_importer_exporter.php - About 5 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 settings_export has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
              Open

                      function settings_export( $buf ) {
                          global $aiosp; 
                          $post_types = null;
                          $has_data = null;
                          $general_settings = null;
              Severity: Minor
              Found in aioseop_module_class.php - About 5 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 domnode_to_array has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
              Open

                      function domnode_to_array( $node ) {
                        switch ( $node->nodeType ) {
                          case XML_CDATA_SECTION_NODE:
                          case XML_TEXT_NODE:
                            return trim( $node->textContent );
              Severity: Minor
              Found in aioseop_module_class.php - About 5 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_post_counts has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
              Open

                      function get_all_post_counts( $args ) {
                          $post_counts = null;
                          $status = 'inherit';
                          if ( !empty( $args['post_status'] ) ) $status = $args['post_status'];
                          if ( !empty( $args ) && !empty( $args['post_type'] ) )
              Severity: Minor
              Found in aioseop_sitemap.php - About 5 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