APO-Epsilon/apo-website

View on GitHub
service_hours_logger.php

Summary

Maintainability
A
3 hrs
Test Coverage

Method recorded_hours has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function recorded_hours(){
  include('mysql_access.php');
  global $current_semester;
  //this is shit code. could be written in OOP.
  // not shit code INVENTIVE code.
Severity: Minor
Found in service_hours_logger.php - About 2 hrs to fix

    Function recorded_hours has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    function recorded_hours(){
      include('mysql_access.php');
      global $current_semester;
      //this is shit code. could be written in OOP.
      // not shit code INVENTIVE code.
    Severity: Minor
    Found in service_hours_logger.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

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

        $toProcessLen[] = $length;
    Severity: Minor
    Found in service_hours_logger.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 '$toProcessUID' which will lead to PHP notices.
    Open

        $toProcessUID[] = $user_id;
    Severity: Minor
    Found in service_hours_logger.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 '$toProcessOID' which will lead to PHP notices.
    Open

      $size = count($toProcessOID);
    Severity: Minor
    Found in service_hours_logger.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 '$toProcessOID' which will lead to PHP notices.
    Open

      $size = count($toProcessOID);
    Severity: Minor
    Found in service_hours_logger.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 '$toProcessDID' which will lead to PHP notices.
    Open

            WHERE d.detail_id = ".$toProcessDID[$i];
    Severity: Minor
    Found in service_hours_logger.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 '$toProcessOID' which will lead to PHP notices.
    Open

      $size = count($toProcessOID);
    Severity: Minor
    Found in service_hours_logger.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 '$toProcessUID' which will lead to PHP notices.
    Open

        $sql = "UPDATE service_attendance SET processed = 2 WHERE user_id = ".$toProcessUID[$i]." AND occurrence_id = ".$toProcessOID[$i];
    Severity: Minor
    Found in service_hours_logger.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 '$month' which will lead to PHP notices.
    Open

            VALUES (".$toProcessUID[$i].",".$month[$i].",".$day[$i].",".$year[$i].",'".$theDate[$i]."','".$current_semester."','auto-logged item #".$toProcessOID[$i]."',".$toProcessLen[$i].",
    Severity: Minor
    Found in service_hours_logger.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 '$theDate' which will lead to PHP notices.
    Open

            VALUES (".$toProcessUID[$i].",".$month[$i].",".$day[$i].",".$year[$i].",'".$theDate[$i]."','".$current_semester."','auto-logged item #".$toProcessOID[$i]."',".$toProcessLen[$i].",
    Severity: Minor
    Found in service_hours_logger.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 '$name' which will lead to PHP notices.
    Open

          $name[] = $r['name'];
    Severity: Minor
    Found in service_hours_logger.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 '$day' which will lead to PHP notices.
    Open

            VALUES (".$toProcessUID[$i].",".$month[$i].",".$day[$i].",".$year[$i].",'".$theDate[$i]."','".$current_semester."','auto-logged item #".$toProcessOID[$i]."',".$toProcessLen[$i].",
    Severity: Minor
    Found in service_hours_logger.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 service_hours_logger.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($sql1);
    Severity: Minor
    Found in service_hours_logger.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 '$theDate' which will lead to PHP notices.
    Open

          $theDate[] = $r['theDate'];
    Severity: Minor
    Found in service_hours_logger.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 '$servicetype' which will lead to PHP notices.
    Open

            '".$servicetype[$i]."','".$name[$i]."')";
    Severity: Minor
    Found in service_hours_logger.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 '$toProcessOID' which will lead to PHP notices.
    Open

        $toProcessOID[] = $occurrence_id;
    Severity: Minor
    Found in service_hours_logger.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 '$toProcessOID' which will lead to PHP notices.
    Open

        $sql = "SELECT theDate FROM service_occurrence WHERE occurrence_id = ".$toProcessOID[$i];
    Severity: Minor
    Found in service_hours_logger.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 '$year' which will lead to PHP notices.
    Open

            VALUES (".$toProcessUID[$i].",".$month[$i].",".$day[$i].",".$year[$i].",'".$theDate[$i]."','".$current_semester."','auto-logged item #".$toProcessOID[$i]."',".$toProcessLen[$i].",
    Severity: Minor
    Found in service_hours_logger.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 '$toProcessOID' which will lead to PHP notices.
    Open

            VALUES (".$toProcessUID[$i].",".$month[$i].",".$day[$i].",".$year[$i].",'".$theDate[$i]."','".$current_semester."','auto-logged item #".$toProcessOID[$i]."',".$toProcessLen[$i].",
    Severity: Minor
    Found in service_hours_logger.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 '$toProcessUID' which will lead to PHP notices.
    Open

            VALUES (".$toProcessUID[$i].",".$month[$i].",".$day[$i].",".$year[$i].",'".$theDate[$i]."','".$current_semester."','auto-logged item #".$toProcessOID[$i]."',".$toProcessLen[$i].",
    Severity: Minor
    Found in service_hours_logger.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 service_hours_logger.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 '$toProcessLen' which will lead to PHP notices.
    Open

            VALUES (".$toProcessUID[$i].",".$month[$i].",".$day[$i].",".$year[$i].",'".$theDate[$i]."','".$current_semester."','auto-logged item #".$toProcessOID[$i]."',".$toProcessLen[$i].",
    Severity: Minor
    Found in service_hours_logger.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 '$day' which will lead to PHP notices.
    Open

          $day[] = substr($r['theDate'],-2);
    Severity: Minor
    Found in service_hours_logger.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 '$servicetype' which will lead to PHP notices.
    Open

          $servicetype[] = $r['servicetype'];
    Severity: Minor
    Found in service_hours_logger.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 '$name' which will lead to PHP notices.
    Open

            '".$servicetype[$i]."','".$name[$i]."')";
    Severity: Minor
    Found in service_hours_logger.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 service_hours_logger.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 '$toProcessOID' which will lead to PHP notices.
    Open

        $sql = "UPDATE service_attendance SET processed = 2 WHERE user_id = ".$toProcessUID[$i]." AND occurrence_id = ".$toProcessOID[$i];
    Severity: Minor
    Found in service_hours_logger.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 service_hours_logger.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 '$month' which will lead to PHP notices.
    Open

          $month[] = substr($r['theDate'],-5,2);
    Severity: Minor
    Found in service_hours_logger.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 '$toProcessDID' which will lead to PHP notices.
    Open

        $toProcessDID[] = $detail_id;
    Severity: Minor
    Found in service_hours_logger.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 '$year' which will lead to PHP notices.
    Open

          $year[] = substr($r['theDate'],0,4);
    Severity: Minor
    Found in service_hours_logger.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

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

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

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

      while($r = mysqli_fetch_array($result)){
    Severity: Minor
    Found in service_hours_logger.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

    Line exceeds 120 characters; contains 134 characters
    Open

        $sql = "UPDATE service_attendance SET processed = 2 WHERE user_id = ".$toProcessUID[$i]." AND occurrence_id = ".$toProcessOID[$i];
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    Line exceeds 120 characters; contains 123 characters
    Open

        $sql1 = "INSERT INTO recorded_hours (user_id, month, day, year, date, semester, description, hours, servicetype, event)
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    Line exceeds 120 characters; contains 187 characters
    Open

            VALUES (".$toProcessUID[$i].",".$month[$i].",".$day[$i].",".$year[$i].",'".$theDate[$i]."','".$current_semester."','auto-logged item #".$toProcessOID[$i]."',".$toProcessLen[$i].",
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    Space before opening parenthesis of function call prohibited
    Open

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

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

        $length = $r['length'];
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    Opening brace should be on a new line
    Open

    function recorded_hours(){
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    Expected 1 space after WHILE keyword; 0 found
    Open

      while($r = mysqli_fetch_array($result)){
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

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

        $occurrence_id = $r['occurrence_id'];
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

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

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

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

      $sql = "SELECT user_id, detail_id, occurrence_id, length FROM service_attendance WHERE processed = 1";
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

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

      global $current_semester;
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

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

        $toProcessOID[] = $occurrence_id;
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

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

        $toProcessLen[] = $length;
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    Expected 1 space after closing parenthesis; found 0
    Open

      while($r = mysqli_fetch_array($result)){
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

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

      $size = count($toProcessOID);
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

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

        $toProcessDID[] = $detail_id;
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    Line indented incorrectly; expected 4 spaces, found 2
    Open

      }
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

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

        $detail_id = $r['detail_id'];
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

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

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

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

        $toProcessUID[] = $user_id;
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    Space before opening parenthesis of function call prohibited
    Open

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

    Expected 1 space after FOR keyword; 0 found
    Open

      for($i = 0; $i < $size; $i++){
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    Line indented incorrectly; expected 4 spaces, found 2
    Open

      while($r = mysqli_fetch_array($result)){
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

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

        $user_id = $r['user_id'];
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    Line indented incorrectly; expected 4 spaces, found 2
    Open

      for($i = 0; $i < $size; $i++){
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

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

        $sql = "SELECT theDate FROM service_occurrence WHERE occurrence_id = ".$toProcessOID[$i];
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        }
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    Expected 1 space after closing parenthesis; found 0
    Open

      for($i = 0; $i < $size; $i++){
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

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

          $theDate[] = $r['theDate'];
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    Expected 1 space after FOR keyword; 0 found
    Open

      for($i = 0; $i < $size; $i++){
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

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

          $day[] = substr($r['theDate'],-2);
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    No space found after comma in function call
    Open

          $day[] = substr($r['theDate'],-2);
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    Line indented incorrectly; expected 4 spaces, found 2
    Open

      for($i = 0; $i < $size; $i++){
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    No space found after comma in function call
    Open

          $month[] = substr($r['theDate'],-5,2);
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    No space found after comma in function call
    Open

          $year[] = substr($r['theDate'],0,4);
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    Expected 1 space after closing parenthesis; found 0
    Open

      for($i = 0; $i < $size; $i++){
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

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

        $sql = "SELECT d.length, e.name, e.servicetype
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        }
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    Line indented incorrectly; expected 4 spaces, found 2
    Open

      }
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

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

    Expected 1 space after WHILE keyword; 0 found
    Open

        while($r = mysqli_fetch_array($result)){
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    Expected 1 space after closing parenthesis; found 0
    Open

        while($r = mysqli_fetch_array($result)){
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

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

          echo("something went wrong, contact the webmaster");
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        while($r = mysqli_fetch_array($result)){
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    No space found after comma in function call
    Open

          $year[] = substr($r['theDate'],0,4);
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

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

          $name[] = $r['name'];
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

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

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

    Line indented incorrectly; expected 4 spaces, found 2
    Open

      }
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    Expected 1 space after IF keyword; 0 found
    Open

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

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

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

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

          $month[] = substr($r['theDate'],-5,2);
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

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

          $year[] = substr($r['theDate'],0,4);
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    Expected 1 space after closing parenthesis; found 0
    Open

      for($i = 0; $i < $size; $i++){
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

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

          $servicetype[] = $r['servicetype'];
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

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

        $sql = "UPDATE service_attendance SET processed = 2 WHERE user_id = ".$toProcessUID[$i]." AND occurrence_id = ".$toProcessOID[$i];
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    Expected 1 space after closing parenthesis; found 0
    Open

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

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

      $size = count($toProcessOID);
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    Expected 1 space after closing parenthesis; found 0
    Open

        while($r = mysqli_fetch_array($result)){
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    Line indented incorrectly; expected 4 spaces, found 2
    Open

      for($i = 0; $i < $size; $i++){
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    No space found after comma in function call
    Open

          $month[] = substr($r['theDate'],-5,2);
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

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

      $size = count($toProcessOID);
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

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

        $sql1 = "INSERT INTO recorded_hours (user_id, month, day, year, date, semester, description, hours, servicetype, event)
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

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

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

    Expected 1 space after FOR keyword; 0 found
    Open

      for($i = 0; $i < $size; $i++){
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        while($r = mysqli_fetch_array($result)){
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        }
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    Line indented incorrectly; expected 4 spaces, found 2
    Open

      }
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

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

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

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

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

    Expected 1 space after WHILE keyword; 0 found
    Open

        while($r = mysqli_fetch_array($result)){
    Severity: Minor
    Found in service_hours_logger.php by phpcodesniffer

    The variable $user_id is not named in camelCase.
    Open

    function recorded_hours(){
      include('mysql_access.php');
      global $current_semester;
      //this is shit code. could be written in OOP.
      // not shit code INVENTIVE code.
    Severity: Minor
    Found in service_hours_logger.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

    The variable $occurrence_id is not named in camelCase.
    Open

    function recorded_hours(){
      include('mysql_access.php');
      global $current_semester;
      //this is shit code. could be written in OOP.
      // not shit code INVENTIVE code.
    Severity: Minor
    Found in service_hours_logger.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

    The variable $user_id is not named in camelCase.
    Open

    function recorded_hours(){
      include('mysql_access.php');
      global $current_semester;
      //this is shit code. could be written in OOP.
      // not shit code INVENTIVE code.
    Severity: Minor
    Found in service_hours_logger.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

    The variable $occurrence_id is not named in camelCase.
    Open

    function recorded_hours(){
      include('mysql_access.php');
      global $current_semester;
      //this is shit code. could be written in OOP.
      // not shit code INVENTIVE code.
    Severity: Minor
    Found in service_hours_logger.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

    The variable $current_semester is not named in camelCase.
    Open

    function recorded_hours(){
      include('mysql_access.php');
      global $current_semester;
      //this is shit code. could be written in OOP.
      // not shit code INVENTIVE code.
    Severity: Minor
    Found in service_hours_logger.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

    The variable $detail_id is not named in camelCase.
    Open

    function recorded_hours(){
      include('mysql_access.php');
      global $current_semester;
      //this is shit code. could be written in OOP.
      // not shit code INVENTIVE code.
    Severity: Minor
    Found in service_hours_logger.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

    The variable $current_semester is not named in camelCase.
    Open

    function recorded_hours(){
      include('mysql_access.php');
      global $current_semester;
      //this is shit code. could be written in OOP.
      // not shit code INVENTIVE code.
    Severity: Minor
    Found in service_hours_logger.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

    The variable $detail_id is not named in camelCase.
    Open

    function recorded_hours(){
      include('mysql_access.php');
      global $current_semester;
      //this is shit code. could be written in OOP.
      // not shit code INVENTIVE code.
    Severity: Minor
    Found in service_hours_logger.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