Showing 75 of 2,705 total issues
File database.py
has 1712 lines of code (exceeds 250 allowed). Consider refactoring. Open
'''
database.py
Contains functions that directly communicate with or manipulate the database
'''
import hashlib
Function validate_input
has a Cognitive Complexity of 102 (exceeds 5 allowed). Consider refactoring. Open
def validate_input(input_data, input_types, is_future=False,
aysem_specific=True, attr_required=True, show_404=True):
'''
Validates that the GET input data (in the URL) is valid.
- 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 POST
has a Cognitive Complexity of 97 (exceeds 5 allowed). Consider refactoring. Open
def POST(self, *test_data):
'''
Handles the editing operations for all mountings and quotas
'''
if test_data:
- 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 GET
has a Cognitive Complexity of 88 (exceeds 5 allowed). Consider refactoring. Open
def GET(self, *test_data):
'''
Renders the oversubscribed modules page if users requested
for the page through the GET method.
'''
- 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 POST
has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring. Open
def POST(self, *received_data):
'''
POST method will check the type of action executed by the user,
and display the corresponding message based on the execution's outcome.
'''
- 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 csmodify.js
has 558 lines of code (exceeds 250 allowed). Consider refactoring. Open
/****************************************************************/
/* =============== CS-MODIFY JAVASCRIPT FILE ================== */
/* This file serves as the central javascript source for all the*/
/* custom-defined animations or interactions on the page. */
/****************************************************************/
File helper.py
has 478 lines of code (exceeds 250 allowed). Consider refactoring. Open
'''
helper.py
Contains functions that process and/or manipulate data that are OUTSIDE the database
'''
Function onload
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.onload = function () {
studentYearBarChart = new CanvasJS.Chart("module-view-student-year-bar-chart",
{
animationEnabled: true,
axisY: {
Function onload
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.onload = function () {
var chart = new CanvasJS.Chart("quota-demand-chart",
{
animationEnabled: true,
Function onload
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.onload = function () {
studentYearBarChart = new CanvasJS.Chart("enrollment-student-year-bar-chart",
{
animationEnabled: true,
axisY: {
Function edit_prerequisite
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def edit_prerequisite(module_code, prereq_units):
'''
Changes the prerequisites of given module_code into a new
set of prerequisites found in prereq_units.
Returns true if successful, false otherwise.
- 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 replaceNilQuotasWithNumbers
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
function replaceNilQuotasWithNumbers(elementID){
var table = $(elementID).DataTable();
var data = table
.rows()
.data();
- 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 POST
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def POST(self):
'''
Handles the submission of the 'Edit Specific Module Info' page
'''
input_data = model.validate_input(web.input(), ["code", "aysem"],
- 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 edit_preclusion
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def edit_preclusion(module_code, preclude_units):
'''
Changes the preclusions of given module_code into a new
set of preclusions found in preclude_units.
Returns true if successful, false otherwise.
- 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 get_modules_with_modified_quota
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def get_modules_with_modified_quota(self):
'''
Get all modules whose quota has been modified in a future AY.
Return the module code, module name, current AY-Sem, target AY-Sem,
current AY-Sem's quota, target AY-Sem's quota, and quota change
- 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 populate_module_ay_sem_data
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def populate_module_ay_sem_data(self, selected_ay):
'''
Populate each subplan with sem 1 and sem 2 mounting values
'''
tenta_full_mounting_plan = self.full_mounting_plan
- 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 load_mounting_info
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def load_mounting_info(self, module_code, ay_sem):
'''
Load the mounting status and quota of the target module and AY/Sem
'''
fixed_mounting_status = -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
Function load_tenta_mounting_plan
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def load_tenta_mounting_plan(self, module_code):
'''
Loads the tentative mounting plan of the single module
'''
tenta_mounting_and_quota = model.get_tenta_mounting_and_quota(module_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 GET
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def GET(self):
'''
Renders the modified modules page if users requested
for the page through the GET method.
'''
- 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 POST
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def POST(self, *test_data):
'''
Handles the restoration of module info
'''
if test_data: # for testing purposes
- 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"