CaffGeek/MBACNationals

View on GitHub
Web.Admin/2014/wordpress/wp-includes/ms-deprecated.php

Summary

Maintainability
B
4 hrs
Test Coverage

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

function get_most_active_blogs( $num = 10, $display = true ) {
    _deprecated_function( __FUNCTION__, '3.0' );

    $blogs = get_blog_list( 0, 'all', false ); // $blog_id -> $details
    if ( is_array( $blogs ) ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ms-deprecated.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 graceful_fail has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function graceful_fail( $message ) {
    _deprecated_function( __FUNCTION__, '3.0', 'wp_die()' );
    $message = apply_filters( 'graceful_fail', $message );
    $message_template = apply_filters( 'graceful_fail_template',
'<!DOCTYPE html>
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ms-deprecated.php - About 1 hr to fix

    Function get_blogaddress_by_domain has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    function get_blogaddress_by_domain( $domain, $path ) {
        _deprecated_function( __FUNCTION__, '3.7' );
    
        if ( is_subdomain_install() ) {
            $url = "http://" . $domain.$path;
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/ms-deprecated.php - About 45 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

    Function wpmu_admin_do_redirect has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    function wpmu_admin_do_redirect( $url = '' ) {
        _deprecated_function( __FUNCTION__, '3.3' );
    
        $ref = '';
        if ( isset( $_GET['ref'] ) )
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/ms-deprecated.php - About 45 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

    Function is_site_admin has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    function is_site_admin( $user_login = '' ) {
        _deprecated_function( __FUNCTION__, '3.0', 'is_super_admin()' );
    
        if ( empty( $user_login ) ) {
            $user_id = get_current_user_id();
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/ms-deprecated.php - About 25 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