APO-Epsilon/apo-website

View on GitHub
register_process.php

Summary

Maintainability
A
40 mins
Test Coverage

Consider simplifying this complex logical expression.
Open

    if ($firstname == NULL || $lastname == NULL || $username == NULL || $password == NULL || $email == NULL  ||  $regpass == NULL )
    {
      echo '<div class="entry"><strong>All of the required fields were not filled out.  Please try again.</strong></div>';
    } else if ($regpass == $current_reg_pass) {
        $insert = "INSERT INTO `contact_information` (firstname,
Severity: Major
Found in register_process.php - About 40 mins to fix

    TRUE, FALSE and NULL must be lowercase; expected "null" but found "NULL"
    Open

        if ($firstname == NULL || $lastname == NULL || $username == NULL || $password == NULL || $email == NULL  ||  $regpass == NULL )
    Severity: Minor
    Found in register_process.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        if ($firstname == NULL || $lastname == NULL || $username == NULL || $password == NULL || $email == NULL  ||  $regpass == NULL )
    Severity: Minor
    Found in register_process.php by phpcodesniffer

    TRUE, FALSE and NULL must be lowercase; expected "null" but found "NULL"
    Open

        if ($firstname == NULL || $lastname == NULL || $username == NULL || $password == NULL || $email == NULL  ||  $regpass == NULL )
    Severity: Minor
    Found in register_process.php by phpcodesniffer

    TRUE, FALSE and NULL must be lowercase; expected "null" but found "NULL"
    Open

        if ($firstname == NULL || $lastname == NULL || $username == NULL || $password == NULL || $email == NULL  ||  $regpass == NULL )
    Severity: Minor
    Found in register_process.php by phpcodesniffer

    TRUE, FALSE and NULL must be lowercase; expected "null" but found "NULL"
    Open

        if ($firstname == NULL || $lastname == NULL || $username == NULL || $password == NULL || $email == NULL  ||  $regpass == NULL )
    Severity: Minor
    Found in register_process.php by phpcodesniffer

    TRUE, FALSE and NULL must be lowercase; expected "null" but found "NULL"
    Open

        if ($firstname == NULL || $lastname == NULL || $username == NULL || $password == NULL || $email == NULL  ||  $regpass == NULL )
    Severity: Minor
    Found in register_process.php by phpcodesniffer

    TRUE, FALSE and NULL must be lowercase; expected "null" but found "NULL"
    Open

        if ($firstname == NULL || $lastname == NULL || $username == NULL || $password == NULL || $email == NULL  ||  $regpass == NULL )
    Severity: Minor
    Found in register_process.php by phpcodesniffer

    Line exceeds 120 characters; contains 193 characters
    Open

            echo '<div class="entry"><strong>Your registration password was incorrect.  Please try again.<br>If you do not know your registration pass please contact the webmaster.</strong></div>';
    Severity: Minor
    Found in register_process.php by phpcodesniffer

    Line exceeds 120 characters; contains 122 characters
    Open

          echo '<div class="entry"><strong>All of the required fields were not filled out.  Please try again.</strong></div>';
    Severity: Minor
    Found in register_process.php by phpcodesniffer

    Line exceeds 120 characters; contains 131 characters
    Open

        if ($firstname == NULL || $lastname == NULL || $username == NULL || $password == NULL || $email == NULL  ||  $regpass == NULL )
    Severity: Minor
    Found in register_process.php by phpcodesniffer

    Line exceeds 120 characters; contains 145 characters
    Open

            $query2 = $db->query($insert) or die('<br><div class="entry"><strong>Your username is already taken.  Please try again.</strong></div>');
    Severity: Minor
    Found in register_process.php by phpcodesniffer

    Line indented incorrectly; expected 4 spaces, found 0
    Open

    }
    Severity: Minor
    Found in register_process.php by phpcodesniffer

    Line indented incorrectly; expected at least 4 spaces, found 0
    Open

    echo <<<END
    Severity: Minor
    Found in register_process.php by phpcodesniffer

    Space before opening parenthesis of function call prohibited
    Open

    require_once ("PasswordHash.php");
    Severity: Minor
    Found in register_process.php by phpcodesniffer

    Line indented incorrectly; expected 0 spaces, found 4
    Open

        }
    Severity: Minor
    Found in register_process.php by phpcodesniffer

    Line indented incorrectly; expected 0 spaces, found 4
    Open

        if ($firstname == NULL || $lastname == NULL || $username == NULL || $password == NULL || $email == NULL  ||  $regpass == NULL )
    Severity: Minor
    Found in register_process.php by phpcodesniffer

    Line indented incorrectly; expected 0 spaces, found 4
    Open

        } else {
    Severity: Minor
    Found in register_process.php by phpcodesniffer

    Expected 1 space after closing parenthesis; found 5
    Open

        if ($firstname == NULL || $lastname == NULL || $username == NULL || $password == NULL || $email == NULL  ||  $regpass == NULL )
    Severity: Minor
    Found in register_process.php by phpcodesniffer

    Line indented incorrectly; expected at least 4 spaces, found 0
    Open

    $result = $db->query($insert);
    Severity: Minor
    Found in register_process.php by phpcodesniffer

    Line indented incorrectly; expected at least 8 spaces, found 4
    Open

        die('Invalid query: ' . mysqli_error());
    Severity: Minor
    Found in register_process.php by phpcodesniffer

    Line indented incorrectly; expected 0 spaces, found 4
    Open

        } else if ($regpass == $current_reg_pass) {
    Severity: Minor
    Found in register_process.php by phpcodesniffer

    Space before opening parenthesis of function call prohibited
    Open

    require_once ('session.php');
    Severity: Minor
    Found in register_process.php by phpcodesniffer

    Space before opening parenthesis of function call prohibited
    Open

    require_once ('mysql_access.php');
    Severity: Minor
    Found in register_process.php by phpcodesniffer

    Usage of ELSE IF is discouraged; use ELSEIF instead
    Open

        } else if ($regpass == $current_reg_pass) {
    Severity: Minor
    Found in register_process.php by phpcodesniffer

    Line indented incorrectly; expected 4 spaces, found 0
    Open

    if (!$result) {
    Severity: Minor
    Found in register_process.php by phpcodesniffer

    There are no issues that match your filters.

    Category
    Status