CaffGeek/MBACNationals

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

Summary

Maintainability
C
1 day
Test Coverage

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

function get_network_by_path( $domain, $path, $segments = null ) {
    global $wpdb;

    $domains = $exact_domains = array( $domain );
    $pieces = explode( '.', $domain );
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/ms-load.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_network_by_path has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function get_network_by_path( $domain, $path, $segments = null ) {
    global $wpdb;

    $domains = $exact_domains = array( $domain );
    $pieces = explode( '.', $domain );
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/ms-load.php - About 2 hrs to fix

    Function ms_site_check has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    function ms_site_check() {
        $blog = get_blog_details();
    
        /**
         * Filter checking the status of the current blog.
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/ms-load.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_site_by_path has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function get_site_by_path( $domain, $path, $segments = null ) {
        global $wpdb;
    
        $path_segments = array_filter( explode( '/', trim( $path, '/' ) ) );
    
    
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/ms-load.php - About 1 hr to fix

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

      function ms_not_installed() {
          global $wpdb, $domain, $path;
      
          wp_load_translations_early();
      
      
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/ms-load.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

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

      function get_site_by_path( $domain, $path, $segments = null ) {
          global $wpdb;
      
          $path_segments = array_filter( explode( '/', trim( $path, '/' ) ) );
      
      
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/ms-load.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

      Avoid too many return statements within this method.
      Open

          return true;
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/ms-load.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return WP_CONTENT_DIR . '/blog-suspended.php';
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/ms-load.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

              return false;
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/ms-load.php - About 30 mins to fix

            There are no issues that match your filters.

            Category
            Status