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);
Avoid using undefined variables such as '$db' which will lead to PHP notices. Open
$result = $db->query($sql);
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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'";
}
- Read upRead up
- Exclude checks
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'";
}
- Read upRead up
- Exclude checks
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 = "";
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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
- Exclude checks
Avoid variables with short names like $i. Configured minimum length is 3. Open
$i = 1;
- Read upRead up
- Exclude checks
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;
- Read upRead up
- Exclude checks
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
- Exclude checks
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>
- Exclude checks
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`";
- Exclude checks
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>";
- Exclude checks
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";
- Exclude checks
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";
- Exclude checks
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;'>
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$hours_per_member = round($row['sum_hours'] / $fam_flower_array[$row['famflower']], 1);
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$fam_flower_array[$row['famflower']] = $row['members'];
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
if ( ($i % 2) == 0) {
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
top_hours();
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
if ( ($i % 2) == 0) {
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 6 Open
$row_num = "class='row_1'";
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
echo<<<END
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
include ('mysql_access.php');
- Exclude checks
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`";
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
while ($row = mysqli_fetch_array($result2)) {
- Exclude checks
Expected 1 space after WHILE keyword; 0 found Open
while($row = mysqli_fetch_array($result)) {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
}
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
echo "</table>";
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
family_hours();
- Exclude checks
Space before opening parenthesis of function call prohibited Open
include ('mysql_access.php');
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
$i = 1;
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
if ( ($i % 2) == 0) {
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 2 Open
} else {
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
} else {
- Exclude checks
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";
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$i += 1;
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
}
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
}
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
$result2 = $db->query($sql2);
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
$fam_flower_array = array();
- Exclude checks
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";
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
echo "<p><i>*HPM: Hours Per Member</i></p>";
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
if ( ($i % 2) == 0) {
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$i += 1;
- Exclude checks
Opening brace should be on a new line Open
function top_hours() {
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 6 Open
$row_num = "class='row_1'";
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
} else {
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
echo "<p>Total hours by Family Flower.</p>";
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
include ('mysql_access.php');
- Exclude checks
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";
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 6 Open
$row_num = "class='row_2'";
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
}
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
}
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 2 Open
}
- Exclude checks
Space before opening parenthesis of function call prohibited Open
require_once ('session.php');
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
global $current_semester;
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
while($row = mysqli_fetch_array($result)) {
- Exclude checks
Expected 1 space after WHILE keyword; 0 found Open
while($row = mysqli_fetch_array($result)) {
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
$result = $db->query($sql);
- Exclude checks
Space before opening parenthesis of function call prohibited Open
require_once ('mysql_access.php');
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$row_num = "";
- Exclude checks
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>";
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$row_num = "";
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 6 Open
$row_num = "class='row_2'";
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
$result = $db->query($sql);
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
global $current_semester;
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
while($row = mysqli_fetch_array($result)) {
- Exclude checks
Opening brace should be on a new line Open
function family_hours() {
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
$i = 1;
- Exclude checks
Closing brace indented incorrectly; expected 0 spaces, found 2 Open
} else {
- Exclude checks
Space before opening parenthesis of function call prohibited Open
include ('mysql_access.php');
- Exclude checks
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);
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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();
}
}