CaffGeek/MBACNationals

View on GitHub
Web.Admin/2014/wordpress/wp-signup.php

Summary

Maintainability
D
1 day
Test Coverage

File wp-signup.php has 386 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/** Sets up the WordPress Environment. */
require( dirname(__FILE__) . '/wp-load.php' );

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-signup.php - About 5 hrs to fix

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

    function show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) {
        $current_site = get_current_site();
        // Blog name
        if ( !is_subdomain_install() )
            echo '<label for="blogname">' . __('Site Name:') . '</label>';
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-signup.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 show_blog_form has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) {
        $current_site = get_current_site();
        // Blog name
        if ( !is_subdomain_install() )
            echo '<label for="blogname">' . __('Site Name:') . '</label>';
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-signup.php - About 1 hr to fix

      Method signup_another_blog has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function signup_another_blog( $blogname = '', $blog_title = '', $errors = '' ) {
          $current_user = wp_get_current_user();
      
          if ( ! is_wp_error($errors) ) {
              $errors = new WP_Error();
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-signup.php - About 1 hr to fix

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

        function signup_user( $user_name = '', $user_email = '', $errors = '' ) {
            global $active_signup;
        
            if ( !is_wp_error($errors) )
                $errors = new WP_Error();
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-signup.php - About 1 hr to fix

          Method signup_blog has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function signup_blog($user_name = '', $user_email = '', $blogname = '', $blog_title = '', $errors = '') {
              if ( !is_wp_error($errors) )
                  $errors = new WP_Error();
          
              $signup_blog_defaults = array(
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-signup.php - About 1 hr to fix

            Method confirm_another_blog_signup has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function confirm_another_blog_signup( $domain, $path, $blog_title, $user_name, $user_email = '', $meta = array() ) {
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-signup.php - About 45 mins to fix

              Method confirm_blog_signup has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function confirm_blog_signup( $domain, $path, $blog_title, $user_name = '', $user_email = '', $meta = array() ) {
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-signup.php - About 45 mins to fix

                Consider simplifying this complex logical expression.
                Open

                            if ( is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'blog' ) )
                                signup_another_blog($newblogname);
                            elseif ( is_user_logged_in() == false && ( $active_signup == 'all' || $active_signup == 'user' ) )
                                signup_user( $newblogname, $user_email );
                            elseif ( is_user_logged_in() == false && ( $active_signup == 'blog' ) )
                Severity: Major
                Found in Web.Admin/2014/wordpress/wp-signup.php - About 40 mins to fix

                  Method signup_blog has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  function signup_blog($user_name = '', $user_email = '', $blogname = '', $blog_title = '', $errors = '') {
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-signup.php - About 35 mins to fix

                    There are no issues that match your filters.

                    Category
                    Status