public/mozilla-pdf/core/pdf.js

Summary

Maintainability
F
4 mos
Test Coverage

Function pdfjsWrapper has a Cognitive Complexity of 1973 (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 -*- */
Severity: Minor
Found in public/mozilla-pdf/core/pdf.js - About 1 mo to fix

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 5257 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 -*- */
Severity: Major
Found in public/mozilla-pdf/core/pdf.js - About 3 wks to fix

    File pdf.js has 5275 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");
    Severity: Major
    Found in public/mozilla-pdf/core/pdf.js - About 2 wks to fix

      Function CanvasGraphicsClosure has 1391 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;
      
      
      Severity: Major
      Found in public/mozilla-pdf/core/pdf.js - About 6 days to fix

        Function WorkerTransportClosure has 356 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var WorkerTransport = (function WorkerTransportClosure() {
          function WorkerTransport(workerInitializedCapability, workerReadyCapability,
                                   pdfDataRangeTransport, progressCallback) {
            this.pdfDataRangeTransport = pdfDataRangeTransport;
        
        
        Severity: Major
        Found in public/mozilla-pdf/core/pdf.js - About 1 day to fix

          Function WebGLUtilsClosure has 347 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);
          Severity: Major
          Found in public/mozilla-pdf/core/pdf.js - About 1 day to fix

            Function AnnotationClosure has 269 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var Annotation = (function AnnotationClosure() {
              // 12.5.5: Algorithm: Appearance streams
              function getTransformMatrix(rect, bbox, matrix) {
                var bounds = Util.getAxialAlignedBoundingBox(bbox, matrix);
                var minX = bounds[0];
            Severity: Major
            Found in public/mozilla-pdf/core/pdf.js - About 1 day to fix

              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) {
              Severity: Major
              Found in public/mozilla-pdf/core/pdf.js - About 1 day to fix

                Function WorkerTransport_setupMessageHandler has 186 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      function WorkerTransport_setupMessageHandler(messageHandler) {
                      this.messageHandler = messageHandler;
                
                      function updatePassword(password) {
                        messageHandler.send('UpdatePassword', password);
                Severity: Major
                Found in public/mozilla-pdf/core/pdf.js - About 7 hrs to fix

                  Function PDFPageProxyClosure has 156 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  var PDFPageProxy = (function PDFPageProxyClosure() {
                    function PDFPageProxy(pageIndex, pageInfo, transport) {
                      this.pageIndex = pageIndex;
                      this.pageInfo = pageInfo;
                      this.transport = transport;
                  Severity: Major
                  Found in public/mozilla-pdf/core/pdf.js - About 6 hrs to fix

                    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;
                    Severity: Major
                    Found in public/mozilla-pdf/core/pdf.js - About 5 hrs to fix

                      Function UtilClosure has 146 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      var Util = PDFJS.Util = (function UtilClosure() {
                        function Util() {}
                      
                        Util.makeCssRgb = function Util_makeCssRgb(rgb) {
                          return 'rgb(' + rgb[0] + ',' + rgb[1] + ',' + rgb[2] + ')';
                      Severity: Major
                      Found in public/mozilla-pdf/core/pdf.js - About 5 hrs to fix

                        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;
                        Severity: Major
                        Found in public/mozilla-pdf/core/pdf.js - About 5 hrs to fix

                          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) {
                          Severity: Major
                          Found in public/mozilla-pdf/core/pdf.js - About 5 hrs to fix

                            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;
                            Severity: Major
                            Found in public/mozilla-pdf/core/pdf.js - About 4 hrs to fix

                              Function TilingPatternClosure has 107 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              var TilingPattern = (function TilingPatternClosure() {
                                var PaintType = {
                                  COLORED: 1,
                                  UNCOLORED: 2
                                };
                              Severity: Major
                              Found in public/mozilla-pdf/core/pdf.js - About 4 hrs to fix

                                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);
                                Severity: Major
                                Found in public/mozilla-pdf/core/pdf.js - About 4 hrs to fix

                                  Function TextAnnotation_getHtmlElement has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      getHtmlElement: function TextAnnotation_getHtmlElement(commonObjs) {
                                        assert(!isWorker, 'getHtmlElement() shall be called from main thread');
                                  
                                        var item = this.data;
                                        var rect = item.rect;
                                  Severity: Major
                                  Found in public/mozilla-pdf/core/pdf.js - About 3 hrs to fix

                                    Function putBinaryImageData has 94 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;
                                        }
                                    Severity: Major
                                    Found in public/mozilla-pdf/core/pdf.js - About 3 hrs to fix

                                      Function InternalRenderTaskClosure has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      var InternalRenderTask = (function InternalRenderTaskClosure() {
                                      
                                        function InternalRenderTask(callback, params, objs, commonObjs, operatorList,
                                                                    pageNumber) {
                                          this.callback = callback;
                                      Severity: Major
                                      Found in public/mozilla-pdf/core/pdf.js - About 3 hrs to fix

                                        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;
                                        Severity: Major
                                        Found in public/mozilla-pdf/core/pdf.js - About 3 hrs to fix

                                          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.
                                          Severity: Major
                                          Found in public/mozilla-pdf/core/pdf.js - About 2 hrs to fix

                                            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
                                            Severity: Major
                                            Found in public/mozilla-pdf/core/pdf.js - About 2 hrs to fix

                                              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
                                              Severity: Major
                                              Found in public/mozilla-pdf/core/pdf.js - About 2 hrs to fix

                                                Function LinkAnnotationClosure has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                var LinkAnnotation = (function LinkAnnotationClosure() {
                                                  function LinkAnnotation(params) {
                                                    InteractiveAnnotation.call(this, params);
                                                
                                                    if (params.data) {
                                                Severity: Major
                                                Found in public/mozilla-pdf/core/pdf.js - About 2 hrs to fix

                                                  Function PDFPageProxy_render has 66 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
                                                  Severity: Major
                                                  Found in public/mozilla-pdf/core/pdf.js - About 2 hrs to fix

                                                    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) {
                                                    Severity: Major
                                                    Found in public/mozilla-pdf/core/pdf.js - About 2 hrs to fix

                                                      Function CanvasGraphics_setGState has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                          setGState: function CanvasGraphics_setGState(states) {
                                                            for (var i = 0, ii = states.length; i < ii; i++) {
                                                              var state = states[i];
                                                              var key = state[0];
                                                              var value = state[1];
                                                      Severity: Major
                                                      Found in public/mozilla-pdf/core/pdf.js - About 2 hrs to fix

                                                        Function TextWidgetAnnotationClosure has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                                                        Open

                                                        var TextWidgetAnnotation = (function TextWidgetAnnotationClosure() {
                                                          function TextWidgetAnnotation(params) {
                                                            WidgetAnnotation.call(this, params);
                                                        
                                                            if (params.data) {
                                                        Severity: Major
                                                        Found in public/mozilla-pdf/core/pdf.js - About 2 hrs to fix

                                                          Function drawTriangle has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                                                          Open

                                                            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;
                                                              var tmp;
                                                          Severity: Major
                                                          Found in public/mozilla-pdf/core/pdf.js - About 2 hrs to fix

                                                            Function PDFObjectsClosure has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                                                            Open

                                                            var PDFObjects = (function PDFObjectsClosure() {
                                                              function PDFObjects() {
                                                                this.objs = {};
                                                              }
                                                            
                                                            
                                                            Severity: Major
                                                            Found in public/mozilla-pdf/core/pdf.js - About 2 hrs to fix

                                                              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;
                                                              Severity: Major
                                                              Found in public/mozilla-pdf/core/pdf.js - About 2 hrs to fix

                                                                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;
                                                                
                                                                
                                                                Severity: Major
                                                                Found in public/mozilla-pdf/core/pdf.js - About 2 hrs to fix

                                                                  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;
                                                                      }
                                                                  Severity: Major
                                                                  Found in public/mozilla-pdf/core/pdf.js - About 2 hrs to fix

                                                                    Function WorkerTransport has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                    Open

                                                                      function WorkerTransport(workerInitializedCapability, workerReadyCapability,
                                                                                               pdfDataRangeTransport, progressCallback) {
                                                                        this.pdfDataRangeTransport = pdfDataRangeTransport;
                                                                    
                                                                        this.workerReadyCapability = workerReadyCapability;
                                                                    Severity: Major
                                                                    Found in public/mozilla-pdf/core/pdf.js - About 2 hrs to fix

                                                                      Function PageViewport has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                      Open

                                                                        function PageViewport(viewBox, scale, rotation, offsetX, offsetY, dontFlip) {
                                                                          this.viewBox = viewBox;
                                                                          this.scale = scale;
                                                                          this.rotation = rotation;
                                                                          this.offsetX = offsetX;
                                                                      Severity: Major
                                                                      Found in public/mozilla-pdf/core/pdf.js - About 2 hrs to fix

                                                                        Function genericComposeSMask has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                        Open

                                                                          function genericComposeSMask(maskCtx, layerCtx, width, height,
                                                                                                       subtype, backdrop) {
                                                                            var addBackdropFn;
                                                                            if (backdrop) {
                                                                              addBackdropFn = function (r0, g0, b0, bytes) {
                                                                        Severity: Major
                                                                        Found in public/mozilla-pdf/core/pdf.js - About 2 hrs to fix

                                                                          Function WidgetAnnotationClosure has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                          Open

                                                                          var WidgetAnnotation = (function WidgetAnnotationClosure() {
                                                                          
                                                                            function WidgetAnnotation(params) {
                                                                              Annotation.call(this, params);
                                                                          
                                                                          
                                                                          Severity: Major
                                                                          Found in public/mozilla-pdf/core/pdf.js - About 2 hrs to fix

                                                                            Function Annotation has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                            Open

                                                                              function Annotation(params) {
                                                                                if (params.data) {
                                                                                  this.data = params.data;
                                                                                  return;
                                                                                }
                                                                            Severity: Minor
                                                                            Found in public/mozilla-pdf/core/pdf.js - About 2 hrs to fix

                                                                              Function createMeshCanvas has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                              Open

                                                                                function createMeshCanvas(bounds, combinesScale, coords, colors, figures,
                                                                                                          backgroundColor) {
                                                                                  // we will increase scale on some weird factor to let antialiasing take
                                                                                  // care of "rough" edges
                                                                                  var EXPECTED_SCALE = 1.1;
                                                                              Severity: Minor
                                                                              Found in public/mozilla-pdf/core/pdf.js - About 1 hr to fix

                                                                                Function CanvasGraphics_paintChar has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                Open

                                                                                    paintChar: function CanvasGraphics_paintChar(character, x, y) {
                                                                                      var ctx = this.ctx;
                                                                                      var current = this.current;
                                                                                      var font = current.font;
                                                                                      var textRenderingMode = current.textRenderingMode;
                                                                                Severity: Minor
                                                                                Found in public/mozilla-pdf/core/pdf.js - About 1 hr to fix

                                                                                  Function PDFDocumentProxyClosure has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                  Open

                                                                                  var PDFDocumentProxy = (function PDFDocumentProxyClosure() {
                                                                                    function PDFDocumentProxy(pdfInfo, transport) {
                                                                                      this.pdfInfo = pdfInfo;
                                                                                      this.transport = transport;
                                                                                    }
                                                                                  Severity: Minor
                                                                                  Found in public/mozilla-pdf/core/pdf.js - About 1 hr to fix

                                                                                    Function CanvasGraphics_showType3Text has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                    Open

                                                                                        showType3Text: function CanvasGraphics_showType3Text(glyphs) {
                                                                                          // Type3 fonts - each glyph is a "mini-PDF"
                                                                                          var ctx = this.ctx;
                                                                                          var current = this.current;
                                                                                          var font = current.font;
                                                                                    Severity: Minor
                                                                                    Found in public/mozilla-pdf/core/pdf.js - About 1 hr to fix

                                                                                      Function CanvasGraphics_executeOperatorList has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                      Open

                                                                                          executeOperatorList: function CanvasGraphics_executeOperatorList(
                                                                                                                          operatorList,
                                                                                                                          executionStartIdx, continueCallback,
                                                                                                                          stepper) {
                                                                                            var argsArray = operatorList.argsArray;
                                                                                      Severity: Minor
                                                                                      Found in public/mozilla-pdf/core/pdf.js - About 1 hr to fix

                                                                                        Function CanvasGraphics_constructPath has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                        Open

                                                                                            constructPath: function CanvasGraphics_constructPath(ops, args) {
                                                                                              var ctx = this.ctx;
                                                                                              var current = this.current;
                                                                                              var x = current.x, y = current.y;
                                                                                              for (var i = 0, j = 0, ii = ops.length; i < ii; i++) {
                                                                                        Severity: Minor
                                                                                        Found in public/mozilla-pdf/core/pdf.js - About 1 hr to fix

                                                                                          Function LinkAnnotation has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                          Open

                                                                                            function LinkAnnotation(params) {
                                                                                              InteractiveAnnotation.call(this, params);
                                                                                          
                                                                                              if (params.data) {
                                                                                                return;
                                                                                          Severity: Minor
                                                                                          Found in public/mozilla-pdf/core/pdf.js - About 1 hr to fix

                                                                                            Function InteractiveAnnotationClosure has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                            Open

                                                                                            var InteractiveAnnotation = (function InteractiveAnnotationClosure() {
                                                                                              function InteractiveAnnotation(params) {
                                                                                                Annotation.call(this, params);
                                                                                              }
                                                                                            
                                                                                            
                                                                                            Severity: Minor
                                                                                            Found in public/mozilla-pdf/core/pdf.js - About 1 hr to fix

                                                                                              Function FontFaceClosure has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                              Open

                                                                                              var FontFace = (function FontFaceClosure() {
                                                                                                function FontFace(name, file, properties) {
                                                                                                  this.compiledGlyphs = {};
                                                                                                  if (arguments.length === 1) {
                                                                                                    // importing translated data
                                                                                              Severity: Minor
                                                                                              Found in public/mozilla-pdf/core/pdf.js - About 1 hr to fix

                                                                                                Function composeSMask has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                Open

                                                                                                  function composeSMask(layer, mask, properties) {
                                                                                                    var width = layer.width, height = layer.height;
                                                                                                
                                                                                                    if (!smaskCache) {
                                                                                                      initSmaskGL();
                                                                                                Severity: Minor
                                                                                                Found in public/mozilla-pdf/core/pdf.js - About 1 hr to fix

                                                                                                  Function Promise_all has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                  Open

                                                                                                    Promise.all = function Promise_all(promises) {
                                                                                                      var resolveAll, rejectAll;
                                                                                                      var deferred = new Promise(function (resolve, reject) {
                                                                                                        resolveAll = resolve;
                                                                                                        rejectAll = reject;
                                                                                                  Severity: Minor
                                                                                                  Found in public/mozilla-pdf/core/pdf.js - About 1 hr to fix

                                                                                                    Function WidgetAnnotation has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                    Open

                                                                                                      function WidgetAnnotation(params) {
                                                                                                        Annotation.call(this, params);
                                                                                                    
                                                                                                        if (params.data) {
                                                                                                          return;
                                                                                                    Severity: Minor
                                                                                                    Found in public/mozilla-pdf/core/pdf.js - About 1 hr to fix

                                                                                                      Function messageHandlerComObjOnMessage has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                      Open

                                                                                                        comObj.onmessage = function messageHandlerComObjOnMessage(event) {
                                                                                                          var data = event.data;
                                                                                                          if (data.isReply) {
                                                                                                            var callbackId = data.callbackId;
                                                                                                            if (data.callbackId in callbacksCapabilities) {
                                                                                                      Severity: Minor
                                                                                                      Found in public/mozilla-pdf/core/pdf.js - About 1 hr to fix

                                                                                                        Function TilinPattern_createPatternCanvas has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                        Open

                                                                                                            createPatternCanvas: function TilinPattern_createPatternCanvas(owner) {
                                                                                                              var operatorList = this.operatorList;
                                                                                                              var bbox = this.bbox;
                                                                                                              var xstep = this.xstep;
                                                                                                              var ystep = this.ystep;
                                                                                                        Severity: Minor
                                                                                                        Found in public/mozilla-pdf/core/pdf.js - About 1 hr to fix

                                                                                                          Function CanvasExtraStateClosure has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                          Open

                                                                                                          var CanvasExtraState = (function CanvasExtraStateClosure() {
                                                                                                            function CanvasExtraState(old) {
                                                                                                              // Are soft masks and alpha values shapes or opacities?
                                                                                                              this.alphaIsShape = false;
                                                                                                              this.fontSize = 0;
                                                                                                          Severity: Minor
                                                                                                          Found in public/mozilla-pdf/core/pdf.js - About 1 hr to fix

                                                                                                            Function Mesh_fromIR has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                            Open

                                                                                                              fromIR: function Mesh_fromIR(raw) {
                                                                                                                //var type = raw[1];
                                                                                                                var coords = raw[2];
                                                                                                                var colors = raw[3];
                                                                                                                var figures = raw[4];
                                                                                                            Severity: Minor
                                                                                                            Found in public/mozilla-pdf/core/pdf.js - About 1 hr to fix

                                                                                                              Function initSmaskGL has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                              Open

                                                                                                                function initSmaskGL() {
                                                                                                                  var canvas, gl;
                                                                                                              
                                                                                                                  generageGL();
                                                                                                                  canvas = currentCanvas;
                                                                                                              Severity: Minor
                                                                                                              Found in public/mozilla-pdf/core/pdf.js - About 1 hr to fix

                                                                                                                Function Uint32ArrayViewClosure has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                Open

                                                                                                                var Uint32ArrayView = (function Uint32ArrayViewClosure() {
                                                                                                                
                                                                                                                  function Uint32ArrayView(buffer, length) {
                                                                                                                    this.buffer = buffer;
                                                                                                                    this.byteLength = buffer.length;
                                                                                                                Severity: Minor
                                                                                                                Found in public/mozilla-pdf/core/pdf.js - About 1 hr to fix

                                                                                                                  Function CanvasGraphics_setFont has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                  Open

                                                                                                                      setFont: function CanvasGraphics_setFont(fontRefName, size) {
                                                                                                                        var fontObj = this.commonObjs.get(fontRefName);
                                                                                                                        var current = this.current;
                                                                                                                  
                                                                                                                        if (!fontObj) {
                                                                                                                  Severity: Minor
                                                                                                                  Found in public/mozilla-pdf/core/pdf.js - About 1 hr to fix

                                                                                                                    Function CanvasGraphics_fill has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                    Open

                                                                                                                        fill: function CanvasGraphics_fill(consumePath) {
                                                                                                                          consumePath = typeof consumePath !== 'undefined' ? consumePath : true;
                                                                                                                          var ctx = this.ctx;
                                                                                                                          var fillColor = this.current.fillColor;
                                                                                                                          var needRestore = false;
                                                                                                                    Severity: Minor
                                                                                                                    Found in public/mozilla-pdf/core/pdf.js - About 1 hr to fix

                                                                                                                      Function runHandlers has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                      Open

                                                                                                                          runHandlers: function runHandlers() {
                                                                                                                            var RUN_TIMEOUT = 1; // ms
                                                                                                                            var timeoutAt = Date.now() + RUN_TIMEOUT;
                                                                                                                            while (this.handlers.length > 0) {
                                                                                                                              var handler = this.handlers.shift();
                                                                                                                      Severity: Minor
                                                                                                                      Found in public/mozilla-pdf/core/pdf.js - About 1 hr to fix

                                                                                                                        Function drawFigure has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                        Open

                                                                                                                          function drawFigure(data, figure, context) {
                                                                                                                            var ps = figure.coords;
                                                                                                                            var cs = figure.colors;
                                                                                                                            var i, ii;
                                                                                                                            switch (figure.type) {
                                                                                                                        Severity: Minor
                                                                                                                        Found in public/mozilla-pdf/core/pdf.js - About 1 hr to fix

                                                                                                                          Function transportObj has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                          Open

                                                                                                                                messageHandler.on('commonobj', function transportObj(data) {
                                                                                                                                  var id = data[0];
                                                                                                                                  var type = data[1];
                                                                                                                                  if (this.commonObjs.hasData(id)) {
                                                                                                                                    return;
                                                                                                                          Severity: Minor
                                                                                                                          Found in public/mozilla-pdf/core/pdf.js - About 1 hr to fix

                                                                                                                            Function getDocument has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                            Open

                                                                                                                            PDFJS.getDocument = function getDocument(source,
                                                                                                                                                                     pdfDataRangeTransport,
                                                                                                                                                                     passwordCallback,
                                                                                                                                                                     progressCallback) {
                                                                                                                              var workerInitializedCapability, workerReadyCapability, transport;
                                                                                                                            Severity: Minor
                                                                                                                            Found in public/mozilla-pdf/core/pdf.js - About 1 hr to fix

                                                                                                                              Function putBinaryImageMask has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                              Open

                                                                                                                                function putBinaryImageMask(ctx, imgData) {
                                                                                                                                  var height = imgData.height, width = imgData.width;
                                                                                                                                  var fullChunkHeight = 16;
                                                                                                                                  var fracChunks = height / fullChunkHeight;
                                                                                                                                  var fullChunks = Math.floor(fracChunks);
                                                                                                                              Severity: Minor
                                                                                                                              Found in public/mozilla-pdf/core/pdf.js - About 1 hr to fix

                                                                                                                                Function CanvasGraphics_paintImageMaskXObject has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                Open

                                                                                                                                    paintImageMaskXObject: function CanvasGraphics_paintImageMaskXObject(img) {
                                                                                                                                      var ctx = this.ctx;
                                                                                                                                      var width = img.width, height = img.height;
                                                                                                                                
                                                                                                                                      var glyph = this.processingType3;
                                                                                                                                Severity: Minor
                                                                                                                                Found in public/mozilla-pdf/core/pdf.js - About 1 hr to fix

                                                                                                                                  Function Annotation_getOperatorList has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                  Open

                                                                                                                                      getOperatorList: function Annotation_getOperatorList(evaluator) {
                                                                                                                                  
                                                                                                                                        if (!this.appearance) {
                                                                                                                                          return Promise.resolve(new OperatorList());
                                                                                                                                        }
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in public/mozilla-pdf/core/pdf.js - About 1 hr to fix

                                                                                                                                    Function Metadata_parse has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                    Open

                                                                                                                                        parse: function Metadata_parse() {
                                                                                                                                          var doc = this.metaDocument;
                                                                                                                                          var rdf = doc.documentElement;
                                                                                                                                    
                                                                                                                                          if (rdf.nodeName.toLowerCase() !== 'rdf:rdf') { // Wrapped in <xmpmeta>
                                                                                                                                    Severity: Minor
                                                                                                                                    Found in public/mozilla-pdf/core/pdf.js - About 1 hr to fix

                                                                                                                                      Function drawTriangle has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                      Open

                                                                                                                                        function drawTriangle(data, context, p1, p2, p3, c1, c2, c3) {
                                                                                                                                      Severity: Major
                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js - About 1 hr to fix

                                                                                                                                        Function createMeshCanvas has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                        Open

                                                                                                                                          function createMeshCanvas(bounds, combinesScale, coords, colors, figures,
                                                                                                                                                                    backgroundColor) {
                                                                                                                                        Severity: Minor
                                                                                                                                        Found in public/mozilla-pdf/core/pdf.js - About 45 mins to fix

                                                                                                                                          Function setTextMatrix has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                          Open

                                                                                                                                              setTextMatrix: function CanvasGraphics_setTextMatrix(a, b, c, d, e, f) {
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in public/mozilla-pdf/core/pdf.js - About 45 mins to fix

                                                                                                                                            Avoid deeply nested control flow statements.
                                                                                                                                            Open

                                                                                                                                                    for (j = elemsInThisChunk; j--;) {
                                                                                                                                                      dest[destPos++] = src[srcPos++];
                                                                                                                                                      dest[destPos++] = src[srcPos++];
                                                                                                                                                      dest[destPos++] = src[srcPos++];
                                                                                                                                                      dest[destPos++] = 255;
                                                                                                                                            Severity: Major
                                                                                                                                            Found in public/mozilla-pdf/core/pdf.js - About 45 mins to fix

                                                                                                                                              Function genericComposeSMask has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                              Open

                                                                                                                                                function genericComposeSMask(maskCtx, layerCtx, width, height,
                                                                                                                                                                             subtype, backdrop) {
                                                                                                                                              Severity: Minor
                                                                                                                                              Found in public/mozilla-pdf/core/pdf.js - About 45 mins to fix

                                                                                                                                                Function setCharWidthAndBounds has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                                Open

                                                                                                                                                    setCharWidthAndBounds: function CanvasGraphics_setCharWidthAndBounds(xWidth,
                                                                                                                                                                                                                        yWidth,
                                                                                                                                                                                                                        llx,
                                                                                                                                                                                                                        lly,
                                                                                                                                                                                                                        urx,
                                                                                                                                                Severity: Minor
                                                                                                                                                Found in public/mozilla-pdf/core/pdf.js - About 45 mins to fix

                                                                                                                                                  Avoid deeply nested control flow statements.
                                                                                                                                                  Open

                                                                                                                                                              for (var i = 0; i < dashArrayLength; i++) {
                                                                                                                                                                var validNumber = (+dashArray[i] >= 0);
                                                                                                                                                                if (!validNumber) {
                                                                                                                                                                  isInvalid = true;
                                                                                                                                                                  break;
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in public/mozilla-pdf/core/pdf.js - About 45 mins to fix

                                                                                                                                                    Function clipBbox has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                                    Open

                                                                                                                                                        clipBbox: function clipBbox(graphics, bbox, x0, y0, x1, y1) {
                                                                                                                                                    Severity: Minor
                                                                                                                                                    Found in public/mozilla-pdf/core/pdf.js - About 45 mins to fix

                                                                                                                                                      Function PageViewport has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                                      Open

                                                                                                                                                        function PageViewport(viewBox, scale, rotation, offsetX, offsetY, dontFlip) {
                                                                                                                                                      Severity: Minor
                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js - About 45 mins to fix

                                                                                                                                                        Function transform has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                                        Open

                                                                                                                                                            ctx.transform = function ctxTransform(a, b, c, d, e, f) {
                                                                                                                                                        Severity: Minor
                                                                                                                                                        Found in public/mozilla-pdf/core/pdf.js - About 45 mins to fix

                                                                                                                                                          Function transform has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                                          Open

                                                                                                                                                              transform: function CanvasGraphics_transform(a, b, c, d, e, f) {
                                                                                                                                                          Severity: Minor
                                                                                                                                                          Found in public/mozilla-pdf/core/pdf.js - About 45 mins to fix

                                                                                                                                                            Function TilingPattern has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                                            Open

                                                                                                                                                              function TilingPattern(IR, color, ctx, objs, commonObjs, baseTransform) {
                                                                                                                                                            Severity: Minor
                                                                                                                                                            Found in public/mozilla-pdf/core/pdf.js - About 45 mins to fix

                                                                                                                                                              Avoid deeply nested control flow statements.
                                                                                                                                                              Open

                                                                                                                                                                           if (mask === 0) {
                                                                                                                                                                             srcByte = src[srcPos++];
                                                                                                                                                                             mask = 128;
                                                                                                                                                                           }
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in public/mozilla-pdf/core/pdf.js - About 45 mins to fix

                                                                                                                                                                Function InternalRenderTask has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                                                Open

                                                                                                                                                                  function InternalRenderTask(callback, params, objs, commonObjs, operatorList,
                                                                                                                                                                                              pageNumber) {
                                                                                                                                                                Severity: Minor
                                                                                                                                                                Found in public/mozilla-pdf/core/pdf.js - About 45 mins to fix

                                                                                                                                                                  Avoid deeply nested control flow statements.
                                                                                                                                                                  Open

                                                                                                                                                                          if (i >= fullChunks) {
                                                                                                                                                                            thisChunkHeight =partialChunkHeight;
                                                                                                                                                                            elemsInThisChunk = width * thisChunkHeight;
                                                                                                                                                                          }
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in public/mozilla-pdf/core/pdf.js - About 45 mins to fix

                                                                                                                                                                    Avoid deeply nested control flow statements.
                                                                                                                                                                    Open

                                                                                                                                                                                if (isInvalid || numPositive === 0) {
                                                                                                                                                                                  data.borderWidth = 0;
                                                                                                                                                                                }
                                                                                                                                                                    Severity: Major
                                                                                                                                                                    Found in public/mozilla-pdf/core/pdf.js - About 45 mins to fix

                                                                                                                                                                      Function setTransform has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                                                      Open

                                                                                                                                                                          ctx.setTransform = function ctxSetTransform(a, b, c, d, e, f) {
                                                                                                                                                                      Severity: Minor
                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js - About 45 mins to fix

                                                                                                                                                                        Function appendToOperatorList has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                                                        Open

                                                                                                                                                                              annotations, opList, pdfManager, partialEvaluator, intent) {
                                                                                                                                                                        Severity: Minor
                                                                                                                                                                        Found in public/mozilla-pdf/core/pdf.js - About 35 mins to fix

                                                                                                                                                                          Function drawFigures has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                                                          Open

                                                                                                                                                                            function drawFigures(width, height, backgroundColor, figures, context) {
                                                                                                                                                                          Severity: Minor
                                                                                                                                                                          Found in public/mozilla-pdf/core/pdf.js - About 35 mins to fix

                                                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                                                            Open

                                                                                                                                                                                    return WidgetAnnotation;
                                                                                                                                                                            Severity: Major
                                                                                                                                                                            Found in public/mozilla-pdf/core/pdf.js - About 30 mins to fix

                                                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                                                              Open

                                                                                                                                                                                    return Annotation;
                                                                                                                                                                              Severity: Major
                                                                                                                                                                              Found in public/mozilla-pdf/core/pdf.js - About 30 mins to fix

                                                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                                                Open

                                                                                                                                                                                          return i;
                                                                                                                                                                                Severity: Major
                                                                                                                                                                                Found in public/mozilla-pdf/core/pdf.js - About 30 mins to fix

                                                                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                                                                  Open

                                                                                                                                                                                            return i;
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in public/mozilla-pdf/core/pdf.js - About 30 mins to fix

                                                                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                                                                    Open

                                                                                                                                                                                            return TextWidgetAnnotation;
                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                    Found in public/mozilla-pdf/core/pdf.js - About 30 mins to fix

                                                                                                                                                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                          if (rotateA === 0) {
                                                                                                                                                                                            offsetCanvasX = Math.abs(centerY - viewBox[1]) * scale + offsetX;
                                                                                                                                                                                            offsetCanvasY = Math.abs(centerX - viewBox[0]) * scale + offsetY;
                                                                                                                                                                                            width = Math.abs(viewBox[3] - viewBox[1]) * scale;
                                                                                                                                                                                            height = Math.abs(viewBox[2] - viewBox[0]) * scale;
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 1 other location - About 4 hrs to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 816..821

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 127.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                          } else {
                                                                                                                                                                                            offsetCanvasX = Math.abs(centerX - viewBox[0]) * scale + offsetX;
                                                                                                                                                                                            offsetCanvasY = Math.abs(centerY - viewBox[1]) * scale + offsetY;
                                                                                                                                                                                            width = Math.abs(viewBox[2] - viewBox[0]) * scale;
                                                                                                                                                                                            height = Math.abs(viewBox[3] - viewBox[1]) * scale;
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 1 other location - About 4 hrs to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 811..816

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 127.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                            if (y < y2) {
                                                                                                                                                                                              k = y < y1 ? 0 : y1 === y2 ? 1 : (y1 - y) / (y1 - y2);
                                                                                                                                                                                              xa = x1 - (x1 - x2) * k;
                                                                                                                                                                                              car = c1r - (c1r - c2r) * k;
                                                                                                                                                                                              cag = c1g - (c1g - c2g) * k;
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 1 other location - About 4 hrs to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 6292..6298

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 118.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                            } else {
                                                                                                                                                                                              k = y > y3 ? 1 : y2 === y3 ? 0 : (y2 - y) / (y2 - y3);
                                                                                                                                                                                              xa = x2 - (x2 - x3) * k;
                                                                                                                                                                                              car = c2r - (c2r - c3r) * k;
                                                                                                                                                                                              cag = c2g - (c2g - c3g) * k;
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 1 other location - About 4 hrs to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 6286..6292

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 118.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                            if (rect && isArray(rect) && 4 == rect.length) {
                                                                                                                                                                                              var width = rect[2] - rect[0];
                                                                                                                                                                                              var height = rect[3] - rect[1];
                                                                                                                                                                                              this.rectangle(rect[0], rect[1], width, height);
                                                                                                                                                                                              this.clip();
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 1 other location - About 3 hrs to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 5298..5304

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 107.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                            if (bbox && isArray(bbox) && 4 == bbox.length) {
                                                                                                                                                                                              var width = bbox[2] - bbox[0];
                                                                                                                                                                                              var height = bbox[3] - bbox[1];
                                                                                                                                                                                              this.rectangle(bbox[0], bbox[1], width, height);
                                                                                                                                                                                              this.clip();
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 1 other location - About 3 hrs to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 5450..5456

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 107.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                                if (ctx.mozFillRule !== undefined) {
                                                                                                                                                                                                  ctx.mozFillRule = 'evenodd';
                                                                                                                                                                                                  ctx.clip();
                                                                                                                                                                                                  ctx.mozFillRule = 'nonzero';
                                                                                                                                                                                                } else {
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 4770..4781

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 88.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                      var UnknownErrorException = (function UnknownErrorExceptionClosure() {
                                                                                                                                                                                        function UnknownErrorException(msg, details) {
                                                                                                                                                                                          this.name = 'UnknownErrorException';
                                                                                                                                                                                          this.message = msg;
                                                                                                                                                                                          this.details = details;
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 330..341

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 88.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                      var PasswordException = (function PasswordExceptionClosure() {
                                                                                                                                                                                        function PasswordException(msg, code) {
                                                                                                                                                                                          this.name = 'PasswordException';
                                                                                                                                                                                          this.message = msg;
                                                                                                                                                                                          this.code = code;
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 343..354

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 88.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                              if (ctx.mozFillRule !== undefined) {
                                                                                                                                                                                                ctx.mozFillRule = 'evenodd';
                                                                                                                                                                                                ctx.fill();
                                                                                                                                                                                                ctx.mozFillRule = 'nonzero';
                                                                                                                                                                                              } else {
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 5769..5780

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 88.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                      var NotImplementedException = (function NotImplementedExceptionClosure() {
                                                                                                                                                                                        function NotImplementedException(msg) {
                                                                                                                                                                                          this.message = msg;
                                                                                                                                                                                        }
                                                                                                                                                                                      
                                                                                                                                                                                      
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 406..416

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 80.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                      var XRefParseException = (function XRefParseExceptionClosure() {
                                                                                                                                                                                        function XRefParseException(msg) {
                                                                                                                                                                                          this.message = msg;
                                                                                                                                                                                        }
                                                                                                                                                                                      
                                                                                                                                                                                      
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 380..390

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 80.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                            messageHandler.on('IncorrectPassword', function transportBadPass(data) {
                                                                                                                                                                                              if (this.passwordCallback) {
                                                                                                                                                                                                return this.passwordCallback(updatePassword,
                                                                                                                                                                                                                             PasswordResponses.INCORRECT_PASSWORD);
                                                                                                                                                                                              }
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 3117..3124

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 76.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                      var InvalidPDFException = (function InvalidPDFExceptionClosure() {
                                                                                                                                                                                        function InvalidPDFException(msg) {
                                                                                                                                                                                          this.name = 'InvalidPDFException';
                                                                                                                                                                                          this.message = msg;
                                                                                                                                                                                        }
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 368..378

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 76.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                      var MissingPDFException = (function MissingPDFExceptionClosure() {
                                                                                                                                                                                        function MissingPDFException(msg) {
                                                                                                                                                                                          this.name = 'MissingPDFException';
                                                                                                                                                                                          this.message = msg;
                                                                                                                                                                                        }
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 356..366

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 76.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                            messageHandler.on('NeedPassword', function transportPassword(data) {
                                                                                                                                                                                              if (this.passwordCallback) {
                                                                                                                                                                                                return this.passwordCallback(updatePassword,
                                                                                                                                                                                                                             PasswordResponses.NEED_PASSWORD);
                                                                                                                                                                                              }
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 3126..3133

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 76.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                          if (coords[p2 + 1] > coords[p3 + 1]) {
                                                                                                                                                                                            tmp = p2; p2 = p3; p3 = tmp; tmp = c2; c2 = c3; c3 = tmp;
                                                                                                                                                                                          }
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 2 other locations - About 1 hr to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 6259..6261
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 6265..6267

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 69.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                          if (coords[p1 + 1] > coords[p2 + 1]) {
                                                                                                                                                                                            tmp = p1; p1 = p2; p2 = tmp; tmp = c1; c1 = c2; c2 = tmp;
                                                                                                                                                                                          }
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 2 other locations - About 1 hr to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 6259..6261
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 6262..6264

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 69.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                          if (coords[p1 + 1] > coords[p2 + 1]) {
                                                                                                                                                                                            tmp = p1; p1 = p2; p2 = tmp; tmp = c1; c1 = c2; c2 = tmp;
                                                                                                                                                                                          }
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 2 other locations - About 1 hr to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 6262..6264
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 6265..6267

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 69.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                              this.imageLayer.appendImage({
                                                                                                                                                                                                objId: objId,
                                                                                                                                                                                                left: position[0],
                                                                                                                                                                                                top: position[1],
                                                                                                                                                                                                width: w / currentTransform[0],
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 5688..5694

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 65.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                              this.imageLayer.appendImage({
                                                                                                                                                                                                imgData: imgData,
                                                                                                                                                                                                left: position[0],
                                                                                                                                                                                                top: position[1],
                                                                                                                                                                                                width: width / currentTransform[0],
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 5484..5490

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 65.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                          if ((orderedX[0] === rect1[0] && orderedX[1] === rect2[0]) ||
                                                                                                                                                                                              (orderedX[0] === rect2[0] && orderedX[1] === rect1[0])) {
                                                                                                                                                                                            // Intersection must be between second and third points
                                                                                                                                                                                            result[0] = orderedX[1];
                                                                                                                                                                                            result[2] = orderedX[2];
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 691..698

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 62.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                          if ((orderedY[0] === rect1[1] && orderedY[1] === rect2[1]) ||
                                                                                                                                                                                              (orderedY[0] === rect2[1] && orderedY[1] === rect1[1])) {
                                                                                                                                                                                            // Intersection must be between second and third points
                                                                                                                                                                                            result[1] = orderedY[1];
                                                                                                                                                                                            result[3] = orderedY[2];
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 681..688

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 62.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                          setFillRGBColor: function CanvasGraphics_setFillRGBColor(r, g, b) {
                                                                                                                                                                                            var color = Util.makeCssRgb(arguments);
                                                                                                                                                                                            this.ctx.fillStyle = color;
                                                                                                                                                                                            this.current.fillColor = color;
                                                                                                                                                                                          },
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 5231..5235

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 60.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                          setStrokeRGBColor: function CanvasGraphics_setStrokeRGBColor(r, g, b) {
                                                                                                                                                                                            var color = Util.makeCssRgb(arguments);
                                                                                                                                                                                            this.ctx.strokeStyle = color;
                                                                                                                                                                                            this.current.strokeColor = color;
                                                                                                                                                                                          },
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 5236..5240

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 60.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                                  this.loadFakeWorkerFiles().then(function() {
                                                                                                                                                                                                    this.setupFakeWorker();
                                                                                                                                                                                                    workerInitializedCapability.resolve();
                                                                                                                                                                                                  }.bind(this));
                                                                                                                                                                                      Severity: Minor
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 1 other location - About 50 mins to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 3031..3034

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 51.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                          this.loadFakeWorkerFiles().then(function() {
                                                                                                                                                                                            this.setupFakeWorker();
                                                                                                                                                                                            workerInitializedCapability.resolve();
                                                                                                                                                                                          }.bind(this));
                                                                                                                                                                                      Severity: Minor
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 1 other location - About 50 mins to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 3006..3009

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 51.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                            maskCtx.fillStyle = (fillColor && fillColor.hasOwnProperty('type') &&
                                                                                                                                                                                                                fillColor.type === 'Pattern') ?
                                                                                                                                                                                                                fillColor.getPattern(maskCtx, this) : fillColor;
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 2 other locations - About 45 mins to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 5551..5553
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 5585..5587

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 50.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                            maskCtx.fillStyle = (fillColor && fillColor.hasOwnProperty('type') &&
                                                                                                                                                                                              fillColor.type === 'Pattern') ?
                                                                                                                                                                                              fillColor.getPattern(maskCtx, this) : fillColor;
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 2 other locations - About 45 mins to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 5525..5527
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 5585..5587

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 50.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                              maskCtx.fillStyle = (fillColor && fillColor.hasOwnProperty('type') &&
                                                                                                                                                                                                                  fillColor.type === 'Pattern') ?
                                                                                                                                                                                                                  fillColor.getPattern(maskCtx, this) : fillColor;
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 2 other locations - About 45 mins to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 5525..5527
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 5551..5553

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 50.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                            messageHandler.on('MissingPDF', function transportMissingPDF(data) {
                                                                                                                                                                                              this.workerReadyCapability.reject(data.exception.message,
                                                                                                                                                                                                                                data.exception);
                                                                                                                                                                                            }, this);
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 2 other locations - About 40 mins to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 3135..3137
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 3144..3147

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 49.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                              if (widthScale > 2 && paintWidth > 1) {
                                                                                                                                                                                                newWidth = Math.ceil(paintWidth / 2);
                                                                                                                                                                                                widthScale /= paintWidth / newWidth;
                                                                                                                                                                                              }
                                                                                                                                                                                      Severity: Minor
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 1 other location - About 40 mins to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 5669..5672

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 49.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                              if (heightScale > 2 && paintHeight > 1) {
                                                                                                                                                                                                newHeight = Math.ceil(paintHeight / 2);
                                                                                                                                                                                                heightScale /= paintHeight / newHeight;
                                                                                                                                                                                              }
                                                                                                                                                                                      Severity: Minor
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 1 other location - About 40 mins to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 5665..5668

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 49.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                            messageHandler.on('UnknownError', function transportUnknownError(data) {
                                                                                                                                                                                              this.workerReadyCapability.reject(data.exception.message,
                                                                                                                                                                                                                                data.exception);
                                                                                                                                                                                            }, this);
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 2 other locations - About 40 mins to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 3135..3137
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 3139..3142

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 49.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                            messageHandler.on('InvalidPDF', function transportInvalidPDF(data) {
                                                                                                                                                                                              this.workerReadyCapability.reject(data.exception.name, data.exception);
                                                                                                                                                                                            }, this);
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 2 other locations - About 40 mins to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 3139..3142
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 3144..3147

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 49.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                                case OPS.moveTo:
                                                                                                                                                                                                  x = args[j++];
                                                                                                                                                                                                  y = args[j++];
                                                                                                                                                                                                  ctx.moveTo(x, y);
                                                                                                                                                                                                  break;
                                                                                                                                                                                      Severity: Minor
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 1 other location - About 35 mins to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 4680..4684

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 47.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                                case OPS.lineTo:
                                                                                                                                                                                                  x = args[j++];
                                                                                                                                                                                                  y = args[j++];
                                                                                                                                                                                                  ctx.lineTo(x, y);
                                                                                                                                                                                                  break;
                                                                                                                                                                                      Severity: Minor
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 1 other location - About 35 mins to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 4675..4679

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 47.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                            m[0] * v[0] + m[1] * v[1] + m[2] * v[2],
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 3 other locations - About 30 mins to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 581..581
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 618..618
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 619..619

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 45.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                          var xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d;
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 3 other locations - About 30 mins to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 617..617
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 618..618
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 619..619

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 45.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                            m[6] * v[0] + m[7] * v[1] + m[8] * v[2]
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 3 other locations - About 30 mins to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 581..581
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 617..617
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 618..618

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 45.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                                                                                                                      Open

                                                                                                                                                                                            m[3] * v[0] + m[4] * v[1] + m[5] * v[2],
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in public/mozilla-pdf/core/pdf.js and 3 other locations - About 30 mins to fix
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 581..581
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 617..617
                                                                                                                                                                                      public/mozilla-pdf/core/pdf.js on lines 619..619

                                                                                                                                                                                      Duplicated Code

                                                                                                                                                                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                      Tuning

                                                                                                                                                                                      This issue has a mass of 45.

                                                                                                                                                                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                      Refactorings

                                                                                                                                                                                      Further Reading

                                                                                                                                                                                      There are no issues that match your filters.

                                                                                                                                                                                      Category
                                                                                                                                                                                      Status