APO-Epsilon/apo-website

View on GitHub
login_forgotpw.php

Summary

Maintainability
C
1 day
Test Coverage

Method email_new_pw has 84 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function email_new_pw($to) {
    
    include ('mysql_access.php');
    
    $aresponse=$db->query("SELECT username FROM contact_information WHERE email='$to'");
Severity: Major
Found in login_forgotpw.php - About 3 hrs to fix

    Function email_new_pw has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

    function email_new_pw($to) {
        
        include ('mysql_access.php');
        
        $aresponse=$db->query("SELECT username FROM contact_information WHERE email='$to'");
    Severity: Minor
    Found in login_forgotpw.php - About 3 hrs 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

    The function email_new_pw() has 103 lines of code. Current threshold is set to 100. Avoid really long methods.
    Open

    function email_new_pw($to) {
        
        include ('mysql_access.php');
        
        $aresponse=$db->query("SELECT username FROM contact_information WHERE email='$to'");
    Severity: Minor
    Found in login_forgotpw.php by phpmd

    The function email_new_pw() has a Cyclomatic Complexity of 22. The configured cyclomatic complexity threshold is 10.
    Open

    function email_new_pw($to) {
        
        include ('mysql_access.php');
        
        $aresponse=$db->query("SELECT username FROM contact_information WHERE email='$to'");
    Severity: Minor
    Found in login_forgotpw.php by phpmd

    CyclomaticComplexity

    Since: 0.1

    Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

    Example

    // Cyclomatic Complexity = 11
    class Foo {
    1   public function example() {
    2       if ($a == $b) {
    3           if ($a1 == $b1) {
                    fiddle();
    4           } elseif ($a2 == $b2) {
                    fiddle();
                } else {
                    fiddle();
                }
    5       } elseif ($c == $d) {
    6           while ($c == $d) {
                    fiddle();
                }
    7        } elseif ($e == $f) {
    8           for ($n = 0; $n < $h; $n++) {
                    fiddle();
                }
            } else {
                switch ($z) {
    9               case 1:
                        fiddle();
                        break;
    10              case 2:
                        fiddle();
                        break;
    11              case 3:
                        fiddle();
                        break;
                    default:
                        fiddle();
                        break;
                }
            }
        }
    }

    Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

    Avoid using undefined variables such as '$db' which will lead to PHP notices.
    Open

        $aresponse=$db->query("SELECT username FROM contact_information WHERE email='$to'");
    Severity: Minor
    Found in login_forgotpw.php by phpmd

    UndefinedVariable

    Since: 2.8.0

    Detects when a variable is used that has not been defined before.

    Example

    class Foo
    {
        private function bar()
        {
            // $message is undefined
            echo $message;
        }
    }

    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

    Avoid using undefined variables such as '$db' which will lead to PHP notices.
    Open

        $update = $db->query($sql) or exit("There was an error, contact Webmaster");
    Severity: Minor
    Found in login_forgotpw.php by phpmd

    UndefinedVariable

    Since: 2.8.0

    Detects when a variable is used that has not been defined before.

    Example

    class Foo
    {
        private function bar()
        {
            // $message is undefined
            echo $message;
        }
    }

    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

    Missing class import via use statement (line '98', column '16').
    Open

        $hasher = new PasswordHash(8,true);
    Severity: Minor
    Found in login_forgotpw.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    The function email_new_pw() contains an exit expression.
    Open

        $update = $db->query($sql) or exit("There was an error, contact Webmaster");
    Severity: Minor
    Found in login_forgotpw.php by phpmd

    ExitExpression

    Since: 0.2

    An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

    Example

    class Foo {
        public function bar($param)  {
            if ($param === 42) {
                exit(23);
            }
        }
    }

    Source https://phpmd.org/rules/design.html#exitexpression

    Avoid unused local variables such as '$update'.
    Open

        $update = $db->query($sql) or exit("There was an error, contact Webmaster");
    Severity: Minor
    Found in login_forgotpw.php by phpmd

    UnusedLocalVariable

    Since: 0.2

    Detects when a local variable is declared and/or assigned, but not used.

    Example

    class Foo {
        public function doSomething()
        {
            $i = 5; // Unused
        }
    }

    Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        switch ($num) {
        case 1:
            $word1 = 'Dog';
            break;
        case 2:
    Severity: Major
    Found in login_forgotpw.php and 1 other location - About 2 hrs to fix
    login_forgotpw.php on lines 59..92

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 133.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        switch ($num) {
        case 1:
            $word2 = 'Dog';
            break;
        case 2:
    Severity: Major
    Found in login_forgotpw.php and 1 other location - About 2 hrs to fix
    login_forgotpw.php on lines 23..56

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 133.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 13 and the first side effect is on line 2.
    Open

    <?php
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Avoid variables with short names like $to. Configured minimum length is 3.
    Open

    function email_new_pw($to) {
    Severity: Minor
    Found in login_forgotpw.php by phpmd

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

    Source https://phpmd.org/rules/naming.html#shortvariable

    Spaces must be used for alignment; tabs are not allowed
    Open

            break;        
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Terminating statement must be indented to the same level as the CASE body
    Open

            break;
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Terminating statement must be indented to the same level as the CASE body
    Open

            break;
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Terminating statement must be indented to the same level as the CASE body
    Open

            break;
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Terminating statement must be indented to the same level as the CASE body
    Open

            break;
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Space found before comma in function call
    Open

        $num = rand ( 1 , 10 );
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Terminating statement must be indented to the same level as the CASE body
    Open

            break;
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Terminating statement must be indented to the same level as the CASE body
    Open

            break;        
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Terminating statement must be indented to the same level as the CASE body
    Open

            break;
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        $hash = $hasher->HashPassword($password);
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        $subject = "Your password has been reset!";
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Terminating statement must be indented to the same level as the CASE body
    Open

            break;
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        <?php
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            {
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                <p>email:<input type="text" name="user_email" style="width: 7em">
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Terminating statement must be indented to the same level as the CASE body
    Open

            break;
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Terminating statement must be indented to the same level as the CASE body
    Open

            break;
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            </form>
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        switch ($num) {
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            break;        
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        // use wordwrap() if lines are longer than 70 characters
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        //$msg = wordwrap($msg,70);
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        // send email
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            if (isset($_POST['user_email']))
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                </p><p>
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        $num = rand ( 11, 999 );
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        $msg = "$user ($to) APO password has been reset to : $password.";
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            break;        
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Terminating statement must be indented to the same level as the CASE body
    Open

            break;
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        $password = $word1 . $word2 . $num;
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Terminating statement must be indented to the same level as the CASE body
    Open

            break;        
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            break;        
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        }    
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        $hash = htmlspecialchars($hash, ENT_QUOTES);
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            <form form name="signin" action="" method="post">
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Space found before comma in function call
    Open

        $num = rand ( 1 , 10 );
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        $num = rand ( 1 , 10 );
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Terminating statement must be indented to the same level as the CASE body
    Open

            break;
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Terminating statement must be indented to the same level as the CASE body
    Open

            break;
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        mail($to,$subject,$msg);
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Terminating statement must be indented to the same level as the CASE body
    Open

            break;
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                email_new_pw($_POST['user_email']);
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            <p>Enter your email to recieve a new password.</p>
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Terminating statement must be indented to the same level as the CASE body
    Open

            break;        
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        ?>
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Terminating statement must be indented to the same level as the CASE body
    Open

            break;
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Terminating statement must be indented to the same level as the CASE body
    Open

            break;
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Terminating statement must be indented to the same level as the CASE body
    Open

            break;
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        }    
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        $hasher = new PasswordHash(8,true);
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Function closing brace must go on the next line following the body; found 1 blank lines before brace
    Open

    }
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Terminating statement must be indented to the same level as the CASE body
    Open

            break;        
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        // the message
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                <input type="submit" name="submit" value="Receive Password"/></p>
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        $aresponse=$db->query("SELECT username FROM contact_information WHERE email='$to'");
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        include ('mysql_access.php');
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    End of line character is invalid; expected "\n" but found "\r\n"
    Open

    <?php
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        $user=$aresult['username'];
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        $aresult=mysqli_fetch_array($aresponse);
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        switch ($num) {
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        $num = rand ( 1 , 10 );
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        //generate a random pw with 2 words and 2 numbers
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        case 2:
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

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

            $word1 = 'Bridge';
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        case 5:
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

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

            $word1 = 'Purple';
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

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

            $word1 = 'Purple';
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        default:
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Whitespace found at end of line
    Open

            break;        
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        case 2:
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Space before opening parenthesis of function call prohibited
    Open

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

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

            $word2 = 'Purple';
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

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

            $word1 = 'password';
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Opening brace should be on a new line
    Open

    function email_new_pw($to) {
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        default:
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Space before opening parenthesis of function call prohibited
    Open

        $num = rand ( 1 , 10 );
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Space before opening parenthesis of function call prohibited
    Open

        $num = rand ( 11, 999 );
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

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

            $word1 = 'House';
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

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

            $word1 = 'Bridge';
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

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

            $word2 = 'Bridge';
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        $num = rand ( 1 , 10 );
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

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

            $word2 = 'Biggest';
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

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

            $word1 = 'Biggest';
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Expected 1 space after closing parenthesis; found 10
    Open

            if (isset($_POST['user_email']))
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        case 8:
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

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

            $word2 = 'Biggest';
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

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

            $word2 = 'password';
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Space before opening parenthesis of function call prohibited
    Open

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

    Space after opening parenthesis of function call prohibited
    Open

        $num = rand ( 1 , 10 );
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        case 7:
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

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

            $word2 = 'Dog';
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        case 3:
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Whitespace found at end of line
    Open

            break;        
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        $num = rand ( 11, 999 );
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        case 4:
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        case 5:
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

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

            $word2 = 'House';
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        case 10:
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

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

            $word1 = 'Dog';
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

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

            $word1 = 'House';
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        case 10:
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        $num = rand ( 1 , 10 );
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        case 4:
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        $num = rand ( 11, 999 );
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    No space found after comma in function call
    Open

        mail($to,$subject,$msg);
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Space before opening parenthesis of function call prohibited
    Open

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

    Space before opening parenthesis of function call prohibited
    Open

        $num = rand ( 1 , 10 );
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        case 9:
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        case 3:
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        case 9:
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Whitespace found at end of line
    Open

        }    
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    No space found after comma in function call
    Open

        mail($to,$subject,$msg);
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Whitespace found at end of line
    Open

            break;        
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        case 1:
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

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

            $word2 = 'Bridge';
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

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

            $word2 = 'Purple';
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    No space found after comma in function call
    Open

        $hasher = new PasswordHash(8,true);
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        case 6:
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

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

            $word1 = 'Biggest';
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Line indented incorrectly; expected 4 spaces, found 8
    Open

            if (isset($_POST['user_email']))
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Space before opening parenthesis of function call prohibited
    Open

        include ('mysql_access.php');
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        case 1:
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

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

            $word2 = 'Dog';
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        $num = rand ( 1 , 10 );
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        case 8:
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

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

            $word1 = 'Dog';
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

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

            $word2 = 'House';
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Whitespace found at end of line
    Open

            break;        
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        case 6:
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        case 7:
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    Line indented incorrectly; expected 4 spaces, found 8
    Open

            }
    Severity: Minor
    Found in login_forgotpw.php by phpcodesniffer

    There are no issues that match your filters.

    Category
    Status