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

View on GitHub

Showing 427 of 427 total issues

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

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

        function save_file( $filename, $contents ) {
            $failed_str = __( sprintf( "Failed to write file %s!\n", $filename ), 'all-in-one-seo-pack' );
            $readonly_str = __( sprintf( "File %s isn't writable!\n", $filename ), 'all-in-one-seo-pack' );
            $wpfs = $this->get_filesystem_object();
            if ( is_object( $wpfs ) ) {
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

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

        function type_setup() {
            global $aiosp, $wp_query;
            $this->type = '';
            if ( $aiosp->is_static_front_page() ) {
                if ( !empty( $this->options ) && !empty( $this->options['aiosp_opengraph_categories'] ) )
Severity: Minor
Found in aioseop_opengraph.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 aioseop_do_condshow_match has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function aioseop_do_condshow_match( index, value ) {
    if ( typeof value != 'undefined' ) {
        matches = true;
        jQuery.each(value, function(subopt, setting) {
            var statement;
Severity: Minor
Found in aioseop_module.js - About 1 hr to fix

    Method handle_settings_updates has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function handle_settings_updates( $location = null ) {
                $message = '';
                if ( (isset($_POST['action']) && $_POST['action'] == 'aiosp_update_module' &&
                     ( isset( $_POST['Submit_Default'] ) || isset( $_POST['Submit_All_Default'] ) || !empty( $_POST['Submit'] ) ) ) ) {
                    $nonce = $_POST['nonce-aioseop'];
    Severity: Minor
    Found in aioseop_module_class.php - About 1 hr to fix

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

        Method recursive_parse has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function recursive_parse( $array ) {
                    $returnArray = array();
                    if (is_array($array)) {
                        foreach ($array as $key => $value) {
                            if (is_array($value)) {
        Severity: Minor
        Found in aioseop_importer_exporter.php - About 1 hr to fix

          Method from_request has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                public static function from_request($http_method=NULL, $http_url=NULL, $parameters=NULL) {
                  $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on")
                            ? 'http'
                            : 'https';
                  $http_url = ($http_url) ? $http_url : $scheme .
          Severity: Minor
          Found in OAuth.php - About 1 hr to fix

            Method convert_case has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    function convert_case( $str, $mode = 'upper' ) {
                        static $charset = null;
                        if ( $charset == null ) $charset = get_bloginfo( 'charset' );
                        $str = (string)$str;
                        if ( $mode == 'title' ) {
            Severity: Minor
            Found in aioseop_module_class.php - About 1 hr to fix

              Method title_placeholder_helper has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function title_placeholder_helper( $title, $post, $type = 'post', $title_format = '', $category = '' ) {
                      if ( !empty( $post ) )
                          $authordata = get_userdata( $post->post_author );
                      else
                          $authordata = new WP_User();
              Severity: Minor
              Found in aioseop_class.php - About 1 hr to fix

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

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

                    Method post_data_export has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            function post_data_export( $prefix = '_aioseop', $query = Array( 'posts_per_page' => -1 ) ) {
                                $buf = '';
                                $posts_query = new WP_Query( $query );
                                while ($posts_query->have_posts() ) {
                                    $posts_query->the_post();
                    Severity: Minor
                    Found in aioseop_module_class.php - About 1 hr to fix

                      Method get_admin_links has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              function get_admin_links() {
                                  if ( !empty( $this->menu_name ) )
                                      $name = $this->menu_name;
                                  else
                                      $name = $this->name;
                      Severity: Minor
                      Found in aioseop_module_class.php - About 1 hr to fix

                        Method aioseop_ajax_delete_url has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function aioseop_ajax_delete_url() {
                                aioseop_ajax_init();
                                $options = Array();
                                $options = esc_attr( $_POST['options'] );
                                $_POST['action'] = 'aiosp_update_module';
                        Severity: Minor
                        Found in aioseop_functions.php - About 1 hr to fix

                          Method add_post_types has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  function add_post_types() {
                                      $post_type_titles = $this->get_post_type_titles( Array( 'public' => true ) );
                                      $taxonomy_titles = $this->get_taxonomy_titles(  Array( 'public' => true ) );
                                      if ( isset( $post_type_titles['attachment'] ) ) $post_type_titles['attachment'] = __( "Media / Attachments", 'all-in-one-seo-pack' );
                                      $this->default_options['posttypes' ]['initial_options'] = array_merge( Array( 'all' => __( 'All Post Types', 'all-in-one-seo-pack' ) ), $post_type_titles );
                          Severity: Minor
                          Found in aioseop_sitemap.php - About 1 hr to fix

                            Method do_sitemaps has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    function do_sitemaps( $message = '' ) {
                                        if ( !empty( $this->options["{$this->prefix}indexes"] ) && !empty( $this->options["{$this->prefix}paginate"] ) ) {
                                            $this->paginate = true;
                                            if ( ( $this->options["{$this->prefix}max_posts"] ) && ( $this->options["{$this->prefix}max_posts"] > 0 ) && ( $this->options["{$this->prefix}max_posts"] < 50000 ) )
                                                $this->max_posts = $this->options["{$this->prefix}max_posts"];
                            Severity: Minor
                            Found in aioseop_sitemap.php - About 1 hr to fix

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

                                Method parse_ini_helper has 28 lines of code (exceeds 25 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 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language