Showing 419 of 572 total issues
Function pdfDataRangeTransportClosure
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
var PDFDataRangeTransport = (function pdfDataRangeTransportClosure() {
/**
* @constructs PDFDataRangeTransport
* @param {number} length
* @param {Uint8Array} initialData
Method scoreboardOrderSubmissions
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def scoreboardOrderSubmissions(a, b)
# If the assessment is not autograded, or the instructor did
# not create a custom column spec, then revert to the default,
# which sorts by total problem, then by submission time.
if !@assessment.has_autograder? ||
- 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 CanvasGraphics_showType3Text
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
showType3Text: function CanvasGraphics_showType3Text(glyphs) {
// Type3 fonts - each glyph is a "mini-PDF"
var ctx = this.ctx;
var current = this.current;
var font = current.font;
Function PageViewport
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function PageViewport(viewBox, scale, rotation, offsetX, offsetY, dontFlip) {
this.viewBox = viewBox;
this.scale = scale;
this.rotation = rotation;
this.offsetX = offsetX;
Function PDFDocumentProxyClosure
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
var PDFDocumentProxy = (function PDFDocumentProxyClosure() {
function PDFDocumentProxy(pdfInfo, transport) {
this.pdfInfo = pdfInfo;
this.transport = transport;
}
Method submit
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
def submit
if @assessment.embedded_quiz
raise ApiError.new("Assessment is an embedded quiz", :bad_request)
end
Method stats_for_grader
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def stats_for_grader(submissions)
result = []
problem_id_to_name = @assessment.problem_id_to_name
stats = Statistics.new
Function showMenu
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showMenu(e) {
var $menuButton = $(this);
var menu = $menuButton.data("menu");
var columnDef = $menuButton.data("column");
Function createMeshCanvas
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createMeshCanvas(bounds, combinesScale, coords, colors, figures,
backgroundColor) {
// we will increase scale on some weird factor to let antialiasing take
// care of "rough" edges
var EXPECTED_SCALE = 1.1;
Method update_latest
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_latest
require_params([:problems])
cud = get_cud params
aud = AssessmentUserDatum.find_by(assessment_id: @assessment.id, course_user_datum_id: cud.id)
Method deserialize
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def deserialize(s)
unless s["general"]
raise "General section missing in yaml"
end
- 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 quickSetScore
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def quickSetScore
return unless request.post?
return unless params[:submission_id]
return unless params[:problem_id]
- 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 add
has a Cognitive Complexity of 15 (exceeds 5 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
- 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 quickSetScoreDetails
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def quickSetScoreDetails
return unless request.post?
return unless params[:submission_id]
return unless params[:problem_id]
# get submission and problem IDs
- 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 bulkGrade
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def bulkGrade
return unless request.post?
# part 1: submitting a CSV for processing and returning errors in CSV
if params[:upload]
- 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 CanvasGraphics_paintChar
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
paintChar: function CanvasGraphics_paintChar(character, x, y) {
var ctx = this.ctx;
var current = this.current;
var font = current.font;
var textRenderingMode = current.textRenderingMode;
Method extend_config_module
has 47 lines of code (exceeds 25 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
Function updateRowCount
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateRowCount() {
var dataLength = getDataLength();
if (!initialized) { return; }
numberOfRows = getDataLengthIncludingAddNew() +
(options.leaveSpaceForNewRows ? numVisibleRows - 1 : 0);
Function CanvasGraphics_executeOperatorList
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
executeOperatorList: function CanvasGraphics_executeOperatorList(
operatorList,
executionStartIdx, continueCallback,
stepper) {
var argsArray = operatorList.argsArray;
Function hijack
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
hijack: function( event, type, dd, x, elem ){
// not configured
if ( !dd )
return;
// remember the original event and type