Showing 419 of 572 total issues
Function gotoNext
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function gotoNext(row, cell, posX) {
if (row == null && cell == null) {
row = cell = posX = 0;
if (canCellBeActive(row, cell)) {
return {
Function updateColumnHeader
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateColumnHeader(columnId, title, toolTip) {
if (!initialized) { return; }
var idx = getColumnIndex(columnId);
if (idx == null) {
return;
Method sendJob
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def sendJob(course, assessment, submissions, cud)
extend_config_module(assessment, submissions[0], cud)
# Get the autograding properties for this assessment.
@autograde_prop = assessment.autograder
Method create
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create
@attachment = if @is_assessment
@course.attachments.new(assessment_id: @assessment.id)
else
@course.attachments.new
Function drawTriangle
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
function drawTriangle(data, context, p1, p2, p3, c1, c2, c3) {
Method csv_header
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def csv_header(matrix, course)
header = %w(Email first_name last_name Lecture Section School Major Year grace_days_used penalty_late_days)
course.assessment_categories.each do |cat|
next unless matrix.has_category? cat
- 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 get_public_key
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get_public_key(platform_public_key_file, platform_public_jwks)
# import public key depending on whether we have a JSON file
# with a single JWK or list of JWKs
if !platform_public_key_file.nil?
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 gradesheet_csv
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def gradesheet_csv(asmt, as_seen_by)
CSV.generate do |csv|
# title row with the column names:
title = ["Submission Time","Email","Total"]
asmt.problems.each { |problem| title << problem.name }
- 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 plotTimeSeries
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
var plotTimeSeries = function(data) {
// Initialize Dataset
var new_jobs = data[0];
var eventarr = [];
for (var i = 0; i < new_jobs.dates.length; i++) {
- 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 gradebook_columns
has a Cognitive Complexity of 9 (exceeds 5 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",
- 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 applied_value
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.applied_value(adj, score, multiplier)
raise ArgumentError, "ScoreAdjustment.applied_value: score was nil" if score.nil?
if adj.nil?
0.0
- 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 tango_poll
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def tango_poll(course, assessment, submissions, output_file)
feedback = nil
begin
Timeout.timeout(80) do
loop do
- 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 matrix!
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def matrix!
cell_by_asmt = {}
cat_avg_by_cat = {}
course_avg_by_user = {}
- 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 submit
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def submit
if @assessment.embedded_quiz
raise ApiError.new("Assessment is an embedded quiz", :bad_request)
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 download_tar
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def download_tar
path = params[:path]&.split("/")&.drop(2)&.join("/")
path = CGI.unescape(path)
absolute_path = check_path_exist(path)
return unless check_instructor(absolute_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 bulkGrade_complete
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def bulkGrade_complete
redirect_to(action: :bulkGrade) && return unless request.post?
# retrieve entries CSV from hidden field in form
csv = params[:confirm][:bulkGrade_csv]
- 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 handle_exceptions
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.handle_exceptions
begin
retries_remaining ||= NUM_RETRIES
resp = yield
rescue Net::OpenTimeout, Net::ReadTimeout, Timeout::Error,
- 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 clipBbox
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
clipBbox: function clipBbox(graphics, bbox, x0, y0, x1, y1) {
Avoid deeply nested control flow statements. Open
if (x && c.maxWidth && (c.maxWidth - c.previousWidth < x)) {
x -= c.maxWidth - c.previousWidth;
c.width = c.maxWidth;
} else {
c.width = c.previousWidth + x;
Function setCharWidthAndBounds
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
setCharWidthAndBounds: function CanvasGraphics_setCharWidthAndBounds(xWidth,
yWidth,
llx,
lly,
urx,