includes/db-updates.php

Summary

Maintainability
A
3 hrs
Test Coverage

Method wp_stream_update_auto_300 has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function wp_stream_update_auto_300( $db_version, $current_version ) {
    global $wpdb;

    // Get only the author_meta values that are double-serialized.
    $wpdb->query( "RENAME TABLE {$wpdb->base_prefix}stream TO {$wpdb->base_prefix}stream_tmp, {$wpdb->base_prefix}stream_context TO {$wpdb->base_prefix}stream_context_tmp" );
Severity: Minor
Found in includes/db-updates.php - About 1 hr to fix

    Method wp_stream_update_302 has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function wp_stream_update_302( $db_version, $current_version ) {
        global $wpdb;
    
        $stream_entries = $wpdb->get_results( "SELECT * FROM {$wpdb->base_prefix}stream" );
        foreach ( $stream_entries as $entry ) {
    Severity: Minor
    Found in includes/db-updates.php - About 1 hr to fix

      Function wp_stream_update_auto_300 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      function wp_stream_update_auto_300( $db_version, $current_version ) {
          global $wpdb;
      
          // Get only the author_meta values that are double-serialized.
          $wpdb->query( "RENAME TABLE {$wpdb->base_prefix}stream TO {$wpdb->base_prefix}stream_tmp, {$wpdb->base_prefix}stream_context TO {$wpdb->base_prefix}stream_context_tmp" );
      Severity: Minor
      Found in includes/db-updates.php - About 35 mins 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

      There are no issues that match your filters.

      Category
      Status