APO-Epsilon/apo-website

View on GitHub
r8conf2016/login.php

Summary

Maintainability
B
4 hrs
Test Coverage

print_login accesses the super-global variable $_SESSION.
Open

function print_login(){
    $error_message = "";
    if (!isset($_GET['continue'])) {
    }
    if(isset($_GET['continue'])){
Severity: Minor
Found in r8conf2016/login.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

process_login accesses the super-global variable $_POST.
Open

function process_login(){
    require_once ('../mysql_access.php');
    $email = addslashes($_POST["email"]);
    $password = addslashes($_POST["password"]);
    $hasher = new PasswordHash(8, true);
Severity: Minor
Found in r8conf2016/login.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

process_login accesses the super-global variable $_POST.
Open

function process_login(){
    require_once ('../mysql_access.php');
    $email = addslashes($_POST["email"]);
    $password = addslashes($_POST["password"]);
    $hasher = new PasswordHash(8, true);
Severity: Minor
Found in r8conf2016/login.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

print_login accesses the super-global variable $_GET.
Open

function print_login(){
    $error_message = "";
    if (!isset($_GET['continue'])) {
    }
    if(isset($_GET['continue'])){
Severity: Minor
Found in r8conf2016/login.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

print_login accesses the super-global variable $_SERVER.
Open

function print_login(){
    $error_message = "";
    if (!isset($_GET['continue'])) {
    }
    if(isset($_GET['continue'])){
Severity: Minor
Found in r8conf2016/login.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

print_login accesses the super-global variable $_SESSION.
Open

function print_login(){
    $error_message = "";
    if (!isset($_GET['continue'])) {
    }
    if(isset($_GET['continue'])){
Severity: Minor
Found in r8conf2016/login.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

print_login accesses the super-global variable $_GET.
Open

function print_login(){
    $error_message = "";
    if (!isset($_GET['continue'])) {
    }
    if(isset($_GET['continue'])){
Severity: Minor
Found in r8conf2016/login.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

process_login accesses the super-global variable $_SESSION.
Open

function process_login(){
    require_once ('../mysql_access.php');
    $email = addslashes($_POST["email"]);
    $password = addslashes($_POST["password"]);
    $hasher = new PasswordHash(8, true);
Severity: Minor
Found in r8conf2016/login.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

print_login accesses the super-global variable $_SESSION.
Open

function print_login(){
    $error_message = "";
    if (!isset($_GET['continue'])) {
    }
    if(isset($_GET['continue'])){
Severity: Minor
Found in r8conf2016/login.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

print_login accesses the super-global variable $_GET.
Open

function print_login(){
    $error_message = "";
    if (!isset($_GET['continue'])) {
    }
    if(isset($_GET['continue'])){
Severity: Minor
Found in r8conf2016/login.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

print_login accesses the super-global variable $_SESSION.
Open

function print_login(){
    $error_message = "";
    if (!isset($_GET['continue'])) {
    }
    if(isset($_GET['continue'])){
Severity: Minor
Found in r8conf2016/login.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

print_login accesses the super-global variable $_SESSION.
Open

function print_login(){
    $error_message = "";
    if (!isset($_GET['continue'])) {
    }
    if(isset($_GET['continue'])){
Severity: Minor
Found in r8conf2016/login.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

process_login accesses the super-global variable $_POST.
Open

function process_login(){
    require_once ('../mysql_access.php');
    $email = addslashes($_POST["email"]);
    $password = addslashes($_POST["password"]);
    $hasher = new PasswordHash(8, true);
Severity: Minor
Found in r8conf2016/login.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

logout accesses the super-global variable $_SESSION.
Open

function logout(){
    unset($_SESSION['sessionConfID']);
}
Severity: Minor
Found in r8conf2016/login.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

Method process_login has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function process_login(){
    require_once ('../mysql_access.php');
    $email = addslashes($_POST["email"]);
    $password = addslashes($_POST["password"]);
    $hasher = new PasswordHash(8, true);
Severity: Minor
Found in r8conf2016/login.php - About 1 hr to fix

    Function process_login has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    function process_login(){
        require_once ('../mysql_access.php');
        $email = addslashes($_POST["email"]);
        $password = addslashes($_POST["password"]);
        $hasher = new PasswordHash(8, true);
    Severity: Minor
    Found in r8conf2016/login.php - About 1 hr 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

    Method print_login has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function print_login(){
        $error_message = "";
        if (!isset($_GET['continue'])) {
        }
        if(isset($_GET['continue'])){
    Severity: Minor
    Found in r8conf2016/login.php - About 1 hr to fix

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

      function process_login(){
          require_once ('../mysql_access.php');
          $email = addslashes($_POST["email"]);
          $password = addslashes($_POST["password"]);
          $hasher = new PasswordHash(8, true);
      Severity: Minor
      Found in r8conf2016/login.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

              ($stmt = $db->prepare('select password from conf_contact_information where email=?'));
      Severity: Minor
      Found in r8conf2016/login.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

              if (!$stmt->fetch() && $db->errno);
      Severity: Minor
      Found in r8conf2016/login.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 '$id' which will lead to PHP notices.
      Open

          $_SESSION['sessionConfID'] = $id;
      Severity: Minor
      Found in r8conf2016/login.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

                  $query = $db->query($select) or die("Unable to get data. $db->error");
      Severity: Minor
      Found in r8conf2016/login.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

                  $query = $db->query($select) or die("Unable to get data. $db->error");
      Severity: Minor
      Found in r8conf2016/login.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 '$lastname' which will lead to PHP notices.
      Open

                  WHERE `lastname` = '".$lastname."'
      Severity: Minor
      Found in r8conf2016/login.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 '$firstname' which will lead to PHP notices.
      Open

                  AND `firstname` = '".$firstname."'
      Severity: Minor
      Found in r8conf2016/login.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

          $result = $db->query($sql);
      Severity: Minor
      Found in r8conf2016/login.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 '62', column '16').
      Open

          $hasher = new PasswordHash(8, true);
      Severity: Minor
      Found in r8conf2016/login.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 method process_login uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

          else {
              $r = NULL;
              $hash = '*'; // In case the user is not found
              ($stmt = $db->prepare('select password from conf_contact_information where email=?'));
              $stmt->bind_param('s', $email);
      Severity: Minor
      Found in r8conf2016/login.php by phpmd

      ElseExpression

      Since: 1.4.0

      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($flag) {
                  // one branch
              } else {
                  // another branch
              }
          }
      }

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

      The method process_login uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

          } else {
          extract($r);
      
          $_SESSION['sessionConfID'] = $id;
      
      
      Severity: Minor
      Found in r8conf2016/login.php by phpmd

      ElseExpression

      Since: 1.4.0

      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($flag) {
                  // one branch
              } else {
                  // another branch
              }
          }
      }

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

      The method process_login uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $what = 'Authentication failed.  Please try again.';
              }
      Severity: Minor
      Found in r8conf2016/login.php by phpmd

      ElseExpression

      Since: 1.4.0

      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($flag) {
                  // one branch
              } else {
                  // another branch
              }
          }
      }

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

      The function process_login() contains an exit expression.
      Open

                  $query = $db->query($select) or die("Unable to get data. $db->error");
      Severity: Minor
      Found in r8conf2016/login.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 '$lastname'.
      Open

                  WHERE `lastname` = '".$lastname."'
      Severity: Minor
      Found in r8conf2016/login.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 unused local variables such as '$error_message'.
      Open

          $error_message = "";
      Severity: Minor
      Found in r8conf2016/login.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 unused local variables such as '$firstname'.
      Open

                  AND `firstname` = '".$firstname."'
      Severity: Minor
      Found in r8conf2016/login.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 unused local variables such as '$id'.
      Open

          $_SESSION['sessionConfID'] = $id;
      Severity: Minor
      Found in r8conf2016/login.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 unused local variables such as '$result'.
      Open

          $result = $db->query($sql);
      Severity: Minor
      Found in r8conf2016/login.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 unused local variables such as '$continue'.
      Open

              $continue = isset($_SESSION['continue']) ? $_SESSION['continue'] : '';
      Severity: Minor
      Found in r8conf2016/login.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

      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 25 and the first side effect is on line 2.
      Open

      <?php
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          $_SESSION['sessionConfID'] = $id;
      Severity: Minor
      Found in r8conf2016/login.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 $r. Configured minimum length is 3.
      Open

              $r = NULL;
      Severity: Minor
      Found in r8conf2016/login.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 $op. Configured minimum length is 3.
      Open

          $op = $_POST['logstate'];
      Severity: Minor
      Found in r8conf2016/login.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

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

              $r = NULL;
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

      Blank line found at end of control structure
      Open

      
      
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          if ($op === 'new') {
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

              } else {
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          echo "$what\n";
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          extract($r);
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          $_SESSION['sessionConfID'] = $id;
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          if(isset($_GET['continue'])){
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

      Inline control structures are not allowed
      Open

          if (strlen($hash) < 20)
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

                  $stmt->close();
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

                  $select = "SELECT * FROM conf_contact_information WHERE email='$email'";
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

                  $r = $query->fetch_assoc();
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          if (!isset($_GET['continue'])) {
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          $result = $db->query($sql);
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          if (!isset($_SESSION['sessionConfID']) && isset($_POST['logstate']) && ($_POST['logstate'] == 'login')) {
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

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

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

              unset($hasher);
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

              ($stmt = $db->prepare('select password from conf_contact_information where email=?'));
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

              echo "<h3><a href='./logout.php' class='button expand'>Logout</a></h3>";
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          $password = addslashes($_POST["password"]);
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          //validate operation code
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          } else {
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          $what = 'User created';
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

                  $what = 'Authentication failed.  Please try again.';
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

              print_login(1);
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          $sql = "SELECT * FROM `conf_contact_information`
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          unset($_SESSION['sessionConfID']);
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

              print_login();
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

              if ($hasher->CheckPassword($password, $hash)) {
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

              echo "</div>";
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          require_once ('../mysql_access.php');
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          $error_message = "";
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          $email = addslashes($_POST["email"]);
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

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

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

          if ($op !== 'new' && $op !== 'login'){
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

              fail('Failed to hash new password');
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

              echo "<meta http-equiv='refresh' content='0;url=\"schedule.php\"'>";
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

              $stmt->execute();
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          }else {
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          echo(isset($_SESSION['continue']) ? $_SESSION['continue'] : '');
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          $op = $_POST['logstate'];
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          }else if (!isset($_SESSION['sessionConfID'])){
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

              echo "<div class='large-3 medium-3 small-12 large-centered medium-centered columns'>";
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

              session_register('continue');
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

              $_SESSION['continue'] = $_GET['continue'];}
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          else {
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

      Inline control structures are not allowed
      Open

              if (!$stmt->fetch() && $db->errno);
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

              process_login();
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          if (strlen($hash) < 20)
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          unset($hasher);
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

                  $query = $db->query($select) or die("Unable to get data. $db->error");
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

              $continue = isset($_SESSION['continue']) ? $_SESSION['continue'] : '';
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

              if (!$stmt->fetch() && $db->errno);
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

              $r = NULL;
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

              $hash = '*'; // In case the user is not found
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          if (!$r) {
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

              $stmt->bind_param('s', $email);
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

              $stmt->bind_result($hash);
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

                  $what = 'Authentication succeeded';
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

              fail('Unknown request');}
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

      Space before opening parenthesis of function call prohibited
      Open

          require_once ('../mysql_access.php');
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          if (strlen($hash) < 20)
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

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

      Space before opening parenthesis of function call prohibited
      Open

      require_once ('../PasswordHash.php');
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

      Expected 1 space after closing parenthesis; found 0
      Open

          if(isset($_GET['continue'])){
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          $_SESSION['sessionConfID'] = $id;
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

      Line indented incorrectly; expected 0 spaces, found 4
      Open

          if (!isset($_SESSION['sessionConfID']) && isset($_POST['logstate']) && ($_POST['logstate'] == 'login')) {
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

      Expected 1 space after closing brace; 0 found
      Open

          }else if (!isset($_SESSION['sessionConfID'])){
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

      Closing brace must be on a line by itself
      Open

              $_SESSION['continue'] = $_GET['continue'];}
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

      Closing brace must be on a line by itself
      Open

              fail('Unknown request');}
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          $what = 'User created';
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

      echo <<<END
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

      Expected 1 space after closing parenthesis; found 0
      Open

          if ($op !== 'new' && $op !== 'login'){
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

      Opening brace should be on a new line
      Open

      function print_login(){
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

      Opening brace should be on a new line
      Open

      function process_login(){
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

      Line indented incorrectly; expected 0 spaces, found 4
      Open

          }else {
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

      Expected 1 space after closing brace; 0 found
      Open

          }else {
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          $sql = "SELECT * FROM `conf_contact_information`
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

      Opening brace should be on a new line
      Open

      function logout(){
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

      Usage of ELSE IF is discouraged; use ELSEIF instead
      Open

          }else if (!isset($_SESSION['sessionConfID'])){
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

      Expected 1 space after closing parenthesis; found 0
      Open

          }else if (!isset($_SESSION['sessionConfID'])){
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

      Space before opening parenthesis of function call prohibited
      Open

      require_once ('session.php');
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

      Expected 1 space after IF keyword; 0 found
      Open

          if(isset($_GET['continue'])){
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          unset($hasher);
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

      Line indented incorrectly; expected 0 spaces, found 4
      Open

          }else if (!isset($_SESSION['sessionConfID'])){
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

      Line indented incorrectly; expected 0 spaces, found 4
      Open

          }
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

      Expected 1 space after closing brace; newline found
      Open

          }
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          extract($r);
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

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

          $result = $db->query($sql);
      Severity: Minor
      Found in r8conf2016/login.php by phpcodesniffer

      The variable $error_message is not named in camelCase.
      Open

      function print_login(){
          $error_message = "";
          if (!isset($_GET['continue'])) {
          }
          if(isset($_GET['continue'])){
      Severity: Minor
      Found in r8conf2016/login.php by phpmd

      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