Showing 6 of 29 total issues
Function assignUpload
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function assignUpload() {
var subName = getUrlParameter("name");
var assignmentTitle = document.getElementById("assignTitle").value;
- Create a ticketCreate a ticket
Function displaySubFunc
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function displaySubFunc() {
$.ajax(
{
url: "/api/submissions",
type: "GET",
- Create a ticketCreate a ticket
Function subUploadFunc
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function subUploadFunc() {
var file = document.getElementById("subFile").files[0];
//create formdata object
var formData = new FormData();
- Create a ticketCreate a ticket
Function studentUpload
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function studentUpload() {
//console.log("student upload btn clicked");
var file = document.getElementById("fileInput").files[0];
//create formdata object
- Create a ticketCreate a ticket
Function displaySubFunc
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
function displaySubFunc() {
$.ajax(
{
url: "/api/submissions",
type: "GET",
- Read upRead up
- Create a ticketCreate a ticket
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 getUrlParameter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
sURLVariables = sPageURL.split("&"),
sParameterName,
i;
- Read upRead up
- Create a ticketCreate a ticket
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"