Showing 419 of 572 total issues
Function plotTimeSeries
has 59 lines of code (exceeds 25 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++) {
File scoreboards_controller.rb
has 265 lines of code (exceeds 250 allowed). Consider refactoring. Open
class ScoreboardsController < ApplicationController
before_action :set_assessment
before_action :set_assessment_breadcrumb
before_action :set_edit_assessment_breadcrumb, only: [:edit]
before_action :set_scoreboard, except: [:create]
File jobs_controller.rb
has 264 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "cgi"
require "uri"
require "tango_client"
##
Function getDocument
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
PDFJS.getDocument = function getDocument(src,
pdfDataRangeTransport,
passwordCallback,
progressCallback) {
var task = new PDFDocumentLoadingTask();
Method request_access_token
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def request_access_token
# get private key from JSON file to sign Autolab's client assertion as a JWK
unless File.size?("#{Rails.configuration.config_location}/lti_tool_jwk.json")
flash[:error] = "Autolab's JWK JSON file was not found"
redirect_to([:users, @course]) && return
File metricsgraphics_brushing.js
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define(['d3', 'jquery', 'MG'], factory);
} else if (typeof exports === 'object') {
module.exports = factory(require('d3'), require('jquery'), require('MG'));
Function PDFObjectsClosure
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
var PDFObjects = (function PDFObjectsClosure() {
function PDFObjects() {
this.objs = {};
}
Function SVGGraphics_showText
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
showText: function SVGGraphics_showText(glyphs) {
var current = this.current;
var font = current.font;
var fontSize = current.fontSize;
Method log_submit
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def log_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}"
Method update_watchlist_configuration_for_course
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def self.update_watchlist_configuration_for_course(course_name, blocklist_update, allow_ca)
# Make sure the course exists
course = Course.find_by(name: course_name)
raise "Course #{course_name} cannot be found" if course.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 validateHandinForGroups
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def validateHandinForGroups
return :valid unless @assessment.has_groups?
submitter_aud = @assessment.aud_for(@cud.id)
return :valid unless submitter_aud
- 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 parse_csv_row
has a Cognitive Complexity of 17 (exceeds 5 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
- 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 17 (exceeds 5 allowed). Consider refactoring. Open
def index
path = params[:path].nil? ? "" : params[:path]
new_url = "#{path}/"
parts = new_url.split('/')
if parts.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
Function FontFaceObjectClosure
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
var FontFaceObject = (function FontFaceObjectClosure() {
function FontFaceObject(name, file, properties) {
this.compiledGlyphs = {};
if (arguments.length === 1) {
// importing translated data
Function MessageHandler
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
function MessageHandler(name, comObj) {
this.name = name;
this.comObj = comObj;
this.callbackIndex = 1;
this.postMessageTransfers = true;
Function StatTimerClosure
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
var StatTimer = (function StatTimerClosure() {
function rpad(str, pad, length) {
while (str.length < length) {
str += pad;
}
Function CanvasGraphics_paintInlineImageXObject
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
function CanvasGraphics_paintInlineImageXObject(imgData) {
var width = imgData.width;
var height = imgData.height;
var ctx = this.ctx;
Function setupColumnSort
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setupColumnSort() {
$headers.click(function (e) {
// temporary workaround for a bug in jQuery 1.7.1 (http://bugs.jquery.com/ticket/11328)
e.metaKey = e.metaKey || e.ctrlKey;
Function handleKeyDown
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
function handleKeyDown(e) {
trigger(self.onKeyDown, {row: activeRow, cell: activeCell}, e);
var handled = e.isImmediatePropagationStopped();
if (!handled) {
Function set_tab_html
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
function set_tab_html(is_search, instances, tab_name, archived_instances, empty_message, selected_user_ids) {
is_empty = Object.keys(instances).length === 0;
if (is_empty && !is_search){
$(`#${tab_name}_header`).hide();
html_empty_message = get_html_empty_message(empty_message);