Showing 419 of 572 total issues
Method create
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create
if !@assessment.allow_student_assign_group && @cud.student?
flash[:error] = "You are not allowed to self-assign group for this assessment. "\
"Contact your instructor for group assignment."
redirect_to(action: :new) && return
Method handout
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def handout
# If the logic here changes, do update assessment#has_handout?
begin
extend_config_module(@assessment, nil, @cud)
rescue StandardError => e
Function fontLoaderBind
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
bind: function fontLoaderBind(fonts, callback) {
assert(!isWorker, 'bind() shall be called from main thread');
var rules = [];
var fontsToLoad = [];
Function Uint32ArrayViewClosure
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Uint32ArrayView = (function Uint32ArrayViewClosure() {
function Uint32ArrayView(buffer, length) {
this.buffer = buffer;
this.byteLength = buffer.length;
Function setActiveCellInternal
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setActiveCellInternal(newCell, opt_editMode) {
if (activeCellNode !== null) {
makeActiveCellNormal();
$(activeCellNode).removeClass("active");
if (rowsCache[activeRow]) {
Function appendRowHtml
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function appendRowHtml(stringArray, row, range, dataLength) {
var d = getDataItem(row);
var dataLoading = row < dataLength && !d;
var rowCss = "slick-row" +
(dataLoading ? " loading" : "") +
Method index
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def index
path = params[:path].nil? ? "" : params[:path]
new_url = "#{path}/"
parts = new_url.split('/')
if parts.empty?
Method statistics
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def statistics
load_course_config
latest_submissions = @assessment.submissions.latest_for_statistics.includes(:scores, :course_user_datum)
#latest_submissions = @assessment.submissions.latest.includes(:scores, :course_user_datum)
Function CanvasGraphics_setFont
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
setFont: function CanvasGraphics_setFont(fontRefName, size) {
var fontObj = this.commonObjs.get(fontRefName);
var current = this.current;
if (!fontObj) {
Function setupColumnReorder
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setupColumnReorder() {
$headers.filter(":ui-sortable").sortable("destroy");
$headers.sortable({
containment: "parent",
distance: 3,
Function syncGridCellCssStyles
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function syncGridCellCssStyles(grid, key) {
var hashById;
var inHandler;
// since this method can be called after the cell styles have been set,
Function renderRows
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderRows(range) {
var parentNode = $canvas[0],
stringArray = [],
rows = [],
needToReselectCell = false,
Function runHandlers
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
runHandlers: function runHandlers() {
var RUN_TIMEOUT = 1; // ms
var timeoutAt = Date.now() + RUN_TIMEOUT;
while (this.handlers.length > 0) {
var handler = this.handlers.shift();
Function CanvasGraphics_fill
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
fill: function CanvasGraphics_fill(consumePath) {
consumePath = typeof consumePath !== 'undefined' ? consumePath : true;
var ctx = this.ctx;
var fillColor = this.current.fillColor;
var isPatternFill = this.current.patternFill;
Function gotoPrev
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function gotoPrev(row, cell, posX) {
if (row == null && cell == null) {
row = getDataLengthIncludingAddNew() - 1;
cell = posX = columns.length - 1;
if (canCellBeActive(row, cell)) {
Function buttons
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
buttons : function(settings, original) {
var form = this;
if (settings.submit) {
/* if given html string use that */
if (settings.submit.match(/>$/)) {
Method sendJob_batch
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def sendJob_batch(course, assessment, submissions, cud)
failed_list = []
submissions.each do |submission|
if submission
- 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 computed_score
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def computed_score(link = nil, nil_to_dash = true)
value = yield
value = value ? value.round(1) : value
nil_to_dash && (value.nil?) ? raw("–") : value
rescue ScoreComputationException => e
- 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 google_oauth2
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def google_oauth2
if user_signed_in?
if (data = request.env["omniauth.auth"]) && current_user.authentications.where(provider: data["provider"],
uid: data["uid"]).empty?
current_user.authentications.create(provider: data["provider"],
- 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 student
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def student
@_cud = if params[:id]
CourseUserDatum.find_by(id: params[:id])
else
@cud
- 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"