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

View on GitHub

Showing 399 of 427 total issues

Function build_http_query has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

      public static function build_http_query($params) {
        if (!$params) return '';

        // Urlencode both keys and values
        $keys = OAuthUtil::urlencode_rfc3986(array_keys($params));
Severity: Minor
Found in OAuth.php - About 1 hr 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_main_keywords has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    function get_main_keywords() {
        global $aioseop_options;
        global $aioseop_keywords;
        global $post;
        $opts = $this->meta_opts;
Severity: Minor
Found in aioseop_class.php - About 1 hr 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_init has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    function aioseop_ajax_init() {
        if ( !empty( $_POST ) && !empty( $_POST['settings'] ) && (!empty( $_POST['nonce-aioseop'])||(!empty( $_POST['nonce-aioseop-edit']))) && !empty( $_POST['options'] ) ) {
            $_POST = stripslashes_deep( $_POST );
            $settings = esc_attr( $_POST['settings'] );
            if ( ! defined( 'AIOSEOP_AJAX_MSG_TMPL' ) )
Severity: Minor
Found in aioseop_functions.php - About 1 hr 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 to_header has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

      public function to_header($realm=null) {
        $first = true;
        if($realm) {
          $out = 'Authorization: OAuth realm="' . OAuthUtil::urlencode_rfc3986($realm) . '"';
          $first = false;
Severity: Minor
Found in OAuth.php - About 1 hr 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_build_sitemap has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

        function do_build_sitemap( $sitemap_type, $page = 0, $filename = '', $comment = '' ) {
            if ( empty( $filename ) ) {
                if ( $sitemap_type == 'root' ) {
                    $filename = $this->options["{$this->prefix}filename"];                    
                } else {
Severity: Minor
Found in aioseop_sitemap.php - About 1 hr 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 load_module has 35 lines of code (exceeds 25 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 1 hr to fix

    Method add_attributes has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function add_attributes( $output ) { // avoid having duplicate meta tags
                $type = $this->type;
                if ( empty( $type ) ) $type = 'website';
                
                $schema_types = Array(
    Severity: Minor
    Found in aioseop_opengraph.php - About 1 hr to fix

      Method filter_settings has 35 lines of code (exceeds 25 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 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

                if ( ( ( is_front_page() && $aioseop_options['aiosp_home_keywords'] && !$this->is_static_posts_page() ) || $this->is_static_front_page() ) ) {
                    if ( !empty( $aioseop_options['aiosp_use_static_home_info'] ) ) {
                        $keywords = $this->get_all_keywords();
                    } else {
                        $keywords = trim( $this->internationalize( $aioseop_options['aiosp_home_keywords'] ) );                
        Severity: Critical
        Found in aioseop_class.php - About 1 hr to fix

          Method All_in_One_SEO_Pack_Importer_Exporter has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  function All_in_One_SEO_Pack_Importer_Exporter( ) {
                      $this->name = __( 'Importer & Exporter', 'all-in-one-seo-pack' );    // Human-readable name of the module
                      $this->prefix = 'aiosp_importer_exporter_';                        // option prefix
                      $this->file = __FILE__;
                      parent::__construct();
          Severity: Minor
          Found in aioseop_importer_exporter.php - About 1 hr to fix

            Method is_page_included has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function is_page_included() {
                    global $aioseop_options;
                    if ( is_feed() ) return false;
                    if ( aioseop_mrt_exclude_this_page() ) return false;
                    $post = $this->get_queried_object();
            Severity: Minor
            Found in aioseop_class.php - About 1 hr to fix

              Method settings_export has 32 lines of code (exceeds 25 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 1 hr to fix

                Method generate_htaccess_blocklist has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        function generate_htaccess_blocklist() {
                            if ( !$this->option_isset( 'htaccess_rules' ) ) return;
                            if ( function_exists( 'apache_get_modules' ) ) {
                                $modules = apache_get_modules();
                                foreach( Array( 'mod_authz_host', 'mod_setenvif' ) as $m ) {
                Severity: Minor
                Found in aioseop_bad_robots.php - About 1 hr to fix

                  Method aioseop_mrt_exclude_this_page has 32 lines of code (exceeds 25 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 1 hr to fix

                    Function get_current_options has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                        function get_current_options( $opts = Array(), $location = null, $defaults = null, $post = null ) {
                            if ( ( $location === 'aiosp' ) && ( $this->locations[$location]['type'] == 'metabox' ) ) {
                                if ( $post == null ) {
                                    global $post;
                                }
                    Severity: Minor
                    Found in aioseop_class.php - About 1 hr 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 add_page_hooks has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                            function add_page_hooks() {
                                $memory_usage = memory_get_peak_usage() / 1024 / 1024;
                                if ( $memory_usage > 32 ) {
                                    unset( $this->default_options['memory_limit']['initial_options']['32M'] );
                                    if ( $memory_usage > 64 )  unset( $this->default_options['memory_limit']['initial_options']['64M'] );
                    Severity: Minor
                    Found in aioseop_performance.php - About 1 hr 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_eval_condshow_logic has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function aioseop_eval_condshow_logic( statement ) {
                        var lhs, rhs;
                        if ( ( typeof statement ) == 'object' ) {
                            lhs = statement['lhs'];
                            rhs = statement['rhs'];
                    Severity: Minor
                    Found in aioseop_module.js - About 1 hr 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_post_description has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                        function get_post_description( $post ) {
                            global $aioseop_options;
                            $description = '';
                            if ( !$this->show_page_description() ) {
                                return '';            
                    Severity: Minor
                    Found in aioseop_class.php - About 1 hr 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_addl_pages has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                            function get_addl_pages() {
                                $home = Array();
                                $home = Array(
                                            'loc' => get_home_url(),
                                            'priority' => $this->get_default_priority( 'homepage' ),
                    Severity: Minor
                    Found in aioseop_sitemap.php - About 1 hr 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 delete_file has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                            function delete_file( $filename ) {
                                $wpfs = $this->get_filesystem_object();
                                if ( is_object( $wpfs ) ) {
                                    if ( $wpfs->exists( $filename ) ) {
                                        if ( $wpfs->delete( $filename ) === FALSE)
                    Severity: Minor
                    Found in aioseop_module_class.php - About 1 hr 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