Showing 419 of 572 total issues
Method gradebook_columns
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def gradebook_columns(matrix, course)
# user info columns
columns = [
{ id: "number", name: "#", field: "", width: 50 },
{ id: "email", name: "Email", field: "email",
Function handleScroll
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function handleScroll() {
scrollTop = $viewport[0].scrollTop;
scrollLeft = $viewport[0].scrollLeft;
var vScrollDist = Math.abs(scrollTop - prevScrollTop);
var hScrollDist = Math.abs(scrollLeft - prevScrollLeft);
Function comparator
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
var comparator = function(nodeA, nodeB) {
var a = $.trim($(nodeA).text()).toLowerCase();
var b = $.trim($(nodeB).text()).toLowerCase();
var result;
Method leave
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def leave
if !@assessment.allow_student_assign_group && @cud.student?
flash[:error] = "You are not allowed to change your group for this assessment. "\
"Contact your instructor for group assignment."
redirect_to(action: :index) && return
Method save_entries
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def save_entries(entries, data_type)
asmt = @assessment
begin
User.transaction do
Function enableSubmit
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function enableSubmit() {
var checkbox = document.getElementById("integrity_checkbox");
var tab = $(".submission-panel .ui.tab.active").attr('id');
var fileSelector = $("#handin_show_assessment input[type='file']").get(0);
if (tab === "github_tab") {
- 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 extend_config_module
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def extend_config_module(assessment, submission, cud)
# autograde core calls might be called before migration to unique module name occurs, so need to add check
begin
if @assessment.use_unique_module_name
require assessment.unique_config_file_path
- 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 import
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def import
ass = @course.assessments.find(params[:ass])
if !ass
flash[:error] = "Assessment not found."
redirect_to(action: :index) && return
- 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 WorkerTransport
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function WorkerTransport(workerInitializedCapability, pdfDataRangeTransport) {
this.pdfDataRangeTransport = pdfDataRangeTransport;
this.workerInitializedCapability = workerInitializedCapability;
this.commonObjs = new PDFObjects();
Function showFiles
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showFiles() {
var fileSelector = $("#handin_show_assessment input[type='file']").get(0);
var file = fileSelector.files[0];
$("#handin-file-name").text(file.name);
Function fixIE
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
fixIE: function () {
var s = this, p = s.o.position;
// simulate fixed position - adapted from BlockUI
$.each([s.d.iframe || null, !s.o.modal ? null : s.d.overlay, s.d.container.css('position') === 'fixed' ? s.d.container : null], function (i, el) {
Method parse_members_data
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_members_data(lcd, members_data)
cuds = @course.course_user_data.all.to_set
email_to_cud = {}
cuds.each do |cud|
email_to_cud[cud.user.email] = cud
Function finishInitialization
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function finishInitialization() {
if (!initialized) {
initialized = true;
viewportW = parseFloat($.css($container[0], "width", true));
Function template
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
var template = function (text) {
var matcher = new RegExp('<%=([\\s\\S]+?)%>|<%([\\s\\S]+?)%>|$', 'g');
var escapes = {
"'": "'",
Method oidc_login
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def oidc_login
unless File.size?("#{Rails.configuration.config_location}/lti_config.yml")
raise LtiError.new("LTI configuration not found on Autolab Server", :internal_server_error)
end
Method formatRawJob
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def formatRawJob(rjob, is_live)
job = {}
job[:rjob] = rjob
job[:id] = rjob["id"]
job[:name] = rjob["name"]
Method update_config
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_config
required_params = %w[iss developer_key auth_url oauth2_access_token_url]
required_params.each do |param|
if params[param].blank?
flash[:error] = "#{param} field was missing"
Function handler
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
handler: function( event ){
// read the data before hijacking anything
var dd = event.data;
// handle various events
switch ( event.type ){
Method gradebook_rows
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def gradebook_rows(matrix, course, section = nil, lecture = nil)
rows = []
course.course_user_data.each do |cud|
next unless matrix.has_cud? cud.id
Method sanitize_directories
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.sanitize_directories(files)
cleaned_files = []
file_path_set = Set[]