APO-Epsilon/apo-website

View on GitHub
r8conf2016/register_process.php

Summary

Maintainability
A
2 hrs
Test Coverage

Consider simplifying this complex logical expression.
Open

    if ($fname == NULL || $lname == NULL || $email == NULL || $tel1 == NULL || $tel2 == NULL || $tel3 == NULL || $password == NULL || $shirt == NULL || $housing == NULL || $chapter1 == NULL || $payment == NULL)
    {
      echo '<div class="entry"><strong>All of the required fields were not filled out.  Please try again.</strong></div>';
    } else {
        $insert = "INSERT INTO `conf_contact_information` (firstname, lastname, email, tel1, tel2, tel3, password, shirt, allergytext, housing, chapter1, chapter2, chapter3, guests, payment, reg_date, reg_time) VALUES('$fname','$lname', '$email', '$tel1', '$tel2', '$tel3', '$password', '$shirt', '$allergytext', '$housing', '$chapter1', '$chapter2', '$chapter3', '$guests', '$payment', '$reg_date', '$reg_time')";
Severity: Critical
Found in r8conf2016/register_process.php - About 2 hrs to fix

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

        if ($fname == NULL || $lname == NULL || $email == NULL || $tel1 == NULL || $tel2 == NULL || $tel3 == NULL || $password == NULL || $shirt == NULL || $housing == NULL || $chapter1 == NULL || $payment == NULL)

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

        if ($fname == NULL || $lname == NULL || $email == NULL || $tel1 == NULL || $tel2 == NULL || $tel3 == NULL || $password == NULL || $shirt == NULL || $housing == NULL || $chapter1 == NULL || $payment == NULL)

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

        if ($fname == NULL || $lname == NULL || $email == NULL || $tel1 == NULL || $tel2 == NULL || $tel3 == NULL || $password == NULL || $shirt == NULL || $housing == NULL || $chapter1 == NULL || $payment == NULL)

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

        if ($fname == NULL || $lname == NULL || $email == NULL || $tel1 == NULL || $tel2 == NULL || $tel3 == NULL || $password == NULL || $shirt == NULL || $housing == NULL || $chapter1 == NULL || $payment == NULL)

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

        if ($fname == NULL || $lname == NULL || $email == NULL || $tel1 == NULL || $tel2 == NULL || $tel3 == NULL || $password == NULL || $shirt == NULL || $housing == NULL || $chapter1 == NULL || $payment == NULL)

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

        if ($fname == NULL || $lname == NULL || $email == NULL || $tel1 == NULL || $tel2 == NULL || $tel3 == NULL || $password == NULL || $shirt == NULL || $housing == NULL || $chapter1 == NULL || $payment == NULL)

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

        if ($fname == NULL || $lname == NULL || $email == NULL || $tel1 == NULL || $tel2 == NULL || $tel3 == NULL || $password == NULL || $shirt == NULL || $housing == NULL || $chapter1 == NULL || $payment == NULL)

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

        if ($fname == NULL || $lname == NULL || $email == NULL || $tel1 == NULL || $tel2 == NULL || $tel3 == NULL || $password == NULL || $shirt == NULL || $housing == NULL || $chapter1 == NULL || $payment == NULL)

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

        if ($fname == NULL || $lname == NULL || $email == NULL || $tel1 == NULL || $tel2 == NULL || $tel3 == NULL || $password == NULL || $shirt == NULL || $housing == NULL || $chapter1 == NULL || $payment == NULL)

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

        if ($fname == NULL || $lname == NULL || $email == NULL || $tel1 == NULL || $tel2 == NULL || $tel3 == NULL || $password == NULL || $shirt == NULL || $housing == NULL || $chapter1 == NULL || $payment == NULL)

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

        if ($fname == NULL || $lname == NULL || $email == NULL || $tel1 == NULL || $tel2 == NULL || $tel3 == NULL || $password == NULL || $shirt == NULL || $housing == NULL || $chapter1 == NULL || $payment == NULL)

    Line exceeds 120 characters; contains 136 characters
    Open

    $subject = "(" . $resultcount['COUNT(*)'] . ") " . $fname . " " . $lname . " has registered for the APO Epsilon Region VIII Conference";

    Line exceeds 120 characters; contains 414 characters
    Open

            $insert = "INSERT INTO `conf_contact_information` (firstname, lastname, email, tel1, tel2, tel3, password, shirt, allergytext, housing, chapter1, chapter2, chapter3, guests, payment, reg_date, reg_time) VALUES('$fname','$lname', '$email', '$tel1', '$tel2', '$tel3', '$password', '$shirt', '$allergytext', '$housing', '$chapter1', '$chapter2', '$chapter3', '$guests', '$payment', '$reg_date', '$reg_time')";

    Line exceeds 120 characters; contains 210 characters
    Open

        if ($fname == NULL || $lname == NULL || $email == NULL || $tel1 == NULL || $tel2 == NULL || $tel3 == NULL || $password == NULL || $shirt == NULL || $housing == NULL || $chapter1 == NULL || $payment == NULL)

    Line exceeds 120 characters; contains 329 characters
    Open

        die('There has an been error with your registration. This may be because the email address you supplied is already in use, or there may be other technical problems. If the error persists, please contact the webmaster at <a href="mailto:apo.epsilon.webmaster@gmail.com">apo.epsilon.webmaster@gmail.com.</a>' . mysqli_error());

    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>');

    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>';

    Space before opening parenthesis of function call prohibited
    Open

    require_once ('session.php');

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

    $mail->Subject = $subject;

    Space before opening parenthesis of function call prohibited
    Open

    require_once ('../PasswordHash.php');

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

    $mail->Port = 587;

    Line indented incorrectly; expected 4 spaces, found 0
    Open

    }

    Line indented incorrectly; expected 4 spaces, found 0
    Open

    }

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

    $mail->AddAddress("apo.epsilon.conferencechair@gmail.com", "APO Epsilon Conference Chair");

    Line indented incorrectly; expected 0 spaces, found 4
    Open

        }

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

      exit;

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

    $mail->SMTPAuth = true;

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

    $mail->Host = "smtp.gmail.com";              // specify main server

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

    $resultcount = mysqli_fetch_array($db->query("SELECT COUNT(*) FROM conf_contact_information;"));

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

      ;

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

    require("..includes/PHPMailer/class.phpmailer.php");

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

    $mail->SMTPSecure = "tls";

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

    $mail->Username = "apo.epsilon.webmaster@gmail.com";

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

    $mail->Password = "alphaphiomega";

    Space before opening parenthesis of function call prohibited
    Open

    require_once ('../mysql_access.php');

    Line indented incorrectly; expected 0 spaces, found 4
    Open

        if ($fname == NULL || $lname == NULL || $email == NULL || $tel1 == NULL || $tel2 == NULL || $tel3 == NULL || $password == NULL || $shirt == NULL || $housing == NULL || $chapter1 == NULL || $payment == NULL)

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

    $mail = new PHPMailer();

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

    echo <<<END

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

    $result = $db->query($insert);

    Line indented incorrectly; expected 4 spaces, found 0
    Open

    if (!$result) {

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

    $mail->FromName = "Alpha Phi Omega Epsilon";

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

    $subject = "(" . $resultcount['COUNT(*)'] . ") " . $fname . " " . $lname . " has registered for the APO Epsilon Region VIII Conference";

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

        die('There has an been error with your registration. This may be because the email address you supplied is already in use, or there may be other technical problems. If the error persists, please contact the webmaster at <a href="mailto:apo.epsilon.webmaster@gmail.com">apo.epsilon.webmaster@gmail.com.</a>' . mysqli_error());

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

    $emailToSend = "Name: " . $fname . " " . $lname . "\n" .

    Line indented incorrectly; expected 4 spaces, found 0
    Open

    if(!$mail->Send()) {

    Line indented incorrectly; expected 0 spaces, found 4
    Open

        } else {

    Line indented incorrectly; expected 4 spaces, found 0
    Open

    } else {

    Expected 1 space after closing parenthesis; found 5
    Open

        if ($fname == NULL || $lname == NULL || $email == NULL || $tel1 == NULL || $tel2 == NULL || $tel3 == NULL || $password == NULL || $shirt == NULL || $housing == NULL || $chapter1 == NULL || $payment == NULL)

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

    $mail->IsSMTP();                                      // set mailer to use SMTP

    Expected 1 space after IF keyword; 0 found
    Open

    if(!$mail->Send()) {

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

    $mail->Body    = $emailToSend;

    There are no issues that match your filters.

    Category
    Status