Showing 419 of 572 total issues
Function AutoColumnSize
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
function AutoColumnSize(maxWidth) {
var grid, $container, context,
keyCodes = {
'A': 65
Method saveAutograde
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def saveAutograde(submissions, feedback)
begin
# Set job id to nil to indicate that autograding is no longer in-progress
ActiveRecord::Base.transaction do
submissions.each do |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
File jquery.jeditable.js
has 363 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* Jeditable - jQuery in place edit plugin
*
* Copyright (c) 2006-2009 Mika Tuupola, Dylan Verheul
*
Method show
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
def show
# It turns out that it's faster to just get everything and let the
# view handle it
problemQuery = "SELECT scores.score AS score,
submissions.version AS version,
Method gradebook_rows
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def gradebook_rows(matrix, course, section = nil, lecture = nil)
rows = []
course.course_user_data.each do |cud|
next unless matrix.has_cud? cud.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 shibboleth
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def shibboleth
if user_signed_in?
if (data = request.env["omniauth.auth"]) && current_user.authentications.where(provider: "CMU-Shibboleth",
uid: data["uid"]).empty?
current_user.authentications.create(provider: "CMU-Shibboleth",
- 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 local_submit
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
def local_submit
@user = User.find_by(email: params[:user])
@cud = @user ? @course.course_user_data.find_by(user_id: @user.id) : nil
unless @cud
err = "ERROR: invalid username (#{params[:user]}) for class #{@course.id}"
Function CanvasGraphics_showText
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
showText: function CanvasGraphics_showText(glyphs) {
var current = this.current;
var font = current.font;
if (font.isType3Font) {
return this.showType3Text(glyphs);
Function drawFigures
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawFigures(width, height, backgroundColor, figures, context) {
if (!figuresCache) {
initFiguresGL();
}
var cache = figuresCache, canvas = cache.canvas, gl = cache.gl;
Function TilingPatternClosure
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
var TilingPattern = (function TilingPatternClosure() {
var PaintType = {
COLORED: 1,
UNCOLORED: 2
};
Method populate_directory
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def populate_directory(current_directory, current_url)
directory = Dir.entries(current_directory)
new_url = current_url == '/' ? '' : current_url
@directory = directory.map do |file|
abs_path_str = "#{current_directory}/#{file}"
- 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 encode
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
function encode(imgData, kind) {
var width = imgData.width;
var height = imgData.height;
var bitDepth, colorType, lineSize;
var bytes = imgData.data;
Method upload_file
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def upload_file(path)
absolute_path = check_path_exist(path)
if Archive.in_dir?(BASE_DIRECTORY, absolute_path, strict: false)
raise "You cannot upload files/create folders in the root directory click " \
"#{view_context.link_to 'here', new_course_url, method: 'get'}" \
- 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 getHtmlElementForTextAnnotation
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getHtmlElementForTextAnnotation(item) {
var rect = item.rect;
// sanity check because of OOo-generated PDFs
if ((rect[3] - rect[1]) < ANNOT_MIN_SIZE) {
Function InternalRenderTaskClosure
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
var InternalRenderTask = (function InternalRenderTaskClosure() {
function InternalRenderTask(callback, params, objs, commonObjs, operatorList,
pageNumber) {
this.callback = callback;
Function putBinaryImageData
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
function putBinaryImageData(ctx, imgData) {
if (typeof ImageData !== 'undefined' && imgData instanceof ImageData) {
ctx.putImageData(imgData, 0, 0);
return;
}
Function addContextCurrentTransform
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
function addContextCurrentTransform(ctx) {
// If the context doesn't expose a `mozCurrentTransform`, add a JS based on.
if (!ctx.mozCurrentTransform) {
// Store the original context
ctx._scaleX = ctx._scaleX || 1.0;
Method saveAutograde
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
def saveAutograde(submissions, feedback)
begin
# Set job id to nil to indicate that autograding is no longer in-progress
ActiveRecord::Base.transaction do
submissions.each do |submission|
Method parse_members_data
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def parse_members_data(lcd, members_data)
cuds = @course.course_user_data.all.to_set
email_to_cud = {}
cuds.each do |cud|
email_to_cud[cud.user.email] = 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"
Further reading
Method tango_plot_data
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
def tango_plot_data(live_jobs = nil, dead_jobs = nil)
live_jobs ||= TangoClient.jobs
dead_jobs ||= TangoClient.jobs(1)
@plot_data = { new_jobs: { name: "New Job Requests", dates: [], job_name: [], job_id: [],
vm_pool: [], vm_id: [], status: [], duration: [] },