Showing 419 of 572 total issues
Function absBox
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function absBox(elem) {
var box = {
top: elem.offsetTop,
left: elem.offsetLeft,
bottom: 0,
Function enableSubmit
has 29 lines of code (exceeds 25 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") {
Method tango_poll
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def tango_poll(course, assessment, submissions, output_file)
feedback = nil
begin
Timeout.timeout(80) do
loop do
Method validate_jwt_signature
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def validate_jwt_signature(id_token)
# use JWK URL over file
if !@lti_config_hash["platform_public_jwks_url"].nil? &&
@lti_config_hash["platform_public_jwks_url"].present?
# fetch JWKS from provided keys URL
Function close
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
close: function () {
var s = this;
// prevent close when dialog does not exist
if (!s.d.data) {
Method create
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create
require_params([:groups])
if @assessment.group_size <= 1
raise ApiError.new("Group size of assessment is currently 1,"\
Method add
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add
if !@assessment.allow_student_assign_group && @cud.student?
flash[:error] = "You are not allowed to add members to your group for this assessment. "\
"Contact your instructor for group assignment."
redirect_to(action: :index) && return
Method regradeAll
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def regradeAll
# Grab all of the submissions for this assessment
@submissions = @assessment.submissions.where(special_type: Submission::NORMAL)
.order("version DESC")
Method run_scheduler
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run_scheduler
current_time = Time.current
actions = Scheduler.where("next < ? AND ? <= until AND disabled is false", current_time,
current_time)
actions.each do |action|
Function PDFPageProxy_getOperatorList
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
getOperatorList: function PDFPageProxy_getOperatorList() {
function operatorListChanged() {
if (intentState.operatorList.lastChunk) {
intentState.opListReadCapability.resolve(intentState.operatorList);
}
Function SVGExtraState
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function SVGExtraState() {
this.fontSizeScale = 1;
this.fontWeight = SVG_DEFAULTS.fontWeight;
this.fontSize = 0;
Function downloadSelected
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function downloadSelected(path) {
return new Promise(function(resolve, reject) {
$.ajax({
url: '/file_manager/download_tar/',
type: "POST",
Method index
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def index
# Instance variables that will be used by the view
@running_jobs = [] # running jobs
@waiting_jobs = [] # jobs waiting in job queue
@dead_jobs = [] # dead jobs culled from dead job queue
Method regradeBatch
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def regradeBatch
submission_ids = params[:submission_ids]
# Now regrade only the most recent submissions. Keep track of
# any handins that fail.
Method emitColSpec
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def emitColSpec(colspec)
return "Empty column specification" if colspec.blank?
begin
# Quote JSON keys and values if they are not already quoted
Method createScoreboardEntry
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def createScoreboardEntry(scores, autoresult)
# If the assessment was not autograded or the scoreboard was
# not customized, then simply return the list of problem
# scores and their total.
if !autoresult ||
Method create
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def create
@attachment = if @is_assessment
@course.attachments.new(assessment_id: @assessment.id)
else
@course.attachments.new
- 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 show
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def show
if @cud.instructor? || @attachment.released?
begin
attached_file = @attachment.attachment_file
if attached_file.attached?
- 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 load_dir_to_tar
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def load_dir_to_tar(dir_path, asmt_dir, tar, filters = [], export_dir = "")
Dir[File.join(dir_path, asmt_dir, "**")].each do |file|
mode = File.stat(file).mode
relative_path = file.sub(%r{^#{Regexp.escape dir_path}/?}, "")
export_path = if export_dir == ""
- 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 defaultFormatter
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
defaultFormatter: function(row, cell, value, columnDef, data) {
user = data.email;
asmt = columnDef.name;
submission_status_key = columnDef.field + "_submission_status"
- 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"