Showing 11,898 of 11,898 total issues
Avoid using undefined variables such as '$toProcessOID' which will lead to PHP notices. Open
$size = count($toProcessOID);
- 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 event_name,event_type FROM events_listing");
- 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 '$name' which will lead to PHP notices. Open
$name[] = $r['name'];
- 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 '$year' which will lead to PHP notices. Open
VALUES (".$toProcessUID[$i].",".$month[$i].",".$day[$i].",".$year[$i].",'".$theDate[$i]."','".$current_semester."','auto-logged item #".$toProcessOID[$i]."',".$toProcessLen[$i].",
- 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
Method check_attendance
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function check_attendance(){
echo
<<<END
<form method="post" action="$_SERVER[PHP_SELF]" id="show">
Method assignPLForm
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function assignPLForm(){
include('mysql_access.php');
echo "<h2>Assign Project Leader (Limit 1)</h2>";
echo <<<FORM
<form method="post" action="$_SERVER[PHP_SELF]">
Method display_create_form
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function display_create_form($active_semester){
echo
<<<END
<form method="post" action="$_SERVER[PHP_SELF]" id="create">
Method display_log_form_init
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function display_log_form_init(){
//begin form
echo
<<<END
<form method="post" action="$_SERVER[PHP_SELF]" id="show">
Method show_active
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function show_active() {
$user_id = $_SESSION['sessionID'];
include('mysql_access.php');
if (isset($_GET['delete'])) {
Function view
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function view($i){
include('mysql_access.php');
$id = $_SESSION['sessionID'];
$sql = "SELECT d.detail_id, d.event_id, d.DOW,
- 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
Function show_active
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function show_active() {
include('mysql_access.php');
//$response=$db->query("SELECT event_name,L_val,F_val,repeatable FROM events_listing WHERE event_type='Point'");
//$count = 0;
- 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
Function list_attendance_stats
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function list_attendance_stats($user_id){
$sql = "SELECT
events.name AS name, SUM(events.worth) AS sum_worth, events.worth AS worth
FROM occurrence
- 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
Function removeEmptyDirectories
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function removeEmptyDirectories($submoduleArray) {
foreach ($submoduleArray as $submoduleKey => $submoduleValue) {
$dir = new RecursiveDirectoryIterator($submoduleKey, FilesystemIterator::SKIP_DOTS);
foreach (new RecursiveIteratorIterator($dir, RecursiveIteratorIterator::CHILD_FIRST) as $file) {
if ($file->isDir()) {
- 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
Function attendance_check
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function attendance_check($user_id){
$sql = "SELECT occurrence.e_id AS e_id, occurrence.id AS id, occurrence.date AS date,
events.name AS name, events.worth AS worth, occurrence.type AS type,
recorded_attendance.attended AS attended
FROM occurrence
- 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
Function recorded_hours
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function recorded_hours(){
include('mysql_access.php');
global $current_semester;
//this is shit code. could be written in OOP.
// not shit code INVENTIVE code.
- 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
Function doubleTapToGo
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.doubleTapToGo = function( params )
{
if( !( 'ontouchstart' in window ) &&
!navigator.msMaxTouchPoints &&
!navigator.userAgent.toLowerCase().match( /windows phone os 7/i ) ) return false;
Method process_form
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function process_form() {
include ('mysql_access.php');
$id = $_SESSION['sessionID'];
$event = $_POST['event'];
$month = $_POST['month'];
Function doubleTapToGo
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.doubleTapToGo = function( params )
{
if( !( 'ontouchstart' in window ) &&
!navigator.msMaxTouchPoints &&
!navigator.userAgent.toLowerCase().match( /windows phone os 7/i ) ) return false;
Method list_hours
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function list_hours($user_id) {
include ('mysql_access.php');
$sql = "SELECT * FROM `recorded_hours` WHERE `user_id` = $user_id ORDER BY `year` DESC, `month` DESC, `day` DESC";
$results = $db->query($sql) or die("Error - Contact Webmaster");
echo "<div style='margin: 0px auto; width: 100%; text-align: center;'>
Method HashPassword
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function HashPassword($password)
{
$random = '';
if (CRYPT_BLOWFISH == 1 && !$this->portable_hashes) {