Showing 419 of 572 total issues
Function materialize_autocomplete
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.materialize_autocomplete = function (options) {
var el = this;
var $el = $(el).eq(0);
var instance = $el.data('autocomplete');
Consider simplifying this complex logical expression. Open
if ((groupingGetter && (eitherIsNonData = (item.__nonDataRow) || (r.__nonDataRow)) &&
item.__group !== r.__group ||
item.__updated ||
item.__group && !item.equals(r))
|| (aggregators && eitherIsNonData &&
Method save_entries
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def save_entries(entries, data_type)
asmt = @assessment
begin
User.transaction 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
File handin.rb
has 301 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "pathname"
##
# Handles different handin methods, including web form, local_submit and log_submit
#
File application_controller.rb
has 299 lines of code (exceeds 250 allowed). Consider refactoring. Open
class ApplicationController < ActionController::Base
helper :all # include all helpers, all the time
before_action :configure_permitted_parameters, if: :devise_controller?
before_action :maintenance_mode?
Method handin
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def handin
if @assessment.disable_handins?
flash[:error] = "Sorry, handins are disabled for this assessment."
redirect_to(action: :show)
return false
- 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 plotEventDrops
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
var plotEventDrops = function(data) {
var minDates = jQuery.map(data, function(h) {
return Math.min.apply(null, h['dates']);
});
var startTime = new Date(Math.min.apply(null, minDates));
Function PageViewportClosure
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
var PageViewport = PDFJS.PageViewport = (function PageViewportClosure() {
/**
* @constructor
* @private
* @param viewBox {Array} xMin, yMin, xMax and yMax coordinates.
Function SVGGraphics_constructPath
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructPath: function SVGGraphics_constructPath(ops, args) {
var current = this.current;
var x = current.x, y = current.y;
current.path = document.createElementNS(NS, 'svg:path');
var d = [];
Function fontLoaderPrepareFontLoadEvent
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
prepareFontLoadEvent: function fontLoaderPrepareFontLoadEvent(rules,
fonts,
request) {
/** Hack begin */
// There's currently no event when a font has finished downloading so the
Method rename
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def rename
absolute_path = check_path_exist(params[:relative_path])
if check_instructor(absolute_path)
parent = absolute_path.parent
if parent == BASE_DIRECTORY
- 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_beginGroup
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
beginGroup: function CanvasGraphics_beginGroup(group) {
this.save();
var currentCtx = this.ctx;
// TODO non-isolated groups - according to Rik at adobe non-isolated
// group results aren't usually that different and they even have tools
Method render_error
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def render_error(exception)
# use the exception_notifier gem to send out an e-mail
# to the notification list specified in config/environment.rb
ExceptionNotifier.notify_exception(exception, env: request.env,
data: {
- 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 PDFPageProxy_render
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function PDFPageProxy_render(params) {
var stats = this.stats;
stats.time('Overall');
// If there was a pending destroy cancel it so no cleanup happens during
Function createColumnHeaders
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createColumnHeaders() {
function onMouseEnter() {
$(this).addClass("ui-state-hover");
}
Function sorttables
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
var sorttables = (function($) { return function() {
$('.sortable').each(function() {
var $table = $(this);
$table.find('th').each(function() {
Function get_condition_html
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_condition_html(condition_types) {
var conditions_html = "";
$.each(condition_types, function( condition, violations ) {
var condition_string = "";
var violation_string = "";
Function autosizeColumns
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
function autosizeColumns() {
var i, c,
widths = [],
shrinkLeeway = 0,
total = 0,
Function MetadataClosure
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Metadata = PDFJS.Metadata = (function MetadataClosure() {
function fixMetadata(meta) {
return meta.replace(/>\\376\\377([^<]+)/g, function(all, codes) {
var bytes = codes.replace(/\\([0-3])([0-7])([0-7])/g,
function(code, d1, d2, d3) {
Function StickyTableHeaders
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.StickyTableHeaders = function (el, options) {
// To avoid scope issues, use 'base' instead of 'this'
// to reference this class from internal events and functions.
var base = this;