Method show_exec
has 149 lines of code (exceeds 25 allowed). Consider refactoring. Open
function show_exec() {
//Let's get a whole bunch of data
include('../mysql_access.php');
//Let's count all the registrants
$sql = "SELECT COUNT(*) AS num_reg FROM conf_contact_information;";
The function show_exec() has 176 lines of code. Current threshold is set to 100. Avoid really long methods. Open
function show_exec() {
//Let's get a whole bunch of data
include('../mysql_access.php');
//Let's count all the registrants
$sql = "SELECT COUNT(*) AS num_reg FROM conf_contact_information;";
- Exclude checks
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
$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
$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
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 22 and the first side effect is on line 2. Open
<?php
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "true" but found "True" Open
$exec_page = True;
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "true" but found "True" Open
$public_page = True;
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "false" but found "False" Open
$active_page = False;
- Exclude checks
Line exceeds 120 characters; contains 129 characters Open
$chapters_data .= "{'Chapter Name': '" . $row['chapter'] . "', 'Number Registered': " . $row['num_chapter'] . "},\n";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<th>Allergies</th>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
</tr>
- Exclude checks
Line exceeds 120 characters; contains 360 characters Open
$registrants .= "<tr><td>" . $row['firstname'] . "</td><td>" . $row['lastname'] . "</td><td>" . $row['email'] . "</td><td>" . $row['phone'] . "</td><td>" . $row['shirt'] . "</td><td>" . $row['allergytext'] . "</td><td>" . $row['housing'] . "</td><td>" . $row['chapter'] . "</td><td>" . $row['payment'] . "</td><td>" . $row['guests'] . "</td></tr>";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<?php echo $chapters_data; ?>
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
$sql = "SELECT housing, COUNT(id) AS num_housing FROM conf_contact_information GROUP BY housing ORDER BY housing DESC;";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<tr>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<th>Shirt Size</th>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<th>Guests</th>
- Exclude checks
Line exceeds 120 characters; contains 130 characters Open
$sql = "SELECT payment, COUNT(id) as num_paying FROM conf_contact_information GROUP BY payment ORDER BY num_paying DESC;";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<th>Last Name</th>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
</table>
- Exclude checks
Line exceeds 120 characters; contains 127 characters Open
$shirt_data .= "{'shirtsize': '" . $row['shirt'] . "', 'Number of Shirts Ordered': " . $row['num_shirts'] . "},\n";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<?php echo $registrants; ?>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<?php echo $housing_data; ?>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<th>Phone Number</th>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<th>Payment</th>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<?php echo $payment_data; ?>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<th>Brother Housing</th>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<th>Chapter</th>
- Exclude checks
Line exceeds 120 characters; contains 158 characters Open
$sql = "SELECT shirt, COUNT(id) AS num_shirts FROM conf_contact_information GROUP BY shirt ORDER BY FIELD(shirt, 'S', 'M', 'L', 'XL', '2XL', '3XL');";
- Exclude checks
Line exceeds 120 characters; contains 189 characters Open
$sql = "SELECT RTRIM(CONCAT(chapter1, ' ', chapter2, ' ', chapter3)) AS chapter, COUNT(id) AS num_chapter FROM conf_contact_information GROUP BY chapter ORDER BY num_chapter DESC;";
- Exclude checks
Line exceeds 120 characters; contains 190 characters Open
$sql = "SELECT *, RTRIM(CONCAT(chapter1, ' ', chapter2, ' ', chapter3)) AS chapter, CONCAT('(', tel1, ') ', tel2, '-', tel3) AS phone FROM conf_contact_information ORDER BY id ASC;";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<th>First Name</th>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
<th>Email</th>
- Exclude checks
Opening brace should be on a new line Open
function show_public() {
- Exclude checks
Expected 1 space after WHILE keyword; 0 found Open
while($row = mysqli_fetch_assoc($result)) {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
}
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
function show_public() {
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
function show_exec() {
- Exclude checks
Expected 1 space after WHILE keyword; 0 found Open
while($row = mysqli_fetch_assoc($result)) {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
while($row = mysqli_fetch_assoc($result)) {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
while($row = mysqli_fetch_assoc($result)) {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}
- Exclude checks
Space before opening parenthesis of function call prohibited Open
require_once ('session.php');
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}
- Exclude checks
Expected 1 space after WHILE keyword; 0 found Open
while($row = mysqli_fetch_assoc($result)) {
- Exclude checks
Opening brace should be on a new line Open
function show_exec() {
- Exclude checks
Expected 1 space after WHILE keyword; 0 found Open
while($row = mysqli_fetch_assoc($result)) {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
while($row = mysqli_fetch_assoc($result)) {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
while($row = mysqli_fetch_assoc($result)) {
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
}
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
while($row = mysqli_fetch_assoc($result)) {
- Exclude checks
Expected 1 space after WHILE keyword; 0 found Open
while($row = mysqli_fetch_assoc($result)) {
- Exclude checks
The variable $num_reg is not named in camelCase. Open
function show_exec() {
//Let's get a whole bunch of data
include('../mysql_access.php');
//Let's count all the registrants
$sql = "SELECT COUNT(*) AS num_reg FROM conf_contact_information;";
- 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 $chapters_data is not named in camelCase. Open
function show_exec() {
//Let's get a whole bunch of data
include('../mysql_access.php');
//Let's count all the registrants
$sql = "SELECT COUNT(*) AS num_reg FROM conf_contact_information;";
- 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 $shirt_data is not named in camelCase. Open
function show_exec() {
//Let's get a whole bunch of data
include('../mysql_access.php');
//Let's count all the registrants
$sql = "SELECT COUNT(*) AS num_reg FROM conf_contact_information;";
- 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 $payment_data is not named in camelCase. Open
function show_exec() {
//Let's get a whole bunch of data
include('../mysql_access.php');
//Let's count all the registrants
$sql = "SELECT COUNT(*) AS num_reg FROM conf_contact_information;";
- 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 $num_reg is not named in camelCase. Open
function show_exec() {
//Let's get a whole bunch of data
include('../mysql_access.php');
//Let's count all the registrants
$sql = "SELECT COUNT(*) AS num_reg FROM conf_contact_information;";
- 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 $shirt_sizes is not named in camelCase. Open
function show_exec() {
//Let's get a whole bunch of data
include('../mysql_access.php');
//Let's count all the registrants
$sql = "SELECT COUNT(*) AS num_reg FROM conf_contact_information;";
- 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 $shirt_sizes is not named in camelCase. Open
function show_exec() {
//Let's get a whole bunch of data
include('../mysql_access.php');
//Let's count all the registrants
$sql = "SELECT COUNT(*) AS num_reg FROM conf_contact_information;";
- 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 $chapters_data is not named in camelCase. Open
function show_exec() {
//Let's get a whole bunch of data
include('../mysql_access.php');
//Let's count all the registrants
$sql = "SELECT COUNT(*) AS num_reg FROM conf_contact_information;";
- 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 $payment_data is not named in camelCase. Open
function show_exec() {
//Let's get a whole bunch of data
include('../mysql_access.php');
//Let's count all the registrants
$sql = "SELECT COUNT(*) AS num_reg FROM conf_contact_information;";
- 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 $shirt_data is not named in camelCase. Open
function show_exec() {
//Let's get a whole bunch of data
include('../mysql_access.php');
//Let's count all the registrants
$sql = "SELECT COUNT(*) AS num_reg FROM conf_contact_information;";
- 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 $housing_data is not named in camelCase. Open
function show_exec() {
//Let's get a whole bunch of data
include('../mysql_access.php');
//Let's count all the registrants
$sql = "SELECT COUNT(*) AS num_reg FROM conf_contact_information;";
- 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 $chapters_data is not named in camelCase. Open
function show_exec() {
//Let's get a whole bunch of data
include('../mysql_access.php');
//Let's count all the registrants
$sql = "SELECT COUNT(*) AS num_reg FROM conf_contact_information;";
- 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 $payment_data is not named in camelCase. Open
function show_exec() {
//Let's get a whole bunch of data
include('../mysql_access.php');
//Let's count all the registrants
$sql = "SELECT COUNT(*) AS num_reg FROM conf_contact_information;";
- 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 $housing_data is not named in camelCase. Open
function show_exec() {
//Let's get a whole bunch of data
include('../mysql_access.php');
//Let's count all the registrants
$sql = "SELECT COUNT(*) AS num_reg FROM conf_contact_information;";
- 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 $shirt_data is not named in camelCase. Open
function show_exec() {
//Let's get a whole bunch of data
include('../mysql_access.php');
//Let's count all the registrants
$sql = "SELECT COUNT(*) AS num_reg FROM conf_contact_information;";
- 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 $housing_data is not named in camelCase. Open
function show_exec() {
//Let's get a whole bunch of data
include('../mysql_access.php');
//Let's count all the registrants
$sql = "SELECT COUNT(*) AS num_reg FROM conf_contact_information;";
- 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 $payment_data is not named in camelCase. Open
function show_exec() {
//Let's get a whole bunch of data
include('../mysql_access.php');
//Let's count all the registrants
$sql = "SELECT COUNT(*) AS num_reg FROM conf_contact_information;";
- 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 $housing_data is not named in camelCase. Open
function show_exec() {
//Let's get a whole bunch of data
include('../mysql_access.php');
//Let's count all the registrants
$sql = "SELECT COUNT(*) AS num_reg FROM conf_contact_information;";
- 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 $shirt_data is not named in camelCase. Open
function show_exec() {
//Let's get a whole bunch of data
include('../mysql_access.php');
//Let's count all the registrants
$sql = "SELECT COUNT(*) AS num_reg FROM conf_contact_information;";
- 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 $shirt_sizes is not named in camelCase. Open
function show_exec() {
//Let's get a whole bunch of data
include('../mysql_access.php');
//Let's count all the registrants
$sql = "SELECT COUNT(*) AS num_reg FROM conf_contact_information;";
- 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 $shirt_data is not named in camelCase. Open
function show_exec() {
//Let's get a whole bunch of data
include('../mysql_access.php');
//Let's count all the registrants
$sql = "SELECT COUNT(*) AS num_reg FROM conf_contact_information;";
- 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 $shirt_sizes is not named in camelCase. Open
function show_exec() {
//Let's get a whole bunch of data
include('../mysql_access.php');
//Let's count all the registrants
$sql = "SELECT COUNT(*) AS num_reg FROM conf_contact_information;";
- 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 $housing_data is not named in camelCase. Open
function show_exec() {
//Let's get a whole bunch of data
include('../mysql_access.php');
//Let's count all the registrants
$sql = "SELECT COUNT(*) AS num_reg FROM conf_contact_information;";
- 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 $chapters_data is not named in camelCase. Open
function show_exec() {
//Let's get a whole bunch of data
include('../mysql_access.php');
//Let's count all the registrants
$sql = "SELECT COUNT(*) AS num_reg FROM conf_contact_information;";
- 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 $chapters_data is not named in camelCase. Open
function show_exec() {
//Let's get a whole bunch of data
include('../mysql_access.php');
//Let's count all the registrants
$sql = "SELECT COUNT(*) AS num_reg FROM conf_contact_information;";
- 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 $payment_data is not named in camelCase. Open
function show_exec() {
//Let's get a whole bunch of data
include('../mysql_access.php');
//Let's count all the registrants
$sql = "SELECT COUNT(*) AS num_reg FROM conf_contact_information;";
- 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();
}
}