show_active accesses the super-global variable $_SESSION. Open
function show_active() {
$user_id = $_SESSION['sessionID'];
include('mysql_access.php');
$response=$db->query("SELECT position FROM contact_information WHERE id = $user_id");
$result=mysqli_fetch_array($response);
- 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
show_active accesses the super-global variable $_POST. Open
function show_active() {
$user_id = $_SESSION['sessionID'];
include('mysql_access.php');
$response=$db->query("SELECT position FROM contact_information WHERE id = $user_id");
$result=mysqli_fetch_array($response);
- 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
show_active accesses the super-global variable $_POST. Open
function show_active() {
$user_id = $_SESSION['sessionID'];
include('mysql_access.php');
$response=$db->query("SELECT position FROM contact_information WHERE id = $user_id");
$result=mysqli_fetch_array($response);
- 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 display
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
function display($group) {
if($group == 'All (sorted)')
{
echo '<h2>Active Members</h2>';
display_active_members();
- 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 display
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
function display($group) {
if($group == 'All (sorted)')
{
echo '<h2>Active Members</h2>';
display_active_members();
Method show_active
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function show_active() {
$user_id = $_SESSION['sessionID'];
include('mysql_access.php');
$response=$db->query("SELECT position FROM contact_information WHERE id = $user_id");
$result=mysqli_fetch_array($response);
The function display() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10. Open
function display($group) {
if($group == 'All (sorted)')
{
echo '<h2>Active Members</h2>';
display_active_members();
- 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
$response=$db->query("SELECT position FROM contact_information WHERE id = $user_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 * FROM contact_information WHERE status = 'inactive' ORDER BY lastname");
- 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 * FROM contact_information WHERE status = 'Pledge' ORDER BY lastname");
- 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 * FROM contact_information WHERE status = 'Associate' ORDER BY lastname");
- 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 * FROM contact_information WHERE status = 'Senior' ORDER BY lastname");
- 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 * FROM contact_information ORDER BY lastname");
- 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 * FROM contact_information WHERE status = 'Elected' OR status = 'Appointed' ORDER BY lastname");
- 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 * FROM contact_information ORDER BY lastname");
- 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 * FROM contact_information WHERE status = 'Alumni' ORDER BY lastname");
- 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
else{
echo '<h2>You cannot see this page.</h2>';
}
- 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
$response=$db->query("SELECT * FROM contact_information WHERE status = 'Associate' ORDER BY lastname");
- 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
$response=$db->query("SELECT * FROM contact_information ORDER BY lastname");
- 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
$response=$db->query("SELECT * FROM contact_information WHERE status = 'Pledge' ORDER BY lastname");
- 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
$response=$db->query("SELECT * FROM contact_information ORDER BY lastname");
- 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
$response=$db->query("SELECT position FROM contact_information WHERE id = $user_id");
- 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
$response=$db->query("SELECT * FROM contact_information WHERE status = 'inactive' ORDER BY lastname");
- 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
$response=$db->query("SELECT * FROM contact_information WHERE status = 'Alumni' ORDER BY lastname");
- 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
$response=$db->query("SELECT * FROM contact_information WHERE status = 'Senior' ORDER BY lastname");
- 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
$response=$db->query("SELECT * FROM contact_information WHERE status = 'Elected' OR status = 'Appointed' ORDER BY lastname");
- 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 '$result'. Open
$result=mysqli_fetch_array($response);
- 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
Similar blocks of code found in 7 locations. Consider refactoring. Open
function display_pledge_members() {
$count = 0;
include('mysql_access.php');
$response=$db->query("SELECT * FROM contact_information WHERE status = 'Pledge' ORDER BY lastname");
echo '<table>';
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 129.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 7 locations. Consider refactoring. Open
function display_all_members() {
$count = 0;
include('mysql_access.php');
$response=$db->query("SELECT * FROM contact_information ORDER BY lastname");
echo '<table>';
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 129.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 7 locations. Consider refactoring. Open
function display_senior_members() {
$count = 0;
include('mysql_access.php');
$response=$db->query("SELECT * FROM contact_information WHERE status = 'Senior' ORDER BY lastname");
echo '<table>';
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 129.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 7 locations. Consider refactoring. Open
function display_associate_members() {
$count = 0;
include('mysql_access.php');
$response=$db->query("SELECT * FROM contact_information WHERE status = 'Associate' ORDER BY lastname");
echo '<table>';
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 129.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 7 locations. Consider refactoring. Open
function display_exec_members() {
$count = 0;
include('mysql_access.php');
$response=$db->query("SELECT * FROM contact_information WHERE status = 'Elected' OR status = 'Appointed' ORDER BY lastname");
echo '<table>';
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 129.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 7 locations. Consider refactoring. Open
function display_inactive_members() {
$count = 0;
include('mysql_access.php');
$response=$db->query("SELECT * FROM contact_information WHERE status = 'inactive' ORDER BY lastname");
echo '<table>';
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 129.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 7 locations. Consider refactoring. Open
function display_alumni_members() {
$count = 0;
include('mysql_access.php');
$response=$db->query("SELECT * FROM contact_information WHERE status = 'Alumni' ORDER BY lastname");
echo '<table>';
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 129.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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
TRUE, FALSE and NULL must be lowercase; expected "false" but found "False" Open
$public_page = False;
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "false" but found "False" Open
$exec_page = False;
- 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
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
echo '<h2>Senior Members</h2>';
- 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
$count++;
- 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 '<h2>Alumni Members</h2>';
- 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
display_senior_members();
- 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
$count++;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
else if ($group == 'Pledge')
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
display_associate_members();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
else if ($group == 'Inactive')
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
else if ($group == 'Senior')
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
display_senior_members();
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if ( ($result['status'] == 'Active') || ($result['status'] == 'Elected') || ($result['status'] == 'Appointed') ) {
- 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
$count++;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$count++;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
display_pledge_members();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
else if ($group == 'Alumni')
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
display_exec_members();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
echo '<h2>Associate Members</h2>';
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
display_active_members();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
display_alumni_members();
- 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
display_pledge_members();
- 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>' . $count . '</td><td>' . $result['lastname'] . '</td><td>' . $result['firstname'] . '</td><td>' . $result['status'] . '</td><td>' . $result['email']. '</td><td>' . $result['position'] . '</td></tr>';
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
echo '<h2>Inactive Members</h2>';
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
else if ($group == '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
echo '<h2>Exec Members</h2>';
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$count++;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
echo '<h2>Pledge Members</h2>';
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
display_associate_members();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
else if($group == 'Exec')
- 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
$count++;
- 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
display_inactive_members();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
display_inactive_members();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$count++;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$count++;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$page = $_POST['page'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if(isset($_POST['page'])){
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (true) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<option value="All" selected>--</option>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$page = null;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<option value="All (sorted)">All (by status)</option>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<option value="All (unsorted)">All (alphabetical)</option>
- 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
<select name="page" onchange="this.form.submit()">
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<p> Choose a group: </p>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//sets event info section from selection
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<option value="Active">Active</option>
- 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
<option value="Pledge">Pledge</option>
- Exclude checks
End of line character is invalid; expected "\n" but found "\r\n" Open
<?php
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<form name="myform" action="" method="post">
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if($group == 'All (sorted)')
- Exclude checks
Line exceeds 120 characters; contains 223 characters Open
echo '<tr><td>' . $count . '</td><td>' . $result['lastname'] . '</td><td>' . $result['firstname'] . '</td><td>' . $result['status'] . '</td><td>' . $result['email']. '</td><td>' . $result['position'] . '</td></tr>';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<option value="Associate">Associate</option>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<option value="Inactive">Inactive</option>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<option value="Alumni">Alumni</option>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
display_associate_members();
- Exclude checks
Line exceeds 120 characters; contains 223 characters Open
echo '<tr><td>' . $count . '</td><td>' . $result['lastname'] . '</td><td>' . $result['firstname'] . '</td><td>' . $result['status'] . '</td><td>' . $result['email']. '</td><td>' . $result['position'] . '</td></tr>';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
</form>
- 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
display_inactive_members();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
echo '<h2>Alumni Members</h2>';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
echo '<h2>All Members</h2>';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<option value="Exec">Exec</option>
- 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
echo '<h2>Senior Members</h2>';
- Exclude checks
Line exceeds 120 characters; contains 223 characters Open
echo '<tr><td>' . $count . '</td><td>' . $result['lastname'] . '</td><td>' . $result['firstname'] . '</td><td>' . $result['status'] . '</td><td>' . $result['email']. '</td><td>' . $result['position'] . '</td></tr>';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
echo '<h2>Active Members</h2>';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
echo '<h2>Associate Members</h2>';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Line exceeds 120 characters; contains 223 characters Open
echo '<tr><td>' . $count . '</td><td>' . $result['lastname'] . '</td><td>' . $result['firstname'] . '</td><td>' . $result['status'] . '</td><td>' . $result['email']. '</td><td>' . $result['position'] . '</td></tr>';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<?php
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
else if ($group == 'All (unsorted)')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
display_all_members();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
</select>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
display_alumni_members();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<option value="Senior">Senior</option>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
display_pledge_members();
- 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
else if ($group == 'Active')
- 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
echo '<h2>Active Members</h2>';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
display($page);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
display_senior_members();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
echo '<h2>Inactive Members</h2>';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
echo '<h2>Pledge Members</h2>';
- Exclude checks
Line exceeds 120 characters; contains 223 characters Open
echo '<tr><td>' . $count . '</td><td>' . $result['lastname'] . '</td><td>' . $result['firstname'] . '</td><td>' . $result['status'] . '</td><td>' . $result['email']. '</td><td>' . $result['position'] . '</td></tr>';
- Exclude checks
Line exceeds 120 characters; contains 129 characters Open
$response=$db->query("SELECT * FROM contact_information WHERE status = 'Elected' OR status = 'Appointed' ORDER BY lastname");
- Exclude checks
Line exceeds 120 characters; contains 223 characters Open
echo '<tr><td>' . $count . '</td><td>' . $result['lastname'] . '</td><td>' . $result['firstname'] . '</td><td>' . $result['status'] . '</td><td>' . $result['email']. '</td><td>' . $result['position'] . '</td></tr>';
- Exclude checks
Line exceeds 120 characters; contains 223 characters Open
echo '<tr><td>' . $count . '</td><td>' . $result['lastname'] . '</td><td>' . $result['firstname'] . '</td><td>' . $result['status'] . '</td><td>' . $result['email']. '</td><td>' . $result['position'] . '</td></tr>';
- Exclude checks
Line exceeds 120 characters; contains 223 characters Open
echo '<tr><td>' . $count . '</td><td>' . $result['lastname'] . '</td><td>' . $result['firstname'] . '</td><td>' . $result['status'] . '</td><td>' . $result['email']. '</td><td>' . $result['position'] . '</td></tr>';
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 6 Open
if (true) {
- 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 0 Open
if(isset($_POST['page'])){
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
if(isset($_POST['page'])){
- Exclude checks
Space before opening parenthesis of function call prohibited Open
require_once ('session.php');
- Exclude checks
Opening brace should be on a new line Open
function show_active() {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 6 Open
}
- Exclude checks
Expected 1 space after closing brace; newline found Open
}
- Exclude checks
Expected 1 space after ELSE keyword; 0 found Open
else{
- 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 7 Open
if($group == 'All (sorted)')
- Exclude checks
Whitespace found at end of line Open
$count++;
- Exclude checks
Whitespace found at end of line Open
display_senior_members();
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
else if($group == 'Exec')
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
while($result=mysqli_fetch_array($response)){
- 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 0 Open
while($result=mysqli_fetch_array($response)){
- Exclude checks
Usage of ELSE IF is discouraged; use ELSEIF instead Open
else if ($group == 'Associate')
- Exclude checks
Expected 1 space after closing brace; newline found Open
}
- Exclude checks
Expected 1 space after closing brace; newline found Open
}
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 8 Open
echo '<tr><td>' . $count . '</td><td>' . $result['lastname'] . '</td><td>' . $result['firstname'] . '</td><td>' . $result['status'] . '</td><td>' . $result['email']. '</td><td>' . $result['position'] . '</td></tr>';
- Exclude checks
Opening brace should be on a new line Open
function display_all_members() {
- Exclude checks
Expected 1 space after WHILE keyword; 0 found Open
while($result=mysqli_fetch_array($response)){
- Exclude checks
Opening brace should be on a new line Open
function display_inactive_members() {
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
while($result=mysqli_fetch_array($response)){
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
if($group == 'All (sorted)')
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 6 Open
}
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
while($result=mysqli_fetch_array($response)){
- Exclude checks
Opening brace should be on a new line Open
function display_exec_members() {
- Exclude checks
Usage of ELSE IF is discouraged; use ELSEIF instead Open
else if ($group == 'Senior')
- Exclude checks
Expected 1 space after WHILE keyword; 0 found Open
while($result=mysqli_fetch_array($response)){
- Exclude checks
Expected 1 space after WHILE keyword; 0 found Open
while($result=mysqli_fetch_array($response)){
- Exclude checks
Expected 1 space after closing brace; newline found Open
}
- Exclude checks
Whitespace found at end of line Open
display_pledge_members();
- Exclude checks
Expected 1 space after closing brace; newline found Open
}
- Exclude checks
Whitespace found at end of line Open
else if($group == 'Exec')
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 8 Open
$count++;
- Exclude checks
Whitespace found at end of line Open
display_active_members();
- Exclude checks
Expected 1 space after closing parenthesis; found 6 Open
else if ($group == 'Associate')
- Exclude checks
Usage of ELSE IF is discouraged; use ELSEIF instead Open
else if($group == 'Exec')
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
while($result=mysqli_fetch_array($response)){
- Exclude checks
Whitespace found at end of line Open
$count++;
- Exclude checks
Opening brace should be on a new line Open
function display_associate_members() {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 6 Open
}
- Exclude checks
Expected 1 space after closing brace; newline found Open
}
- Exclude checks
Usage of ELSE IF is discouraged; use ELSEIF instead Open
else if ($group == 'Pledge')
- Exclude checks
Expected 1 space after closing parenthesis; found 6 Open
else if ($group == 'Pledge')
- Exclude checks
Expected 1 space after closing brace; newline found Open
}
- Exclude checks
Expected 1 space after closing parenthesis; found 6 Open
else if ($group == 'Inactive')
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 6 Open
if ( ($result['status'] == 'Active') || ($result['status'] == 'Elected') || ($result['status'] == 'Appointed') ) {
- Exclude checks
Expected 1 space after WHILE keyword; 0 found Open
while($result=mysqli_fetch_array($response)){
- Exclude checks
Usage of ELSE IF is discouraged; use ELSEIF instead Open
else if ($group == 'All (unsorted)')
- Exclude checks
Expected 1 space after closing parenthesis; found 6 Open
else if ($group == 'All (unsorted)')
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
if ( ($result['status'] == 'Active') || ($result['status'] == 'Elected') || ($result['status'] == 'Appointed') ) {
- Exclude checks
Whitespace found at end of line Open
$count++;
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 6 Open
else{
- Exclude checks
Usage of ELSE IF is discouraged; use ELSEIF instead Open
else if ($group == 'Inactive')
- Exclude checks
Expected 1 space after closing parenthesis; found 6 Open
else if ($group == 'Alumni')
- Exclude checks
Opening brace should be on a new line Open
function display_alumni_members() {
- Exclude checks
Whitespace found at end of line Open
$count++;
- Exclude checks
Opening brace should be on a new line Open
function display($group) {
- Exclude checks
Expected 1 space after closing parenthesis; found 6 Open
else if ($group == 'Active')
- Exclude checks
Expected 1 space after closing brace; newline found Open
}
- Exclude checks
Whitespace found at end of line Open
$count++;
- Exclude checks
Expected 1 space after closing parenthesis; found 6 Open
else if ($group == 'Senior')
- Exclude checks
Opening brace should be on a new line Open
function display_active_members() {
- Exclude checks
Whitespace found at end of line Open
if($group == 'All (sorted)')
- Exclude checks
Expected 1 space after closing brace; newline found Open
}
- Exclude checks
Usage of ELSE IF is discouraged; use ELSEIF instead Open
else if ($group == 'Active')
- Exclude checks
Whitespace found at end of line Open
display_associate_members();
- Exclude checks
Whitespace found at end of line Open
display_inactive_members();
- Exclude checks
Usage of ELSE IF is discouraged; use ELSEIF instead Open
else if ($group == 'Alumni')
- Exclude checks
Expected 1 space after closing parenthesis; found 7 Open
else if($group == 'Exec')
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
while($result=mysqli_fetch_array($response)){
- Exclude checks
Expected 1 space after WHILE keyword; 0 found Open
while($result=mysqli_fetch_array($response)){
- Exclude checks
Opening brace should be on a new line Open
function display_senior_members() {
- Exclude checks
Whitespace found at end of line Open
$count++;
- Exclude checks
Opening brace should be on a new line Open
function display_pledge_members() {
- Exclude checks
Whitespace found at end of line Open
$count++;
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
while($result=mysqli_fetch_array($response)){
- Exclude checks
Whitespace found at end of line Open
$count++;
- 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 0 Open
while($result=mysqli_fetch_array($response)){
- Exclude checks
The variable $user_id is not named in camelCase. Open
function show_active() {
$user_id = $_SESSION['sessionID'];
include('mysql_access.php');
$response=$db->query("SELECT position FROM contact_information WHERE id = $user_id");
$result=mysqli_fetch_array($response);
- 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() {
$user_id = $_SESSION['sessionID'];
include('mysql_access.php');
$response=$db->query("SELECT position FROM contact_information WHERE id = $user_id");
$result=mysqli_fetch_array($response);
- 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();
}
}