Showing 11,898 of 11,898 total issues
Function grade_quiz
has a Cognitive Complexity of 124 (exceeds 5 allowed). Consider refactoring. Open
function grade_quiz() {
//This part of the code is ridiculously hardcoded for now. Should use SQL to check for correct answers.
$score = 0;
//questions
if(isset($_POST["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
File attendance_admin.php
has 926 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
require_once ('session.php');
require_once ('mysql_access.php');
?>
<!doctype html>
Function displayListing
has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring. Open
function displayListing(){
include('mysql_access.php');
$id = $_SESSION['sessionID'];
$sql = "SELECT d.event_id, d.DOW, d.start, d.end, d.length, e.name, o.theDate
FROM service_details AS d
- 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 grade_quiz
has 315 lines of code (exceeds 25 allowed). Consider refactoring. Open
function grade_quiz() {
//This part of the code is ridiculously hardcoded for now. Should use SQL to check for correct answers.
$score = 0;
//questions
if(isset($_POST["1"])) {
Method display_log_form
has 294 lines of code (exceeds 25 allowed). Consider refactoring. Open
function display_log_form(){
$id = $_POST['event'];//WORKS
$sql = "SELECT events.name AS name, occurrence.date AS date, occurrence.id AS id
FROM events
Method displayListing
has 292 lines of code (exceeds 25 allowed). Consider refactoring. Open
function displayListing(){
include('mysql_access.php');
$dateMapNew = array(1,0,6,5,4,3,2);
$dateMap1 = array(0,6,5,4,3,2,1);
$currentDOW1 = date('w');//returns integer of DOW
Method process_add
has 288 lines of code (exceeds 25 allowed). Consider refactoring. Open
function process_add(){//A.K.A. FUNCTION BITCH()
$name = $_POST['name'];
$day = $_POST['day'];
$year = $_POST['year'];
$month = $_POST['month'];
Method show_page
has 287 lines of code (exceeds 25 allowed). Consider refactoring. Open
function show_page() {
include('mysql_access.php');
global $current_semester;
if (isset($_POST['update'])) {
Similar blocks of code found in 2 locations. Consider refactoring. Open
<?php
$exec_page = True;
$active_page = False;
$public_page = True;
- 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 317.
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 2 locations. Consider refactoring. Open
<?php
$exec_page = True;
$active_page = False;
$public_page = True;
- 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 317.
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 2 locations. Consider refactoring. Open
if (isset($_POST['update'])) {
// Update Information
$_POST = array_map('array_map_calllback', $_POST);
$user_id = $_SESSION['sessionID'];
$sql = <<<SQL
- 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 297.
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 2 locations. Consider refactoring. Open
if (isset($_POST['update'])) {
// Update Information
$_POST = array_map('mysql_real_escape_string', $_POST);
$user_id = $_SESSION['sessionID'];
$sql = <<<SQL
- 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 297.
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
Method show_active
has 255 lines of code (exceeds 25 allowed). Consider refactoring. Open
function show_active(){
//Start loading external resources
?>
<script src='/js/foundation/foundation.js'></script>
<script src='/js/foundation/foundation.reveal.js'></script>
Method display
has 215 lines of code (exceeds 25 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);
Function displayListing
has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring. Open
function displayListing(){
include('mysql_access.php');
$dateMapNew = array(1,0,6,5,4,3,2);
$dateMap1 = array(0,6,5,4,3,2,1);
$currentDOW1 = date('w');//returns integer of 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 54 (exceeds 5 allowed). Consider refactoring. Open
function show_active() {
echo "<h1>Events you are leading:</h1>";
$user_id = $_SESSION['sessionID'];
include('mysql_access.php');
- 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 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 displayListing
has 193 lines of code (exceeds 25 allowed). Consider refactoring. Open
function displayListing(){
include('mysql_access.php');
$id = $_SESSION['sessionID'];
$sql = "SELECT d.event_id, d.DOW, d.start, d.end, d.length, e.name, o.theDate
FROM service_details AS d
Function display
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
function display($event_type) {
include('mysql_access.php');
$user_id = $_SESSION['sessionID'];
echo "Displaying " . $event_type . " Events";
- 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_page
has 186 lines of code (exceeds 25 allowed). Consider refactoring. Open
function show_page() {
require_once('mysql_access.php');
?>
<div class='large-12 medium-12 small-12 column'>
<h1>Member Information</h1>