Showing 419 of 572 total issues
Function pdfjsWrapper
has a Cognitive Complexity of 2085 (exceeds 5 allowed). Consider refactoring. Open
(function pdfjsWrapper() {
// Use strict in our context only - users might not want it
'use strict';
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
- 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 pdfjsWrapper
has 6142 lines of code (exceeds 25 allowed). Consider refactoring. Open
(function pdfjsWrapper() {
// Use strict in our context only - users might not want it
'use strict';
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
File pdf.js
has 6160 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
/* Copyright 2012 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
Function SlickGrid
has 2728 lines of code (exceeds 25 allowed). Consider refactoring. Open
function SlickGrid(container, data, columns, options) {
// settings
var defaults = {
explicitInitialization: false,
rowHeight: 25,
File slick.grid.js
has 2748 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @license
* (c) 2009-2013 Michael Leibman
* michael{dot}leibman{at}gmail{dot}com
* http://github.com/mleibman/slickgrid
Function CanvasGraphicsClosure
has 1422 lines of code (exceeds 25 allowed). Consider refactoring. Open
var CanvasGraphics = (function CanvasGraphicsClosure() {
// Defines the time the executeOperatorList is going to be executing
// before it stops and shedules a continue of execution.
var EXECUTION_TIME = 15;
// Defines the number of steps before checking the execution time
Function SVGGraphicsClosure
has 801 lines of code (exceeds 25 allowed). Consider refactoring. Open
var SVGGraphics = (function SVGGraphicsClosure() {
function createScratchSVG(width, height) {
var NS = 'http://www.w3.org/2000/svg';
var svg = document.createElementNS(NS, 'svg:svg');
svg.setAttributeNS(null, 'version', '1.1');
Function DataView
has 635 lines of code (exceeds 25 allowed). Consider refactoring. Open
function DataView(options) {
var self = this;
var defaults = {
groupItemMetadataProvider: null,
Function WorkerTransportClosure
has 378 lines of code (exceeds 25 allowed). Consider refactoring. Open
var WorkerTransport = (function WorkerTransportClosure() {
function WorkerTransport(workerInitializedCapability, pdfDataRangeTransport) {
this.pdfDataRangeTransport = pdfDataRangeTransport;
this.workerInitializedCapability = workerInitializedCapability;
this.commonObjs = new PDFObjects();
Function WebGLUtilsClosure
has 355 lines of code (exceeds 25 allowed). Consider refactoring. Open
var WebGLUtils = (function WebGLUtilsClosure() {
function loadShader(gl, code, shaderType) {
var shader = gl.createShader(shaderType);
gl.shaderSource(shader, code);
gl.compileShader(shader);
Function add
has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring. Open
'add': function(shortcut_combination,callback,opt) {
//Provide a set of default options
var default_options = {
'type':'keydown',
'propagate':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
File slick.dataview.js
has 734 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function ($) {
$.extend(true, window, {
Slick: {
Data: {
DataView: DataView,
Class Assessment
has 81 methods (exceeds 20 allowed). Consider refactoring. Open
class Assessment < ApplicationRecord
# Mass-assignment
# attr_protected :name
# Associations
File watchlist.js
has 622 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Loads all Semantic javascripts
//= require semantic-ui
const escapeHtml = (unsafe) => {
return unsafe.replaceAll('&', '&')
Function PromiseClosure
has 248 lines of code (exceeds 25 allowed). Consider refactoring. Open
(function PromiseClosure() {
if (globalScope.Promise) {
// Promises existing in the DOM/Worker, checking presence of all/resolve
if (typeof globalScope.Promise.all !== 'function') {
globalScope.Promise.all = function (iterable) {
Function editable
has 233 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.editable = function(target, options) {
if ('disable' == target) {
$(this).data('disabled.editable', true);
return;
Method show
has a Cognitive Complexity of 53 (exceeds 5 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,
- 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 assessment.rb
has 509 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "archive"
require "association_cache"
require "fileutils"
require "utilities"
class Assessment < ApplicationRecord
Function WorkerTransport_setupMessageHandler
has 205 lines of code (exceeds 25 allowed). Consider refactoring. Open
function WorkerTransport_setupMessageHandler(messageHandler) {
this.messageHandler = messageHandler;
function updatePassword(password) {
messageHandler.send('UpdatePassword', password);
Function get_watchlist_function
has 192 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_watchlist_function(){
var pending_instances = {}
var contacted_instances = {}
var resolved_instances = {}