Showing 419 of 572 total issues
Function TilinPattern_createPatternCanvas
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
createPatternCanvas: function TilinPattern_createPatternCanvas(owner) {
var operatorList = this.operatorList;
var bbox = this.bbox;
var xstep = this.xstep;
var ystep = this.ystep;
Function CanvasExtraStateClosure
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
var CanvasExtraState = (function CanvasExtraStateClosure() {
function CanvasExtraState(old) {
// Are soft masks and alpha values shapes or opacities?
this.alphaIsShape = false;
this.fontSize = 0;
Function defaultFormatter
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
defaultFormatter: function(row, cell, value, columnDef, data) {
user = data.email;
asmt = columnDef.name;
submission_status_key = columnDef.field + "_submission_status"
Function init
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function (data, options) {
var s = this;
// don't allow multiple calls
if (s.d.data) {
Method parse_csv_row
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_csv_row(row, kind, problems, emails)
row = row.dup
email = row.shift.to_s
data = row.shift problems.count
Method visual_run
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def visual_run
action = Scheduler.find(params[:scheduler_id])
# https://stackoverflow.com/a/1076445
read, write = IO.pipe
@log = "Executing #{Rails.root.join(action.action)}\n"
Method backwards_compatibility
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def backwards_compatibility(props)
GENERAL_BC.each do |old, new|
next unless props["general"].key?(old)
props["general"][new] = props["general"][old] unless new.nil?
- 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 csv_row_for
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def csv_row_for(asmt, cud, as_seen_by)
aud = AssessmentUserDatum.get asmt.id, cud.id
throw "csv_row_for: no AUD for (#{asmt.id}, #{cud.id})" unless aud
# create csv row with latest submission time and user email (first and second columns)
- 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 index
has a Cognitive Complexity of 12 (exceeds 5 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
- 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 facebook
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def facebook
if user_signed_in?
# add this authentication object to current user
if (data = request.env["omniauth.auth"]) && current_user.authentications.where(provider: data["provider"],
uid: data["uid"]).empty?
- 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 stats_for_grader
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def stats_for_grader(submissions)
result = []
problem_id_to_name = @assessment.problem_id_to_name
stats = Statistics.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 sendJob_AddHTMLMessages
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def sendJob_AddHTMLMessages(course, assessment, submissions)
# Check for nil first, since students should know about this
flash[:error] = "Submission could not be autograded due to an error in creation" && return if submissions.blank?
begin
- 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 authorize_user_for_course
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def authorize_user_for_course
redirect_to(root_path) && return if current_user.nil?
uid = current_user.id
# don't allow sudoing across courses
- 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 autograde_done
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def autograde_done
@assessment = @course.assessments.find_by(name: params[:name])
head(:no_content) && return unless @assessment && @assessment.has_autograder?
ASSESSMENT_LOGGER.setAssessment(@assessment)
- 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 Mesh_fromIR
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
fromIR: function Mesh_fromIR(raw) {
//var type = raw[1];
var coords = raw[2];
var colors = raw[3];
var figures = raw[4];
Method external_javascript_include_tag
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def external_javascript_include_tag(library)
cloudflare = "//cdnjs.cloudflare.com/ajax/libs"
# Update versions manually as-and-when newer versions become available on the CDN
case library
Method colspec_is_well_formed
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def colspec_is_well_formed
# An empty spec is OK
return if colspec.blank?
# The parse will throw an exception if the string has a JSON syntax error
Function initSmaskGL
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initSmaskGL() {
var canvas, gl;
generateGL();
canvas = currentCanvas;
Function get_buttons_html
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_buttons_html(user_id, tab, archived_instances) {
var archived_icon = (user_id in archived_instances) ?
`<div class="left ui icon" data-content="Student also appears in archived">
<i class="exclamation circle icon"></i>
</div>` : "";
Function plot_diagram
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
var plot_diagram = function(pool) {
current_plot = pool;
var title = "Job Runtime History for ";
title += pool == '' ? "Global" : pool;
MG.data_graphic({