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

View on GitHub

Showing 427 of 427 total issues

Method wp_head has 118 lines of code (exceeds 25 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: Major
Found in aioseop_class.php - About 4 hrs to fix

    Function annotate_robots has a Cognitive Complexity of 31 (exceeds 5 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 4 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 help_text_helper has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
    Open

            function help_text_helper( &$default_options, $options, $help_link = '' ) {
                foreach( $options as $o ) {
                    $ht = '';
                    if ( !empty( $this->help_text[$o] ) )
                        $ht = $this->help_text[$o];
    Severity: Minor
    Found in aioseop_module_class.php - About 4 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_option_html has a Cognitive Complexity of 31 (exceeds 5 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 4 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 31 (exceeds 5 allowed). Consider refactoring.
    Open

            function filter_options( $options, $location ) {
                if ( $location == 'settings' ) {
                    $prefix = $this->get_prefix( $location ) . $location . '_';
                    list( $legacy, $images ) = $this->get_all_images( $options );
                    if ( isset( $options ) && isset( $options["{$prefix}image"] ) ) {
    Severity: Minor
    Found in aioseop_opengraph.php - About 4 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 sitemap_output_hook has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
    Open

            function sitemap_output_hook($query) {
                $page = 0;
                if ( ( $this->options["{$this->prefix}rewrite"] ) )
                    if( !empty( $query->query_vars["{$this->prefix}path"] ) ) {
                        if( !empty( $query->query_vars["{$this->prefix}page"] ) )
    Severity: Minor
    Found in aioseop_sitemap.php - About 4 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_serverinfo has 111 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function get_serverinfo() {
                global $wpdb;
                global $wp_version;
    
                    $sqlversion = $wpdb->get_var("SELECT VERSION() AS version");
    Severity: Major
    Found in aioseop_performance.php - About 4 hrs to fix

      Function save_post_data has a Cognitive Complexity of 30 (exceeds 5 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 4 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_admin_links has a Cognitive Complexity of 30 (exceeds 5 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 4 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 ( get_query_var( 'm' ) ) {
                  $m = preg_replace( '/[^0-9]/', '', get_query_var( 'm' ) );
                  switch ( $this->strlen( $m ) ) {
                      case 4: $link = get_year_link( $m ); break;
                      case 6: $link = get_month_link( $this->substr( $m, 0, 4), $this->substr($m, 4, 2 ) ); break;
      Severity: Critical
      Found in aioseop_class.php - About 4 hrs to fix

        Function get_main_description has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

            function get_main_description( $post = null ) {
                global $aioseop_options;
                $opts = $this->meta_opts;
                $description = '';
                if ( is_author()  && $this->show_page_description() ) {
        Severity: Minor
        Found in aioseop_class.php - About 4 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 encode has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

            function encode($var)
            {
                switch (gettype($var)) {
                    case 'boolean':
                        return $var ? 'true' : 'false';
        Severity: Minor
        Found in JSON.php - About 4 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 save_post_data has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
        Open

                function save_post_data( $post_id ) {
                    static $update = false;
                    if ( $update ) return;
                    if ( $this->locations !== null ) {
                        foreach( $this->locations as $k => $v ) {
        Severity: Minor
        Found in aioseop_module_class.php - About 4 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 handle_settings_updates has a Cognitive Complexity of 28 (exceeds 5 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 4 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 enqueue_metabox_scripts has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
        Open

                function enqueue_metabox_scripts( ) {
                    $screen = '';
                    if ( function_exists( 'get_current_screen' ) )
                        $screen = get_current_screen();
                    $bail = false;
        Severity: Minor
        Found in aioseop_module_class.php - About 4 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 add_page_icon has 101 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function add_page_icon() {
                wp_enqueue_script( 'wp-pointer', false, array( 'jquery' ) );
                wp_enqueue_style( 'wp-pointer' );
                $this->add_admin_pointers();
                ?>
        Severity: Major
        Found in aioseop_class.php - About 4 hrs to fix

          Function load_file has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

                  function load_file( $filename, $use_include_path = false, $context = null, $offset = -1, $maxlen = -1 ) {
                      $wpfs = $this->get_filesystem_object();
                      if ( is_object( $wpfs ) ) {
                          if ( !$wpfs->exists( $filename ) ) return false;
                          if ( ( $offset > 0 ) || ( $maxlen >= 0 ) ) {
          Severity: Minor
          Found in aioseop_module_class.php - About 3 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_comment_count_stats has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

                  function get_comment_count_stats( $posts ) {
                      $count = 0;
                      $total = 0.0;
                      $min = null;
                      $max = 0;
          Severity: Minor
          Found in aioseop_sitemap.php - About 3 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 scan_match_files has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

                  function scan_match_files() {
                      $scan1 = $scan2 = '';
                      $files = Array();
                      
                      if ( !empty( $this->options["{$this->prefix}filename"] ) ) {
          Severity: Minor
          Found in aioseop_sitemap.php - About 3 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 admin_menu has 97 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function admin_menu() {
                  $file = plugin_basename( __FILE__ );
                  $menu_name = __( 'All in One SEO', 'all-in-one-seo-pack' );
          
                  $this->locations['aiosp']['default_options']['nonce-aioseop-edit']['default'] = wp_create_nonce('edit-aioseop-nonce');
          Severity: Major
          Found in aioseop_class.php - About 3 hrs to fix
            Severity
            Category
            Status
            Source
            Language