Showing 11,898 of 11,898 total issues
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
File register.php
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
require_once ('session.php');
require_once ('../mysql_access.php');
?>
<!doctype html>
Similar blocks of code found in 2 locations. Consider refactoring. Open
function removeEventForm(){
include('mysql_access.php');
echo "<h2>Remove an Event</h2>";
echo "<form method=\"post\" action=\"$_SERVER[PHP_SELF]\">";
echo "<select name=\"event\">";
- 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 128.
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
function editEventForm(){
include('mysql_access.php');
echo "<h2>Edit an Event</h2>";
echo "<form method=\"post\" action=\"$_SERVER[PHP_SELF]\">";
echo "<select name=\"event\">";
- 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 128.
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
Consider simplifying this complex logical expression. Open
if ($fname == NULL || $lname == NULL || $email == NULL || $tel1 == NULL || $tel2 == NULL || $tel3 == NULL || $password == NULL || $shirt == NULL || $housing == NULL || $chapter1 == NULL || $payment == NULL)
{
echo '<div class="entry"><strong>All of the required fields were not filled out. Please try again.</strong></div>';
} else {
$insert = "INSERT INTO `conf_contact_information` (firstname, lastname, email, tel1, tel2, tel3, password, shirt, allergytext, housing, chapter1, chapter2, chapter3, guests, payment, reg_date, reg_time) VALUES('$fname','$lname', '$email', '$tel1', '$tel2', '$tel3', '$password', '$shirt', '$allergytext', '$housing', '$chapter1', '$chapter2', '$chapter3', '$guests', '$payment', '$reg_date', '$reg_time')";
Consider simplifying this complex logical expression. Open
if (isset($dev) && ($dev == 1)){
echo("This page is under development right now, call me if you absolutely need to record attendance.");
}
elseif (isset($_POST['new']) && ('process' == $_POST['new'])) {
process_new();
Consider simplifying this complex logical expression. Open
else if ($description == 'Ray Miller' ||$description == 'Twin Pines' ||$description == 'Humane Society' ||$description == 'Adair Co. Library' ||$description == 'Recycling Center' ||$description == 'Bought Hours' ||$description == 'Camp' ||$description == 'Bake sale' ||$description == 'Large Service Project' ||$description == 'Other Service Project' ||$description == 'Non-APO Hours') {
$result = "<div class='entry'>The description cannot be the same as the event. Please enter a valid description so that exec can verify that you did the service hours. <br/></div>";
}
else {
$insert = "insert into apo.recorded_hours (user_id, event, month, day, year, date, description, hours, servicetype, fundraising, semester) values('$id', '$event', '$month','$day', '$year', '$date', '$description', '$hours', '$servicetype', '$fundraising', '$semester');";
Function check_hours
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function check_hours() {
include ('mysql_access.php');
//$sql = "SELECT id FROM contact_information WHERE status = 'Active' OR status = 'Pledge' OR status = 'Elected' OR status = 'Appointed'";
//$users = $db->query($sql);
- 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 process_login
has 56 lines of code (exceeds 25 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);
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 vars_form
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
function vars_form() {
include ('mysql_access.php');
?>
<div class="small-12 columns">
<h1>Change Session Vars</h1>
Function events
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
events : function (scope) {
var self = this,
S = self.S;
S(this.scope)
Function show
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
show : function (el, css) {
// is modal
if (css) {
var settings = el.data(this.attr_name(true) + '-init');
if (el.parent('body').length === 0) {
Method displayActive
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function displayActive($i){
include('mysql_access.php');
$message = array("Past: ","Present: ","Cancelled: ");
//echo $i;
Method show_active
has 52 lines of code (exceeds 25 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;
File service_leader_functions.php
has 253 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
function refresh(){
echo("<meta http-equiv=\"REFRESH\" content=\"0;url=service_leader_dashboard.php\">");
}
Function open
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
open : function (target, ajax_settings) {
var self = this;
if (target) {
if (typeof target.selector !== 'undefined') {
var modal = self.S('#' + target.data(self.data_attr('reveal-id')));
Method recorded_hours
has 50 lines of code (exceeds 25 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.