APO-Epsilon/apo-website

View on GitHub
top_hours.php

Summary

Maintainability
A
1 hr
Test Coverage

Method top_hours has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function top_hours() {
  include ('mysql_access.php');
  global $current_semester;
  $sql = "SELECT contact_information.firstname, contact_information.lastname, SUM( hours ) AS  `sum_hours` FROM  `recorded_hours` ,  `contact_information` WHERE contact_information.id = recorded_hours.user_id AND `semester` = '$current_semester' GROUP BY (`user_id`) ORDER BY  `sum_hours` DESC LIMIT 10";
  $result = $db->query($sql);
Severity: Minor
Found in top_hours.php - About 1 hr to fix

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

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

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

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

        } else {
          $row_num = "class='row_2'";
        }
    Severity: Minor
    Found in top_hours.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 top_hours uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

        } else {
          $row_num = "class='row_2'";
        }
    Severity: Minor
    Found in top_hours.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

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

        $row_num = "";
    Severity: Minor
    Found in top_hours.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 '$db'.
    Open

      $result = $db->query($sql);
    Severity: Minor
    Found in top_hours.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 23 and the first side effect is on line 2.
    Open

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

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

      $i = 1;
    Severity: Minor
    Found in top_hours.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 $i. Configured minimum length is 3.
    Open

      $i = 1;
    Severity: Minor
    Found in top_hours.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

    Blank line found at end of control structure
    Open

    
    
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

    Line exceeds 120 characters; contains 150 characters
    Open

      <div style='display:inline-block; font-size: 30px; padding: 20px; width: 70px; text-align: right; font-family: Garalde; font-weight: bold;'>$i</div>
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

    Line exceeds 120 characters; contains 202 characters
    Open

      $sql2 = "SELECT `famflower`, COUNT(`lastname`) as 'members' FROM `contact_information` WHERE status = 'Active' OR status = 'Pledge' OR status = 'Elected' OR status = 'Appointed' GROUP BY `famflower`";
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

    Line exceeds 120 characters; contains 147 characters
    Open

      echo "<table cellpadding=0 cellspacing=0 class='hours'><tr class='header'><td><b>Family Hours</b></td><td><b>Hours</b></td><td><b>HPM*</b></tr>";
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

    Line exceeds 120 characters; contains 304 characters
    Open

      $sql = "SELECT contact_information.firstname, contact_information.lastname, SUM( hours ) AS  `sum_hours` FROM  `recorded_hours` ,  `contact_information` WHERE contact_information.id = recorded_hours.user_id AND `semester` = '$current_semester' GROUP BY (`user_id`) ORDER BY  `sum_hours` DESC LIMIT 10";
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

    Line exceeds 120 characters; contains 421 characters
    Open

      $sql = "SELECT SUM(`hours`) AS sum_hours, contact_information.famflower FROM `recorded_hours`, `contact_information` WHERE recorded_hours.user_id = contact_information.id AND `semester` = '$current_semester' AND (contact_information.status = 'Active' OR contact_information.status = 'Pledge' OR contact_information.status = 'Elected' OR contact_information.status = 'Appointed') GROUP BY contact_information.famflower";
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

    Line exceeds 120 characters; contains 123 characters
    Open

      <div class='info' style='display:inline-block; font-size: 30px; width: 300px; font-family: Garalde; padding-top: -20px;'>
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

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

        $hours_per_member = round($row['sum_hours'] / $fam_flower_array[$row['famflower']], 1);
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

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

        $fam_flower_array[$row['famflower']] = $row['members'];
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

    Expected 0 spaces after opening bracket; 1 found
    Open

        if ( ($i % 2) == 0) {
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

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

      top_hours();
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

    Expected 0 spaces after opening bracket; 1 found
    Open

        if ( ($i % 2) == 0) {
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

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

          $row_num = "class='row_1'";
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

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

        echo<<<END
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

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

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

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

      $sql2 = "SELECT `famflower`, COUNT(`lastname`) as 'members' FROM `contact_information` WHERE status = 'Active' OR status = 'Pledge' OR status = 'Elected' OR status = 'Appointed' GROUP BY `famflower`";
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

    Line indented incorrectly; expected 4 spaces, found 2
    Open

      while ($row = mysqli_fetch_array($result2)) {
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

    Expected 1 space after WHILE keyword; 0 found
    Open

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

    Line indented incorrectly; expected 4 spaces, found 2
    Open

      }
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

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

      echo "</table>";
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

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

      family_hours();
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

    Space before opening parenthesis of function call prohibited
    Open

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

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

      $i = 1;
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        if ( ($i % 2) == 0) {
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

    Line indented incorrectly; expected 0 spaces, found 2
    Open

      } else {
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        } else {
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

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

      $sql = "SELECT SUM(`hours`) AS sum_hours, contact_information.famflower FROM `recorded_hours`, `contact_information` WHERE recorded_hours.user_id = contact_information.id AND `semester` = '$current_semester' AND (contact_information.status = 'Active' OR contact_information.status = 'Pledge' OR contact_information.status = 'Elected' OR contact_information.status = 'Appointed') GROUP BY contact_information.famflower";
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

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

        $i += 1;
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        }
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

    Line indented incorrectly; expected 4 spaces, found 2
    Open

      }
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

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

      $result2 = $db->query($sql2);
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

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

      $fam_flower_array = array();
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

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

        echo "<tr $row_num><td><b>$row[famflower]</b></td><td>$row[sum_hours]</td><td>$hours_per_member</tr>\n";
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

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

      echo "<p><i>*HPM: Hours Per Member</i></p>";
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        if ( ($i % 2) == 0) {
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

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

        $i += 1;
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

    Opening brace should be on a new line
    Open

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

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

          $row_num = "class='row_1'";
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        } else {
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

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

      echo "<p>Total hours by Family Flower.</p>";
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

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

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

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

      $sql = "SELECT contact_information.firstname, contact_information.lastname, SUM( hours ) AS  `sum_hours` FROM  `recorded_hours` ,  `contact_information` WHERE contact_information.id = recorded_hours.user_id AND `semester` = '$current_semester' GROUP BY (`user_id`) ORDER BY  `sum_hours` DESC LIMIT 10";
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

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

          $row_num = "class='row_2'";
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

    Line indented incorrectly; expected 4 spaces, found 2
    Open

      }
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

    Line indented incorrectly; expected 8 spaces, found 4
    Open

        }
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

    Line indented incorrectly; expected 0 spaces, found 2
    Open

      }
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

    Space before opening parenthesis of function call prohibited
    Open

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

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

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

    Line indented incorrectly; expected 4 spaces, found 2
    Open

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

    Expected 1 space after WHILE keyword; 0 found
    Open

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

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

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

    Space before opening parenthesis of function call prohibited
    Open

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

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

        $row_num = "";
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

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

      echo "<table cellpadding=0 cellspacing=0 class='hours'><tr class='header'><td><b>Family Hours</b></td><td><b>Hours</b></td><td><b>HPM*</b></tr>";
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

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

        $row_num = "";
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

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

          $row_num = "class='row_2'";
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

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

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

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

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

    Line indented incorrectly; expected 4 spaces, found 2
    Open

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

    Opening brace should be on a new line
    Open

    function family_hours() {
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

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

      $i = 1;
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

    Closing brace indented incorrectly; expected 0 spaces, found 2
    Open

      } else {
    Severity: Minor
    Found in top_hours.php by phpcodesniffer

    Space before opening parenthesis of function call prohibited
    Open

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

    The variable $hours_per_member is not named in camelCase.
    Open

    function family_hours() {
      include ('mysql_access.php');
      global $current_semester;
      $sql = "SELECT SUM(`hours`) AS sum_hours, contact_information.famflower FROM `recorded_hours`, `contact_information` WHERE recorded_hours.user_id = contact_information.id AND `semester` = '$current_semester' AND (contact_information.status = 'Active' OR contact_information.status = 'Pledge' OR contact_information.status = 'Elected' OR contact_information.status = 'Appointed') GROUP BY contact_information.famflower";
      $result = $db->query($sql);
    Severity: Minor
    Found in top_hours.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 $row_num is not named in camelCase.
    Open

    function family_hours() {
      include ('mysql_access.php');
      global $current_semester;
      $sql = "SELECT SUM(`hours`) AS sum_hours, contact_information.famflower FROM `recorded_hours`, `contact_information` WHERE recorded_hours.user_id = contact_information.id AND `semester` = '$current_semester' AND (contact_information.status = 'Active' OR contact_information.status = 'Pledge' OR contact_information.status = 'Elected' OR contact_information.status = 'Appointed') GROUP BY contact_information.famflower";
      $result = $db->query($sql);
    Severity: Minor
    Found in top_hours.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 $row_num is not named in camelCase.
    Open

    function family_hours() {
      include ('mysql_access.php');
      global $current_semester;
      $sql = "SELECT SUM(`hours`) AS sum_hours, contact_information.famflower FROM `recorded_hours`, `contact_information` WHERE recorded_hours.user_id = contact_information.id AND `semester` = '$current_semester' AND (contact_information.status = 'Active' OR contact_information.status = 'Pledge' OR contact_information.status = 'Elected' OR contact_information.status = 'Appointed') GROUP BY contact_information.famflower";
      $result = $db->query($sql);
    Severity: Minor
    Found in top_hours.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 $row_num is not named in camelCase.
    Open

    function top_hours() {
      include ('mysql_access.php');
      global $current_semester;
      $sql = "SELECT contact_information.firstname, contact_information.lastname, SUM( hours ) AS  `sum_hours` FROM  `recorded_hours` ,  `contact_information` WHERE contact_information.id = recorded_hours.user_id AND `semester` = '$current_semester' GROUP BY (`user_id`) ORDER BY  `sum_hours` DESC LIMIT 10";
      $result = $db->query($sql);
    Severity: Minor
    Found in top_hours.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 $fam_flower_array is not named in camelCase.
    Open

    function family_hours() {
      include ('mysql_access.php');
      global $current_semester;
      $sql = "SELECT SUM(`hours`) AS sum_hours, contact_information.famflower FROM `recorded_hours`, `contact_information` WHERE recorded_hours.user_id = contact_information.id AND `semester` = '$current_semester' AND (contact_information.status = 'Active' OR contact_information.status = 'Pledge' OR contact_information.status = 'Elected' OR contact_information.status = 'Appointed') GROUP BY contact_information.famflower";
      $result = $db->query($sql);
    Severity: Minor
    Found in top_hours.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 $row_num is not named in camelCase.
    Open

    function top_hours() {
      include ('mysql_access.php');
      global $current_semester;
      $sql = "SELECT contact_information.firstname, contact_information.lastname, SUM( hours ) AS  `sum_hours` FROM  `recorded_hours` ,  `contact_information` WHERE contact_information.id = recorded_hours.user_id AND `semester` = '$current_semester' GROUP BY (`user_id`) ORDER BY  `sum_hours` DESC LIMIT 10";
      $result = $db->query($sql);
    Severity: Minor
    Found in top_hours.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 top_hours() {
      include ('mysql_access.php');
      global $current_semester;
      $sql = "SELECT contact_information.firstname, contact_information.lastname, SUM( hours ) AS  `sum_hours` FROM  `recorded_hours` ,  `contact_information` WHERE contact_information.id = recorded_hours.user_id AND `semester` = '$current_semester' GROUP BY (`user_id`) ORDER BY  `sum_hours` DESC LIMIT 10";
      $result = $db->query($sql);
    Severity: Minor
    Found in top_hours.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 top_hours() {
      include ('mysql_access.php');
      global $current_semester;
      $sql = "SELECT contact_information.firstname, contact_information.lastname, SUM( hours ) AS  `sum_hours` FROM  `recorded_hours` ,  `contact_information` WHERE contact_information.id = recorded_hours.user_id AND `semester` = '$current_semester' GROUP BY (`user_id`) ORDER BY  `sum_hours` DESC LIMIT 10";
      $result = $db->query($sql);
    Severity: Minor
    Found in top_hours.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 $fam_flower_array is not named in camelCase.
    Open

    function family_hours() {
      include ('mysql_access.php');
      global $current_semester;
      $sql = "SELECT SUM(`hours`) AS sum_hours, contact_information.famflower FROM `recorded_hours`, `contact_information` WHERE recorded_hours.user_id = contact_information.id AND `semester` = '$current_semester' AND (contact_information.status = 'Active' OR contact_information.status = 'Pledge' OR contact_information.status = 'Elected' OR contact_information.status = 'Appointed') GROUP BY contact_information.famflower";
      $result = $db->query($sql);
    Severity: Minor
    Found in top_hours.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 $row_num is not named in camelCase.
    Open

    function family_hours() {
      include ('mysql_access.php');
      global $current_semester;
      $sql = "SELECT SUM(`hours`) AS sum_hours, contact_information.famflower FROM `recorded_hours`, `contact_information` WHERE recorded_hours.user_id = contact_information.id AND `semester` = '$current_semester' AND (contact_information.status = 'Active' OR contact_information.status = 'Pledge' OR contact_information.status = 'Elected' OR contact_information.status = 'Appointed') GROUP BY contact_information.famflower";
      $result = $db->query($sql);
    Severity: Minor
    Found in top_hours.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 $fam_flower_array is not named in camelCase.
    Open

    function family_hours() {
      include ('mysql_access.php');
      global $current_semester;
      $sql = "SELECT SUM(`hours`) AS sum_hours, contact_information.famflower FROM `recorded_hours`, `contact_information` WHERE recorded_hours.user_id = contact_information.id AND `semester` = '$current_semester' AND (contact_information.status = 'Active' OR contact_information.status = 'Pledge' OR contact_information.status = 'Elected' OR contact_information.status = 'Appointed') GROUP BY contact_information.famflower";
      $result = $db->query($sql);
    Severity: Minor
    Found in top_hours.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 $hours_per_member is not named in camelCase.
    Open

    function family_hours() {
      include ('mysql_access.php');
      global $current_semester;
      $sql = "SELECT SUM(`hours`) AS sum_hours, contact_information.famflower FROM `recorded_hours`, `contact_information` WHERE recorded_hours.user_id = contact_information.id AND `semester` = '$current_semester' AND (contact_information.status = 'Active' OR contact_information.status = 'Pledge' OR contact_information.status = 'Elected' OR contact_information.status = 'Appointed') GROUP BY contact_information.famflower";
      $result = $db->query($sql);
    Severity: Minor
    Found in top_hours.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 $row_num is not named in camelCase.
    Open

    function top_hours() {
      include ('mysql_access.php');
      global $current_semester;
      $sql = "SELECT contact_information.firstname, contact_information.lastname, SUM( hours ) AS  `sum_hours` FROM  `recorded_hours` ,  `contact_information` WHERE contact_information.id = recorded_hours.user_id AND `semester` = '$current_semester' GROUP BY (`user_id`) ORDER BY  `sum_hours` DESC LIMIT 10";
      $result = $db->query($sql);
    Severity: Minor
    Found in top_hours.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 family_hours() {
      include ('mysql_access.php');
      global $current_semester;
      $sql = "SELECT SUM(`hours`) AS sum_hours, contact_information.famflower FROM `recorded_hours`, `contact_information` WHERE recorded_hours.user_id = contact_information.id AND `semester` = '$current_semester' AND (contact_information.status = 'Active' OR contact_information.status = 'Pledge' OR contact_information.status = 'Elected' OR contact_information.status = 'Appointed') GROUP BY contact_information.famflower";
      $result = $db->query($sql);
    Severity: Minor
    Found in top_hours.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 family_hours() {
      include ('mysql_access.php');
      global $current_semester;
      $sql = "SELECT SUM(`hours`) AS sum_hours, contact_information.famflower FROM `recorded_hours`, `contact_information` WHERE recorded_hours.user_id = contact_information.id AND `semester` = '$current_semester' AND (contact_information.status = 'Active' OR contact_information.status = 'Pledge' OR contact_information.status = 'Elected' OR contact_information.status = 'Appointed') GROUP BY contact_information.famflower";
      $result = $db->query($sql);
    Severity: Minor
    Found in top_hours.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 $row_num is not named in camelCase.
    Open

    function family_hours() {
      include ('mysql_access.php');
      global $current_semester;
      $sql = "SELECT SUM(`hours`) AS sum_hours, contact_information.famflower FROM `recorded_hours`, `contact_information` WHERE recorded_hours.user_id = contact_information.id AND `semester` = '$current_semester' AND (contact_information.status = 'Active' OR contact_information.status = 'Pledge' OR contact_information.status = 'Elected' OR contact_information.status = 'Appointed') GROUP BY contact_information.famflower";
      $result = $db->query($sql);
    Severity: Minor
    Found in top_hours.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