Showing 167 of 11,898 total issues
Method show_active
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
function show_active() {
include('mysql_access.php');
$user_id = $_SESSION['sessionID'];
$aresponse=$db->query("SELECT status FROM contact_information WHERE id=$user_id");
$aresult=mysqli_fetch_array($aresponse);
Function display
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
function display($event_type) {
include('mysql_access.php');
$user_id = $_SESSION['sessionID'];
$response=$db->query("SELECT MAX(event_id) FROM events_listing");
$result=mysqli_fetch_array($response);
- 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 processAttendance
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
function processAttendance($d,$o){
include('mysql_access.php');
echo "<h1>Process Attendance</h1>";
echo "<form method=\"post\" action=\"$_SERVER[PHP_SELF]\">";
Method list_stats
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
function list_stats($hours_id, $semester) {
include ('mysql_access.php');
global $total_query;
// Total Hours
$sql = "SELECT SUM(hours) AS `sum_hours` FROM `recorded_hours` WHERE `user_id` = '$hours_id' AND `semester` = '$semester' LIMIT 1";
Method display_add_form
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
function display_add_form($active_semester){
$sql = "SELECT * FROM `apo`.`events`";
$result = mysql_query($sql);
if($result){
Function backup_tables
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
function backup_tables($tables = '*')
{
include('mysql_access.php');
//get all of the tables
if($tables == '*')
- 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 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
function show_active() {
include('mysql_access.php');
//Generate a dropdown box
$sql = "SELECT id, lastname, firstname FROM contact_information UNION DISTINCT SELECT id, lastname, firstname FROM alumni UNION DISTINCT SELECT id, lastname, firstname FROM alumni_info ORDER BY lastname ASC;";
$result = $db->query($sql);
File event_signup.php
has 310 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
require_once ('session.php');
require_once ('mysql_access.php');
?>
<!doctype html>
Method attendance_check
has 86 lines of code (exceeds 25 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
Function list_stats
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
function list_stats($hours_id, $semester) {
include ('mysql_access.php');
include('requirements.php');
// Total Hours
$sql = "SELECT SUM(hours) AS `sum_hours` FROM `recorded_hours` WHERE `user_id` = '$hours_id' AND `semester` = '$semester' LIMIT 1";
- 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 email_new_pw
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
function email_new_pw($to) {
include ('mysql_access.php');
$aresponse=$db->query("SELECT username FROM contact_information WHERE email='$to'");
Function show_active
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function show_active() {
//Code based on example at https://vikasmahajan.wordpress.com/2010/07/07/inserting-and-displaying-images-in-mysql-using-php/
include('../mysql_access.php');
$user_id = $_SESSION['sessionID'];
$maxsize = 3000000;
- 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 email_new_pw
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function email_new_pw($to) {
include ('mysql_access.php');
$aresponse=$db->query("SELECT username FROM contact_information WHERE email='$to'");
- 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
File service_signup.php
has 294 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
require_once ('session.php');
require_once ('mysql_access.php');
?>
<!doctype html>
Method initializeNewWeekForm
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initializeNewWeekForm(){
include('mysql_access.php');
$dateMap1 = array(0,6,5,4,3,2,1);
$currentDOW1 = date('w');//returns integer of DOW
$z1 = $dateMap1[$currentDOW1];//go through map
File check_requirements.php
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
require_once ('session.php');
require_once ('mysql_access.php');
?>
<!doctype html>
Function process_login
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
function process_login(){
require_once ('mysql_access.php');
$username = addslashes($_POST["username"]);
$password = addslashes($_POST["password"]);
$hasher = new PasswordHash(8, true);
- 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 21 (exceeds 5 allowed). Consider refactoring. Open
function show_active() {
include('mysql_access.php');
$user_id = $_SESSION['sessionID'];
$aresponse=$db->query("SELECT status FROM contact_information WHERE id=$user_id");
$aresult=mysqli_fetch_array($aresponse);
- 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
File upload_photo.php
has 287 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
require_once ('session.php');
require_once ('mysql_access.php');
require_once ('get_photo.php');
//Code based on example at https://vikasmahajan.wordpress.com/2010/07/07/inserting-and-displaying-images-in-mysql-using-php/
File create_event.php
has 286 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
require_once ('session.php');
require_once ('mysql_access.php');
?>
<!doctype html>