show_active accesses the super-global variable $_SESSION. Open
function show_active() {
include('mysql_access.php');
global $current_semester;
$user_id = $_SESSION['sessionID'];
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
Function show_active
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
function show_active() {
include('mysql_access.php');
global $current_semester;
$user_id = $_SESSION['sessionID'];
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method show_active
has 147 lines of code (exceeds 25 allowed). Consider refactoring. Open
function show_active() {
include('mysql_access.php');
global $current_semester;
$user_id = $_SESSION['sessionID'];
The function show_active() has an NPath complexity of 776. The configured NPath complexity threshold is 200. Open
function show_active() {
include('mysql_access.php');
global $current_semester;
$user_id = $_SESSION['sessionID'];
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The function show_active() has 195 lines of code. Current threshold is set to 100. Avoid really long methods. Open
function show_active() {
include('mysql_access.php');
global $current_semester;
$user_id = $_SESSION['sessionID'];
- Exclude checks
The function show_active() has a Cyclomatic Complexity of 15. The configured cyclomatic complexity threshold is 10. Open
function show_active() {
include('mysql_access.php');
global $current_semester;
$user_id = $_SESSION['sessionID'];
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
Avoid using undefined variables such as '$db' which will lead to PHP notices. Open
$results=$db->query($query);
- 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
$wresponse=$db->query(" SELECT sum(l_val)
- 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
$theresponse=$db->query("SELECT event_name,event_id FROM events_listing WHERE required=1");
- 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
$wresponse=$db->query(" SELECT sum(hours)
- 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
$wresponse=$db->query(" SELECT sum(hours)
- 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
$wresponse=$db->query(" SELECT count(event_id)
- 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
$wresponse=$db->query(" SELECT count(events_listing.event_id)
- 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
$response=$db->query("SELECT id,firstname,lastname,email FROM contact_information WHERE status = 'Associate'");
- 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
$response=$db->query("SELECT id,firstname,lastname,email FROM contact_information WHERE status = 'Senior'");
- 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
$wresponse=$db->query(" SELECT sum(f_val)
- 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
$response=$db->query("SELECT id,firstname,lastname,email FROM contact_information WHERE status = 'Active' OR status = 'Elected' OR status = 'Appointed'");
- 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 show_active uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
{
$u++;
}
- 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 '$db'. Open
$results=$db->query($query);
- 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 27 and the first side effect is on line 2. Open
<?php
- Exclude checks
Avoid variables with short names like $id. Configured minimum length is 3. Open
function id_to_position ($id)
- 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 $f. Configured minimum length is 3. Open
$f = $wres['sum(f_val)'];
- 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 $s. Configured minimum length is 3. Open
$s = $wres['sum(hours)'];
- 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 $l. Configured minimum length is 3. Open
$l = $wres['sum(l_val)'];
- 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 $id. Configured minimum length is 3. Open
$id = $result['id'];
- 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 $u. Configured minimum length is 3. Open
$u = 0;
- 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 $c. Configured minimum length is 3. Open
$c = $wres['count(events_listing.event_id)'];
- 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 $e. Configured minimum length is 3. Open
$e = $wres['count(event_id)'];
- 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
Spaces must be used for alignment; tabs are not allowed Open
$user_id = $_SESSION['sessionID'];
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$position = id_to_position($user_id);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
<h1>Active Brothers</h1>
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$id = $result['id'];
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
<?php
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$email = $result['email'];
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$wres=mysqli_fetch_array($wresponse);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if ($s == null)
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$c = $wres['count(events_listing.event_id)'];
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$wresponse=$db->query(" SELECT count(events_listing.event_id)
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$c = 0;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$e = $wres['count(event_id)'];
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if ($e == null)
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "false" but found "False" Open
$exec_page = False;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
<h1>Associate Brothers</h1>
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
//how many hours in current semester?
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$e = 0;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$s = $wres['sum(hours)'];
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$query = "SELECT $operand FROM contact_information WHERE $condition = '$value'";
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
<?php
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$final=mysqli_fetch_array($results);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
?>
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
//how many f in current semester?
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
<tr><th>ID</th><th>Name</th><th>Email</th></tr>
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$s = $wres['sum(hours)'];
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
//get a list of all senior brother
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$wres=mysqli_fetch_array($wresponse);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
</table>
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
?>
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if ($s == null)
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
include('mysql_access.php');
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if ($l == null)
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$f = $wres['sum(f_val)'];
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
<?php
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$response=$db->query("SELECT id,firstname,lastname,email FROM contact_information WHERE status = 'Senior'");
- Exclude checks
Blank line found at end of control structure Open
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
function id_to_position ($id)
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$operand = 'position';
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
<table>
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$wres=mysqli_fetch_array($wresponse);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$l = $wres['sum(l_val)'];
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$l = 0;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$u = 0;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
//check if attended
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
<tr><th>ID</th><th>Name</th><th>Email</th><th>Hours</th></tr>
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$id = $result['id'];
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
//third: status senior
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
while($result=mysqli_fetch_array($response))
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$results->free();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
echo "<tr><td>$id</td><td>$name</td><td>$email</td>";
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
//how many committee events?
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$response=$db->query("SELECT id,firstname,lastname,email FROM contact_information WHERE status = 'Associate'");
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
<?php
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$email = $result['email'];
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
return $final[$operand];
- Exclude checks
Expected 0 spaces before opening parenthesis; 1 found Open
function id_to_position ($id)
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$response=$db->query("SELECT id,firstname,lastname,email FROM contact_information WHERE status = 'Active' OR status = 'Elected' OR status = 'Appointed'");
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
//general info
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$wresponse=$db->query(" SELECT sum(l_val)
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$f = 0;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$s = 0;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$wresponse=$db->query(" SELECT count(event_id)
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
else if ( is_user_excused($id,$reqevent['event_id']) )
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "true" but found "True" Open
$active_page = True;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$position = select($operand, $condition, $id);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if ($position == "Webmaster" || $position == "Recording Secretary") {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
//give a table of all normal members
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
include('retrieve_event.php');
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$name = $result['firstname'] . " " . $result['lastname'];
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
//hours and points
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$wresponse=$db->query(" SELECT sum(hours)
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
else if ( is_user_excused($id,$reqevent['event_id']) )
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$u++;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
?>
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
<?php
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$response=$db->query("SELECT id,firstname,lastname,email FROM contact_information WHERE status = 'Associate'");
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
while($result=mysqli_fetch_array($response))
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$id = $result['id'];
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
?>
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
<table>
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
<?php
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$wresponse=$db->query(" SELECT sum(f_val)
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$theresponse=$db->query("SELECT event_name,event_id FROM events_listing WHERE required=1");
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
//get a list of all associate brother
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
echo "<tr><td>$id</td><td>$name</td><td>$email</td><td>$s</td></tr>";
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "false" but found "False" Open
$public_page = False;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Expected "function abc(...)"; found "function abc (...)" Open
function id_to_position ($id)
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
return $position;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
<tr><th>ID</th><th>Name</th><th>Email</th><th>Leadership</th><th>Friendship</th><th>Service</th><th>Committee</th><th>Excused</th><th>Unexcused</th></tr>
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if ($f == null)
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if ( did_user_attend($id,$reqevent['event_id']) )
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if ( did_user_attend($id,$reqevent['event_id']) )
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
echo "<td>$l</td><td>$f</td><td>$s</td><td>$c</td><td>$e</td><td>$u</td></tr>";
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
<?php
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
?>
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
</table>
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
function select($operand, $condition, $value)
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Blank line found at start of control structure Open
if ($position == "Webmaster" || $position == "Recording Secretary") {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
//first: status active/elected/appointed
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
//get a list of all active brother
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$response=$db->query("SELECT id,firstname,lastname,email FROM contact_information WHERE status = 'Active' OR status = 'Elected' OR status = 'Appointed'");
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
while($result=mysqli_fetch_array($response))
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
//how many l in current semester?
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$wres=mysqli_fetch_array($wresponse);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
//how many unexcused?
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
while($reqevent=mysqli_fetch_array($theresponse))
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
//else unexcused
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
//second: status associate
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
//how many excused?
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$email = $result['email'];
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$s = 0;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
?>
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$name = $result['firstname'] . " " . $result['lastname'];
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
<table>
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$name = $result['firstname'] . " " . $result['lastname'];
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$wresponse=$db->query(" SELECT sum(hours)
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$wres=mysqli_fetch_array($wresponse);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
<h1>Senior Brothers</h1>
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$response=$db->query("SELECT id,firstname,lastname,email FROM contact_information WHERE status = 'Senior'");
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$results=$db->query($query);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$wres=mysqli_fetch_array($wresponse);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if ($c == null)
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
</table>
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$condition = 'id';
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
//how many hours in current semester?
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
//need to check each event
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
//check if excused
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
else
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
echo "<tr><td>$id</td><td>$name</td><td>$email</td></tr>";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$user_id = $_SESSION['sessionID'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
global $current_semester;
- Exclude checks
End of line character is invalid; expected "\n" but found "\r\n" Open
<?php
- Exclude checks
Line exceeds 120 characters; contains 165 characters Open
WHERE events_signup.user_id = $id AND events_signup.semester = '$current_semester' AND events_listing.event_type = 'Taskforce'");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
include('mysql_access.php');
- Exclude checks
Line exceeds 120 characters; contains 168 characters Open
$response=$db->query("SELECT id,firstname,lastname,email FROM contact_information WHERE status = 'Active' OR status = 'Elected' OR status = 'Appointed'");
- Exclude checks
Line exceeds 120 characters; contains 121 characters Open
WHERE events_signup.user_id = $id AND events_signup.semester = '$current_semester'");
- Exclude checks
Line exceeds 120 characters; contains 124 characters Open
$response=$db->query("SELECT id,firstname,lastname,email FROM contact_information WHERE status = 'Senior'");
- Exclude checks
Line exceeds 120 characters; contains 121 characters Open
WHERE events_signup.user_id = $id AND events_signup.semester = '$current_semester'");
- Exclude checks
Line exceeds 120 characters; contains 124 characters Open
$response=$db->query("SELECT id,firstname,lastname,email FROM contact_information WHERE status = 'Associate'");
- Exclude checks
Line exceeds 120 characters; contains 161 characters Open
<tr><th>ID</th><th>Name</th><th>Email</th><th>Leadership</th><th>Friendship</th><th>Service</th><th>Committee</th><th>Excused</th><th>Unexcused</th></tr>
- Exclude checks
Expected 1 space after WHILE keyword; 0 found Open
while($result=mysqli_fetch_array($response))
- Exclude checks
Line indented incorrectly; expected 16 spaces, found 12 Open
else
- Exclude checks
Expected 1 space after ELSE keyword; newline found Open
else
- Exclude checks
Opening brace should be on a new line Open
function show_active() {
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 8 Open
{
- Exclude checks
No space found after comma in function call Open
if ( did_user_attend($id,$reqevent['event_id']) )
- Exclude checks
Usage of ELSE IF is discouraged; use ELSEIF instead Open
else if ( is_user_excused($id,$reqevent['event_id']) )
- Exclude checks
Whitespace found at end of line Open
$response=$db->query("SELECT id,firstname,lastname,email FROM contact_information WHERE status = 'Associate'");
- Exclude checks
Expected 1 space after closing parenthesis; found 14 Open
if ( did_user_attend($id,$reqevent['event_id']) )
- Exclude checks
Line indented incorrectly; expected 16 spaces, found 12 Open
}
- Exclude checks
Expected 1 space after closing parenthesis; found 14 Open
if ($f == null)
- Exclude checks
Whitespace found at end of line Open
}
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 8 Open
$u = 0;
- Exclude checks
Line indented incorrectly; expected 16 spaces, found 12 Open
else if ( is_user_excused($id,$reqevent['event_id']) )
- Exclude checks
Whitespace found at end of line Open
$response=$db->query("SELECT id,firstname,lastname,email FROM contact_information WHERE status = 'Senior'");
- Exclude checks
Expected 1 space after closing parenthesis; found 14 Open
if ($s == null)
- Exclude checks
Space before opening parenthesis of function call prohibited Open
require_once ('mysql_access.php');
- Exclude checks
Expected 1 space after closing parenthesis; found 14 Open
if ($s == null)
- Exclude checks
Expected 1 space after closing parenthesis; found 14 Open
if ($e == null)
- Exclude checks
Expected 1 space after closing parenthesis; found 10 Open
while($reqevent=mysqli_fetch_array($theresponse))
- Exclude checks
Whitespace found at end of line Open
<?php
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 12 Open
{
- Exclude checks
No space found after comma in function call Open
else if ( is_user_excused($id,$reqevent['event_id']) )
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
if ( did_user_attend($id,$reqevent['event_id']) )
- Exclude checks
Expected 1 space after closing brace; newline found Open
}
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
else if ( is_user_excused($id,$reqevent['event_id']) )
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 8 Open
}
- Exclude checks
Whitespace found at end of line Open
<?php
- Exclude checks
Expected 1 space after WHILE keyword; 0 found Open
while($result=mysqli_fetch_array($response))
- Exclude checks
Expected 1 space after closing parenthesis; found 14 Open
if ($c == null)
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 12 Open
{
- Exclude checks
Line indented incorrectly; expected at least 20 spaces, found 16 Open
$u++;
- Exclude checks
Expected 1 space after closing parenthesis; found 10 Open
while($result=mysqli_fetch_array($response))
- Exclude checks
Whitespace found at end of line Open
$response=$db->query("SELECT id,firstname,lastname,email FROM contact_information WHERE status = 'Active' OR status = 'Elected' OR status = 'Appointed'");
- Exclude checks
Expected 1 space after closing parenthesis; found 10 Open
while($result=mysqli_fetch_array($response))
- Exclude checks
Expected 1 space after WHILE keyword; 0 found Open
while($reqevent=mysqli_fetch_array($theresponse))
- Exclude checks
Expected 1 space after closing parenthesis; found 14 Open
else if ( is_user_excused($id,$reqevent['event_id']) )
- Exclude checks
Expected 1 space after closing brace; newline found Open
}
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 12 Open
{
- Exclude checks
Expected 1 space after closing parenthesis; found 10 Open
while($result=mysqli_fetch_array($response))
- Exclude checks
Space before opening parenthesis of function call prohibited Open
require_once ('session.php');
- Exclude checks
Expected 1 space after closing parenthesis; found 14 Open
if ($l == null)
- Exclude checks
Line indented incorrectly; expected 16 spaces, found 12 Open
}
- Exclude checks
Whitespace found at end of line Open
}
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 8 Open
$theresponse=$db->query("SELECT event_name,event_id FROM events_listing WHERE required=1");
- Exclude checks
Line indented incorrectly; expected 16 spaces, found 12 Open
if ( did_user_attend($id,$reqevent['event_id']) )
- Exclude checks
Whitespace found at end of line Open
}
- Exclude checks
Whitespace found at end of line Open
$user_id = $_SESSION['sessionID'];
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 8 Open
while($reqevent=mysqli_fetch_array($theresponse))
- Exclude checks
Line indented incorrectly; expected 16 spaces, found 12 Open
}
- Exclude checks
Expected 1 space after WHILE keyword; 0 found Open
while($result=mysqli_fetch_array($response))
- Exclude checks
The variable $user_id is not named in camelCase. Open
function show_active() {
include('mysql_access.php');
global $current_semester;
$user_id = $_SESSION['sessionID'];
- 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 show_active() {
include('mysql_access.php');
global $current_semester;
$user_id = $_SESSION['sessionID'];
- 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 $user_id is not named in camelCase. Open
function show_active() {
include('mysql_access.php');
global $current_semester;
$user_id = $_SESSION['sessionID'];
- 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 show_active() {
include('mysql_access.php');
global $current_semester;
$user_id = $_SESSION['sessionID'];
- 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 show_active() {
include('mysql_access.php');
global $current_semester;
$user_id = $_SESSION['sessionID'];
- 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 show_active() {
include('mysql_access.php');
global $current_semester;
$user_id = $_SESSION['sessionID'];
- 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 show_active() {
include('mysql_access.php');
global $current_semester;
$user_id = $_SESSION['sessionID'];
- 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();
}
}