Showing 62 of 105 total issues
File wordlist.php
has 3913 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
English worldlist sourced from http://wordlist.aspell.net/ file: english-words.10
Removed one and two-letter words, as well as words with apostrophies.
Function display_search_results
has a Cognitive Complexity of 135 (exceeds 5 allowed). Consider refactoring. Open
function display_search_results($id, $results, $extra_info = null)
{
echo '<div class="search_results">';
if (sizeof($results) > 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 form_ajax_search
has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring. Open
function form_ajax_search($id)
{
echo '
<form id="ajax_search" onsubmit="return false;">
<label for="search_box">Search</label>
- 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 help.php
has 722 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
require_once "../modules/constants.php";
$restrictionCode = PUBLIC_ACCESS;
require_once "../modules/init.php";
Function auto_complete_keyboard_controls
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
function auto_complete_keyboard_controls(event)
{
var autoCompleteBox = event.currentTarget.parentNode.getElementsByClassName('auto_complete_box')[0];
var selected = document.getElementById('auto_complete_selected');
if (event.key === "Tab" || event.keyCode === 9 ||
- 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 build_timetable
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
function build_timetable($contents, $include_link = TT_LINK_NONE,
$start_schedule = START_SCHEDULE, $end_schedule = END_SCHEDULE)
{
$table = array();
$days = get_all_days();
- 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 lists.php
has 305 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
display_search_results:
id: type of results to display
results: results of search
File forms.php
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
form_ajax_search:
id: type of records to search for.
Builds AJAX search field and search results box.
Function search_page
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
function search_page(pageNumber, resultsBox)
{
resultsBox.classList.remove('view_all');
var currentPage = resultsBox.getElementsByClassName('page_' + pageNumber)[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
Method display_search_results
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
function display_search_results($id, $results, $extra_info = null)
{
echo '<div class="search_results">';
if (sizeof($results) > 0)
{
Function build_sidebar
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
function build_sidebar($sidebar_data, $source)
{
$result = '';
$has_current = false;
foreach ($sidebar_data as $name => $address)
- 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 auto_complete_keyboard_controls
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
function auto_complete_keyboard_controls(event)
{
var autoCompleteBox = event.currentTarget.parentNode.getElementsByClassName('auto_complete_box')[0];
var selected = document.getElementById('auto_complete_selected');
if (event.key === "Tab" || event.keyCode === 9 ||
Function reset_form
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function reset_form(form)
{
var casings;
casings = form.getElementsByClassName('text_box_casing');
- 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 ajax_submit
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function ajax_submit(form)
{
var ajaxRequest;
if (window.XMLHttpRequest)
ajaxRequest = new XMLHttpRequest();
- 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 format_timetable_cell
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function format_timetable_cell($class, $include_link)
{
$output = '';
if (isset($class['course_code']))
$output .= '<span class="course_code">'.$class['course_code'].'</span>';
- 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 reset_form
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function reset_form(form)
{
var casings;
casings = form.getElementsByClassName('text_box_casing');
Method build_timetable
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
function build_timetable($contents, $include_link = TT_LINK_NONE,
$start_schedule = START_SCHEDULE, $end_schedule = END_SCHEDULE)
{
$table = array();
$days = get_all_days();
Function login
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function login($email, $password)
{
global $conn;
$stmt = $conn->prepare('SELECT password, role_id, force_new_password FROM tbl_users WHERE :email = email');
$stmt->bindValue(':email', $email);
- 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 parse_course_code
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function parse_course_code($course_code)
{
$course_code_1 = "";
$course_code_2 = "";
- 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 ajax_submit
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ajax_submit(form)
{
var ajaxRequest;
if (window.XMLHttpRequest)
ajaxRequest = new XMLHttpRequest();