Web.Admin/2014/wordpress/wp-signup.php
File wp-signup.php
has 386 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/** Sets up the WordPress Environment. */
require( dirname(__FILE__) . '/wp-load.php' );
Function show_blog_form
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
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>';
- Read upRead up
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
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>';
Method signup_another_blog
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function signup_another_blog( $blogname = '', $blog_title = '', $errors = '' ) {
$current_user = wp_get_current_user();
if ( ! is_wp_error($errors) ) {
$errors = new WP_Error();
Method signup_user
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function signup_user( $user_name = '', $user_email = '', $errors = '' ) {
global $active_signup;
if ( !is_wp_error($errors) )
$errors = new WP_Error();
Method signup_blog
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
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(
Method confirm_another_blog_signup
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function confirm_another_blog_signup( $domain, $path, $blog_title, $user_name, $user_email = '', $meta = array() ) {
Method confirm_blog_signup
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function confirm_blog_signup( $domain, $path, $blog_title, $user_name = '', $user_email = '', $meta = array() ) {
Consider simplifying this complex logical expression. Open
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' ) )
Method signup_blog
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function signup_blog($user_name = '', $user_email = '', $blogname = '', $blog_title = '', $errors = '') {