Showing 377 of 529 total issues
Function createMeshCanvasClosure
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
var createMeshCanvas = (function createMeshCanvasClosure() {
function drawTriangle(data, context, p1, p2, p3, c1, c2, c3) {
// Very basic Gouraud-shaded triangle rasterization algorithm.
var coords = context.coords, colors = context.colors;
var bytes = data.data, rowSize = data.width * 4;
Function GrabToPanClosure
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
var GrabToPan = (function GrabToPanClosure() {
/**
* Construct a GrabToPan instance for a given HTML element.
* @param options.element {Element}
* @param options.ignoreTarget {function} optional. See `ignoreTarget(node)`
- 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 pageviewDraw
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.draw = function pageviewDraw(callback) {
var pdfPage = this.pdfPage;
if (this.pagePdfPromise) {
return;
Function pdfViewSetHash
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
setHash: function pdfViewSetHash(hash) {
if (!hash) {
return;
}
- 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 FontInspectorClosure
has 128 lines of code (exceeds 25 allowed). Consider refactoring. Open
var FontInspector = (function FontInspectorClosure() {
var fonts;
var active = false;
var fontAttribute = 'data-font-name';
function removeSelection() {
Function compileType3Glyph
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
function compileType3Glyph(imgData) {
var POINT_TO_PROCESS_LIMIT = 1000;
var width = imgData.width, height = imgData.height;
var i, j, j0, width1 = width + 1;
Function TextAnnotationClosure
has 126 lines of code (exceeds 25 allowed). Consider refactoring. Open
var TextAnnotation = (function TextAnnotationClosure() {
function TextAnnotation(params) {
InteractiveAnnotation.call(this, params);
if (params.data) {
File compatibility.js
has 374 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 GrabToPanClosure
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
var GrabToPan = (function GrabToPanClosure() {
/**
* Construct a GrabToPan instance for a given HTML element.
* @param options.element {Element}
* @param options.ignoreTarget {function} optional. See `ignoreTarget(node)`
Function PDFBugClosure
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
var PDFBug = (function PDFBugClosure() {
var panelWidth = 300;
var buttons = [];
var activePanel = null;
- 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 vocabulary
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.App.vocabulary = function (config) {
// This includes support for filterbar and slider on
// all 'vocabulary' pages (contexts and set/contexts).
Function setupAnnotations
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setupAnnotations(pageDiv, pdfPage, viewport) {
function bindLink(link, dest) {
link.href = PDFView.getDestinationHash(dest);
link.onclick = function pageViewSetupLinksOnclick() {
Method included
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.included(base)
base.class_eval do
# to build joins over to meta_terms from a media resource
has_many :meta_data_meta_terms,
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
};
Function pdfHistoryPush
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
push: function pdfHistoryPush(params, isInitialBookmark) {
if (!(this.initialized && this.historyUnlocked)) {
return;
}
if (params.dest && !params.hash) {
- 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 filter
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def filter(current_user, filter_opts)
filter_opts = filter_opts.delete_if {|k,v| v.blank?}.deep_symbolize_keys
raise "invalid option" unless filter_opts.is_a?(Hash)
############################################################
- 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 hash_for_media_resource
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
def hash_for_media_resource(media_resource, with = nil)
h = {
id: media_resource.id,
created_at: media_resource.created_at.iso8601,
updated_at: media_resource.updated_at.iso8601,
Function mozPrintCallbackPolyfillClosure
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
(function mozPrintCallbackPolyfillClosure() {
if ('mozPrintCallback' in document.createElement('canvas')) {
return;
}
// Cause positive result on feature-detection:
Function CanvasGraphics_showText
has 101 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);