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

View on GitHub

Showing 399 of 427 total issues

Method get_option_html has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function get_option_html( $args ) {
            static $n = 0;
            extract( $args );
            if ( $options['type'] == 'custom' )
                return apply_filters( "{$prefix}output_option", '', $args );                
Severity: Minor
Found in aioseop_module_class.php - About 1 hr to fix

    Function aioseop_mrt_pccolumn has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        function aioseop_mrt_pccolumn($aioseopcn, $aioseoppi) {
            $id = $aioseoppi;
            $target = null;
            if( $aioseopcn == 'seotitle' ) $target = 'title';
            if( $aioseopcn == 'seokeywords' ) $target = 'keywords';
    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 get_option_row has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

            function get_option_row( $name, $opts, $args ) {
                $label_text = $input_attr = $help_text_2 = $id_attr = '';
                if ( $opts['label'] == 'top' )
                    $align    = 'left';
                else
    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

    Method annotate_robots has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function annotate_robots( $robots ) {
                    $state = 0;
                    $rules = Array();
                    foreach ($robots as $l) {
                        $l = trim($l);
    Severity: Minor
    Found in aioseop_robots.php - About 1 hr to fix

      Method get_prio_calc has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function get_prio_calc( $date, $stats = 0 ) {
                  static $cur_time = null;
                  if ($cur_time === null) $cur_time = time();
                  $time = $cur_time - mysql2date( 'U', $date );
                  if ( !empty( $stats ) && isset( $stats['max'] ) && ( $stats['max'] ) ) {
      Severity: Minor
      Found in aioseop_sitemap.php - About 1 hr to fix

        Method get_problem_files has 42 lines of code (exceeds 25 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 hr to fix

          Function display_tabs has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

                  function display_tabs( $location ) {
                      if ( ( $location != null ) && isset( $locations[$location]['tabs'] ) )
                          $tabs = $locations['location']['tabs'];
                      else
                          $tabs = $this->tabs;
          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 aioseop_mrt_mkarry has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              function aioseop_mrt_mkarry() {
                  global $aiosp;
                  global $aioseop_options;
                  $naioseop_options = $aiosp->default_options();
          
          
          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 parse_parameters has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

                public static function parse_parameters( $input ) {
                  if (!isset($input) || !$input) return array();
          
                  $pairs = explode('&', $input);
          
          
          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 admin_bar_menu has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              function admin_bar_menu() {
                  global $wp_admin_bar, $aioseop_admin_menu, $aioseop_options, $post;
                  if ( !empty( $aioseop_options['aiosp_admin_bar'] ) ) {
                      $menu_slug = plugin_basename( __FILE__ );
                      
          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 apply_description_format has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              function apply_description_format( $description, $post = null ) {
                  global $aioseop_options, $wp_query;
                  $description_format = $aioseop_options['aiosp_description_format'];
                  if ( !isset( $description_format ) || empty( $description_format ) ) {
                      $description_format = "%description%";
          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

          Method get_google_authorship has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function get_google_authorship( $post ) {
                  global $aioseop_options;
                  $page = $this->get_page_number();
                  // handle authorship
                  $googleplus = $publisher = $author = '';
          Severity: Minor
          Found in aioseop_class.php - About 1 hr to fix

            Method oauth_connect has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function oauth_connect( $count = 0 ) {
                    global $aiosp_activation;
                    if ( !class_exists( 'OAuthConsumer' ) ) require_once( 'OAuth.php' );
                    $url = '';
                    $callback_url = NULL;
            Severity: Minor
            Found in aioseop_class.php - About 1 hr to fix

              Method save_post_data has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function save_post_data( $id ) {
                      $awmp_edit = $nonce = null;
                      if ( empty( $_POST ) ) return false;
                      if ( isset( $_POST[ 'aiosp_edit' ] ) )                $awmp_edit = $_POST['aiosp_edit'];
                      if ( isset( $_POST[ 'nonce-aioseop-edit' ] ) )        $nonce     = $_POST['nonce-aioseop-edit'];
              Severity: Minor
              Found in aioseop_class.php - About 1 hr to fix

                Method do_sitemap_scan has 38 lines of code (exceeds 25 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 hr to fix

                  Method All_in_One_SEO_Pack_File_Editor has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          function All_in_One_SEO_Pack_File_Editor( ) {
                              $this->name = __('File Editor', 'all-in-one-seo-pack');        // Human-readable name of the plugin
                              $this->prefix = 'aiosp_file_editor_';                        // option prefix
                              $this->file = __FILE__;                                        // the current file
                              parent::__construct();
                  Severity: Minor
                  Found in aioseop_file_editor.php - About 1 hr to fix

                    Method sitelinks_search_box has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function sitelinks_search_box() {
                            global $aioseop_options;
                            $home_url = esc_url( get_home_url() );
                            $name_block = $search_block = '';
                            if ( !empty( $aioseop_options["aiosp_google_set_site_name"] ) ) {
                    Severity: Minor
                    Found in aioseop_class.php - About 1 hr to fix

                      Method custom_output_option has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function custom_output_option( $buf, $args ) {
                              if ( $args['name'] == 'aiosp_snippet' )  {
                                  $args['options']['type'] = 'html';
                                  $args['options']['nowrap'] = false;
                                  $args['options']['save'] = false;
                      Severity: Minor
                      Found in aioseop_class.php - About 1 hr to fix

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

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

                              function oauth_connect( $count = 0 ) {
                                  global $aiosp_activation;
                                  if ( !class_exists( 'OAuthConsumer' ) ) require_once( 'OAuth.php' );
                                  $url = '';
                                  $callback_url = NULL;
                          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

                          Severity
                          Category
                          Status
                          Source
                          Language