APO-Epsilon/apo-website

View on GitHub
retrieve_user.php

Summary

Maintainability
A
0 mins
Test Coverage

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

    $results=$db->query($query);
Severity: Minor
Found in retrieve_user.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 unused local variables such as '$db'.
Open

    $results=$db->query($query);
Severity: Minor
Found in retrieve_user.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

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

function id_to_position ($id)
Severity: Minor
Found in retrieve_user.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

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

  $id = select($operand, $condition, $email);
Severity: Minor
Found in retrieve_user.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

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

function id_to_email ($id)
Severity: Minor
Found in retrieve_user.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

Expected "function abc(...)"; found "function abc (...)"
Open

function id_to_email ($id)
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

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

  return $email;     
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

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

    $operand = 'position';
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

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

    $position = select($operand, $condition, $id);
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

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

    
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

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

    return $position;
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

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

{    
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

Expected 0 spaces before opening parenthesis; 1 found
Open

function id_to_email ($id)
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

Expected "function abc(...)"; found "function abc (...)"
Open

function email_to_id ($email) 
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

Expected "function abc(...)"; found "function abc (...)"
Open

function id_to_position ($id)
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

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

    
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

Expected 0 spaces before opening parenthesis; 1 found
Open

function email_to_id ($email) 
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

Expected 0 spaces before opening parenthesis; 1 found
Open

function id_to_position ($id)
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

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

    $condition = 'id';
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

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

    return $final[$operand];
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

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

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

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

    $results=$db->query($query);
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

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

    
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

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

    $final=mysqli_fetch_array($results);
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

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

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

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

    
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

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

    $query = "SELECT $operand FROM contact_information WHERE $condition = '$value'";
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

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

    $results->free();
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

Whitespace found at end of line
Open

{    
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

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

  $operand = 'email';
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

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

  $email = select($operand, $condition, $id);
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

Whitespace found at end of line
Open

  return $email;     
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

Whitespace found at end of line
Open

function email_to_id ($email) 
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

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

  $id = select($operand, $condition, $email);
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

A closing tag is not permitted at the end of a PHP file
Open

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

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

  $condition = 'email';  
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

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

  return $email;     
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

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

  $condition = 'id';
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

Expected 1 newline at end of file; 0 found
Open

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

Whitespace found at end of line
Open

  $condition = 'email';  
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

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

  return $id;  
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

Whitespace found at end of line
Open

  return $id;  
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

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

  $operand = 'id';
Severity: Minor
Found in retrieve_user.php by phpcodesniffer

There are no issues that match your filters.

Category
Status