chamilo/chamilo-lms

View on GitHub
public/main/inc/lib/formvalidator/Rule/UsernameAvailable.php

Summary

Maintainability
A
0 mins
Test Coverage

The parameter $current_username is not named in camelCase.
Open

    public function validate($username, $current_username = null)
    {
        $user_table = Database::get_main_table(TABLE_MAIN_USER);
        $username = Database::escape_string($username);
        $current_username = Database::escape_string($current_username);

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The class HTML_QuickForm_Rule_UsernameAvailable is not named in CamelCase.
Open

class HTML_QuickForm_Rule_UsernameAvailable extends HTML_QuickForm_Rule
{
    /**
     * Function to check if a username is available.
     *

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

Variable "user_table" is not in valid camel caps format
Open

        $sql = "SELECT * FROM $user_table WHERE username = '$username'";

Variable "current_username" is not in valid camel caps format
Open

            $sql .= " AND username != '$current_username'";

Variable "user_table" is not in valid camel caps format
Open

        $user_table = Database::get_main_table(TABLE_MAIN_USER);

Variable "current_username" is not in valid camel caps format
Open

        $current_username = Database::escape_string($current_username);

Variable "current_username" is not in valid camel caps format
Open

        if (!is_null($current_username)) {

Variable "current_username" is not in valid camel caps format
Open

        $current_username = Database::escape_string($current_username);

Variable "current_username" is not in valid camel caps format
Open

    public function validate($username, $current_username = null)

Class name "HTML_QuickForm_Rule_UsernameAvailable" is not in camel caps format
Open

class HTML_QuickForm_Rule_UsernameAvailable extends HTML_QuickForm_Rule

The variable $current_username is not named in camelCase.
Open

    public function validate($username, $current_username = null)
    {
        $user_table = Database::get_main_table(TABLE_MAIN_USER);
        $username = Database::escape_string($username);
        $current_username = Database::escape_string($current_username);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $current_username is not named in camelCase.
Open

    public function validate($username, $current_username = null)
    {
        $user_table = Database::get_main_table(TABLE_MAIN_USER);
        $username = Database::escape_string($username);
        $current_username = Database::escape_string($current_username);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $user_table is not named in camelCase.
Open

    public function validate($username, $current_username = null)
    {
        $user_table = Database::get_main_table(TABLE_MAIN_USER);
        $username = Database::escape_string($username);
        $current_username = Database::escape_string($current_username);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $current_username is not named in camelCase.
Open

    public function validate($username, $current_username = null)
    {
        $user_table = Database::get_main_table(TABLE_MAIN_USER);
        $username = Database::escape_string($username);
        $current_username = Database::escape_string($current_username);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $current_username is not named in camelCase.
Open

    public function validate($username, $current_username = null)
    {
        $user_table = Database::get_main_table(TABLE_MAIN_USER);
        $username = Database::escape_string($username);
        $current_username = Database::escape_string($current_username);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $user_table is not named in camelCase.
Open

    public function validate($username, $current_username = null)
    {
        $user_table = Database::get_main_table(TABLE_MAIN_USER);
        $username = Database::escape_string($username);
        $current_username = Database::escape_string($current_username);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

There are no issues that match your filters.

Category
Status