ivmartel/dwv

View on GitHub
decoders/pdfjs/jpx.js

Summary

Maintainability
F
2 mos
Test Coverage

Function JpxImageClosure has a Cognitive Complexity of 1144 (exceeds 5 allowed). Consider refactoring.
Open

var JpxImage = (function JpxImageClosure() {
  // Table E.1
  var SubbandsGainLog2 = {
    'LL': 0,
    'LH': 1,
Severity: Minor
Found in decoders/pdfjs/jpx.js - About 3 wks 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 JpxImageClosure has 1992 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var JpxImage = (function JpxImageClosure() {
  // Table E.1
  var SubbandsGainLog2 = {
    'LL': 0,
    'LH': 1,
Severity: Major
Found in decoders/pdfjs/jpx.js - About 1 wk to fix

    File jpx.js has 1995 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 decoders/pdfjs/jpx.js - About 5 days to fix

      Function BitModelClosure has 299 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        var BitModel = (function BitModelClosure() {
          var UNIFORM_CONTEXT = 17;
          var RUNLENGTH_CONTEXT = 18;
          // Table D-1
          // The index is binary presentation: 0dddvvhh, ddd - sum of Di (0..4),
      Severity: Major
      Found in decoders/pdfjs/jpx.js - About 1 day to fix

        Function JpxImage_parseCodestream has 253 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            parseCodestream: function JpxImage_parseCodestream(data, start, end) {
              var context = {};
              try {
                var doNotRecover = false;
                var position = start;
        Severity: Major
        Found in decoders/pdfjs/jpx.js - About 1 day to fix

          Function parseTilePackets has 176 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function parseTilePackets(context, data, offset, dataLength) {
              var position = 0;
              var buffer, bufferSize = 0, skipNextBit = false;
              function readBits(count) {
                while (bufferSize < count) {
          Severity: Major
          Found in decoders/pdfjs/jpx.js - About 7 hrs to fix

            Function transformComponents has 102 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function transformComponents(context) {
                var siz = context.SIZ;
                var components = context.components;
                var componentsCount = siz.Csiz;
                var resultImages = [];
            Severity: Major
            Found in decoders/pdfjs/jpx.js - About 4 hrs to fix

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

                function buildPackets(context) {
                  var siz = context.SIZ;
                  var tileIndex = context.currentTile.index;
                  var tile = context.tiles[tileIndex];
                  var componentsCount = siz.Csiz;
              Severity: Major
              Found in decoders/pdfjs/jpx.js - About 3 hrs to fix

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

                  var Transform = (function TransformClosure() {
                    function Transform() {}
                
                    Transform.prototype.calculate =
                      function transformCalculate(subbands, u0, v0) {
                Severity: Major
                Found in decoders/pdfjs/jpx.js - About 3 hrs to fix

                  Function copyCoefficients has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function copyCoefficients(coefficients, levelWidth, levelHeight, subband,
                                              delta, mb, reversible, segmentationSymbolUsed) {
                      var x0 = subband.tbx0;
                      var y0 = subband.tby0;
                      var width = subband.tbx1 - subband.tbx0;
                  Severity: Major
                  Found in decoders/pdfjs/jpx.js - About 3 hrs to fix

                    Function BitModel_runCleanupPass has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          runCleanupPass: function BitModel_runCleanupPass() {
                            var decoder = this.decoder;
                            var width = this.width, height = this.height;
                            var neighborsSignificance = this.neighborsSignificance;
                            var coefficentsMagnitude = this.coefficentsMagnitude;
                    Severity: Major
                    Found in decoders/pdfjs/jpx.js - About 3 hrs to fix

                      Function IrreversibleTransformClosure has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        var IrreversibleTransform = (function IrreversibleTransformClosure() {
                          function IrreversibleTransform() {
                            Transform.call(this);
                          }
                      
                      
                      Severity: Major
                      Found in decoders/pdfjs/jpx.js - About 3 hrs to fix

                        Function JpxImage_parse has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            parse: function JpxImage_parse(data) {
                        
                              var head = readUint16(data, 0);
                              // No box header, immediate start of codestream (SOC)
                              if (head === 0xFF4F) {
                        Severity: Major
                        Found in decoders/pdfjs/jpx.js - About 2 hrs to fix

                          Function Transform_iterate has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              Transform.prototype.iterate = function Transform_iterate(ll, hl_lh_hh,
                                                                                       u0, v0) {
                                var llWidth = ll.width, llHeight = ll.height, llItems = ll.items;
                                var width = hl_lh_hh.width;
                                var height = hl_lh_hh.height;
                          Severity: Major
                          Found in decoders/pdfjs/jpx.js - About 2 hrs to fix

                            Function InclusionTreeClosure has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              var InclusionTree = (function InclusionTreeClosure() {
                                function InclusionTree(width, height,  defaultValue) {
                                  var levelsLength = log2(Math.max(width, height)) + 1;
                                  this.levels = [];
                                  for (var i = 0; i < levelsLength; i++) {
                            Severity: Major
                            Found in decoders/pdfjs/jpx.js - About 2 hrs to fix

                              Function buildCodeblocks has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                function buildCodeblocks(context, subband, dimensions) {
                                  // Section B.7 Division sub-band into code-blocks
                                  var xcb_ = dimensions.xcb_;
                                  var ycb_ = dimensions.ycb_;
                                  var codeblockWidth = 1 << xcb_;
                              Severity: Major
                              Found in decoders/pdfjs/jpx.js - About 2 hrs to fix

                                Function irreversibleTransformFilter has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                      function irreversibleTransformFilter(x, offset, length) {
                                      var len = length >> 1;
                                      offset = offset | 0;
                                      var j, n, current, next;
                                
                                
                                Severity: Major
                                Found in decoders/pdfjs/jpx.js - About 2 hrs to fix

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

                                    function getPrecinctSizesInImageScale(tile) {
                                      var componentsCount = tile.components.length;
                                      var minWidth = Number.MAX_VALUE;
                                      var minHeight = Number.MAX_VALUE;
                                      var maxNumWide = 0;
                                  Severity: Major
                                  Found in decoders/pdfjs/jpx.js - About 2 hrs to fix

                                    Function TagTreeClosure has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      var TagTree = (function TagTreeClosure() {
                                        function TagTree(width, height) {
                                          var levelsLength = log2(Math.max(width, height)) + 1;
                                          this.levels = [];
                                          for (var i = 0; i < levelsLength; i++) {
                                    Severity: Major
                                    Found in decoders/pdfjs/jpx.js - About 2 hrs to fix

                                      Function ResolutionPositionComponentLayerIterator has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        function ResolutionPositionComponentLayerIterator(context) {
                                          var siz = context.SIZ;
                                          var tileIndex = context.currentTile.index;
                                          var tile = context.tiles[tileIndex];
                                          var layersCount = tile.codingStyleDefaultParameters.layersCount;
                                      Severity: Major
                                      Found in decoders/pdfjs/jpx.js - About 2 hrs to fix

                                        Function transformTile has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          function transformTile(context, tile, c) {
                                            var component = tile.components[c];
                                            var codingStyleParameters = component.codingStyleParameters;
                                            var quantizationParameters = component.quantizationParameters;
                                            var decompositionLevelsCount =
                                        Severity: Major
                                        Found in decoders/pdfjs/jpx.js - About 2 hrs to fix

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

                                                decodeSignBit: function BitModel_decodeSignBit(row, column, index) {
                                                  var width = this.width, height = this.height;
                                                  var coefficentsMagnitude = this.coefficentsMagnitude;
                                                  var coefficentsSign = this.coefficentsSign;
                                                  var contribution, sign0, sign1, significance1;
                                          Severity: Minor
                                          Found in decoders/pdfjs/jpx.js - About 1 hr to fix

                                            Function PositionComponentResolutionLayerIterator has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                              function PositionComponentResolutionLayerIterator(context) {
                                                var siz = context.SIZ;
                                                var tileIndex = context.currentTile.index;
                                                var tile = context.tiles[tileIndex];
                                                var layersCount = tile.codingStyleDefaultParameters.layersCount;
                                            Severity: Minor
                                            Found in decoders/pdfjs/jpx.js - About 1 hr to fix

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

                                                function ComponentPositionResolutionLayerIterator(context) {
                                                  var siz = context.SIZ;
                                                  var tileIndex = context.currentTile.index;
                                                  var tile = context.tiles[tileIndex];
                                                  var layersCount = tile.codingStyleDefaultParameters.layersCount;
                                              Severity: Minor
                                              Found in decoders/pdfjs/jpx.js - About 1 hr to fix

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

                                                        function BitModel_runSignificancePropogationPass() {
                                                        var decoder = this.decoder;
                                                        var width = this.width, height = this.height;
                                                        var coefficentsMagnitude = this.coefficentsMagnitude;
                                                        var coefficentsSign = this.coefficentsSign;
                                                Severity: Minor
                                                Found in decoders/pdfjs/jpx.js - About 1 hr to fix

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

                                                    function LayerResolutionComponentPositionIterator(context) {
                                                      var siz = context.SIZ;
                                                      var tileIndex = context.currentTile.index;
                                                      var tile = context.tiles[tileIndex];
                                                      var layersCount = tile.codingStyleDefaultParameters.layersCount;
                                                  Severity: Minor
                                                  Found in decoders/pdfjs/jpx.js - About 1 hr to fix

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

                                                      function calculateTileGrids(context, components) {
                                                        var siz = context.SIZ;
                                                        // Section B.3 Division into tile and tile-components
                                                        var tile, tiles = [];
                                                        var numXtiles = Math.ceil((siz.Xsiz - siz.XTOsiz) / siz.XTsiz);
                                                    Severity: Minor
                                                    Found in decoders/pdfjs/jpx.js - About 1 hr to fix

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

                                                        function ResolutionLayerComponentPositionIterator(context) {
                                                          var siz = context.SIZ;
                                                          var tileIndex = context.currentTile.index;
                                                          var tile = context.tiles[tileIndex];
                                                          var layersCount = tile.codingStyleDefaultParameters.layersCount;
                                                      Severity: Minor
                                                      Found in decoders/pdfjs/jpx.js - About 1 hr to fix

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

                                                                function BitModel_runMagnitudeRefinementPass() {
                                                                var decoder = this.decoder;
                                                                var width = this.width, height = this.height;
                                                                var coefficentsMagnitude = this.coefficentsMagnitude;
                                                                var neighborsSignificance = this.neighborsSignificance;
                                                        Severity: Minor
                                                        Found in decoders/pdfjs/jpx.js - About 1 hr to fix

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

                                                              this.nextPacket = function JpxImage_nextPacket() {
                                                                // Section B.12.1.5 Component-position-resolution-layer
                                                                for (; c < componentsCount; ++c) {
                                                                  var component = tile.components[c];
                                                                  var precinctsIterationSizes = precinctsSizes.components[c];
                                                          Severity: Minor
                                                          Found in decoders/pdfjs/jpx.js - About 1 hr to fix

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

                                                                    function BitModel_setNeighborsSignificance(row, column, index) {
                                                                    var neighborsSignificance = this.neighborsSignificance;
                                                                    var width = this.width, height = this.height;
                                                                    var left = (column > 0);
                                                                    var right = (column + 1 < width);
                                                            Severity: Minor
                                                            Found in decoders/pdfjs/jpx.js - About 1 hr to fix

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

                                                                  this.nextPacket = function JpxImage_nextPacket() {
                                                                    // Section B.12.1.4 Position-component-resolution-layer
                                                                    for (; py < precinctsIterationSizes.maxNumHigh; py++) {
                                                                      for (; px < precinctsIterationSizes.maxNumWide; px++) {
                                                                        for (; c < componentsCount; c++) {
                                                              Severity: Minor
                                                              Found in decoders/pdfjs/jpx.js - About 1 hr to fix

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

                                                                  function copyCoefficients(coefficients, levelWidth, levelHeight, subband,
                                                                                            delta, mb, reversible, segmentationSymbolUsed) {
                                                                Severity: Major
                                                                Found in decoders/pdfjs/jpx.js - About 1 hr to fix

                                                                  Avoid deeply nested control flow statements.
                                                                  Open

                                                                              if (readBits(1)) {
                                                                                valueReady = !zeroBitPlanesTree.nextLevel();
                                                                                if (valueReady) {
                                                                                  break;
                                                                                }
                                                                  Severity: Major
                                                                  Found in decoders/pdfjs/jpx.js - About 45 mins to fix

                                                                    Avoid deeply nested control flow statements.
                                                                    Open

                                                                                for (pos = c, j = 0, jj = items.length; j < jj; j++) {
                                                                                  val = items[j];
                                                                                  out[pos] = val <= min ? 0 :
                                                                                             val >= max ? 255 : (val + offset) >> shift;
                                                                                  pos += componentsCount;
                                                                    Severity: Major
                                                                    Found in decoders/pdfjs/jpx.js - About 45 mins to fix

                                                                      Avoid deeply nested control flow statements.
                                                                      Open

                                                                                  if (sign[position] !== 0) {
                                                                                    n = -n;
                                                                                  }
                                                                      Severity: Major
                                                                      Found in decoders/pdfjs/jpx.js - About 45 mins to fix

                                                                        Avoid deeply nested control flow statements.
                                                                        Open

                                                                                    if (reversible && (nb >= mb)) {
                                                                                      coefficients[pos] = n;
                                                                                    } else {
                                                                                      coefficients[pos] = n * (1 << (mb - nb));
                                                                                    }
                                                                        Severity: Major
                                                                        Found in decoders/pdfjs/jpx.js - About 45 mins to fix

                                                                          Avoid deeply nested control flow statements.
                                                                          Open

                                                                                      for (var l=0; l < layerNumber; l++) {
                                                                                        if (readBits(1) !== 0) {
                                                                                          throw new Error('JPX Error: Invalid tag tree');
                                                                                        }
                                                                                      }
                                                                          Severity: Major
                                                                          Found in decoders/pdfjs/jpx.js - About 45 mins to fix

                                                                            Avoid deeply nested control flow statements.
                                                                            Open

                                                                                        while (true) {
                                                                                          if (readBits(1)) {
                                                                                            valueReady = !inclusionTree.nextLevel();
                                                                                            if (valueReady) {
                                                                                              codeblock.included = true;
                                                                            Severity: Major
                                                                            Found in decoders/pdfjs/jpx.js - About 45 mins to fix

                                                                              Avoid deeply nested control flow statements.
                                                                              Open

                                                                                            if (k === null) {
                                                                                              continue;
                                                                                            }
                                                                              Severity: Major
                                                                              Found in decoders/pdfjs/jpx.js - About 45 mins to fix

                                                                                Avoid deeply nested control flow statements.
                                                                                Open

                                                                                            for (pos = c, j = 0, jj = items.length; j < jj; j++) {
                                                                                              val = items[j];
                                                                                              out[pos] = (val + offset);
                                                                                              pos += componentsCount;
                                                                                            }
                                                                                Severity: Major
                                                                                Found in decoders/pdfjs/jpx.js - About 45 mins to fix

                                                                                  Avoid deeply nested control flow statements.
                                                                                  Open

                                                                                                for (b = 0; b < numBuffers; b++) {
                                                                                                  colBuffers[b][l] = items[k + b];
                                                                                                }
                                                                                  Severity: Major
                                                                                  Found in decoders/pdfjs/jpx.js - About 45 mins to fix

                                                                                    Avoid deeply nested control flow statements.
                                                                                    Open

                                                                                                  for (; l < layersCount;) {
                                                                                                    var packet = createPacket(resolution, k, l);
                                                                                                    l++;
                                                                                                    return packet;
                                                                                                  }
                                                                                    Severity: Major
                                                                                    Found in decoders/pdfjs/jpx.js - About 45 mins to fix

                                                                                      Avoid deeply nested control flow statements.
                                                                                      Open

                                                                                                    for (b = 0; b < numBuffers; b++) {
                                                                                                      items[k + b] = colBuffers[b][l];
                                                                                                    }
                                                                                      Severity: Major
                                                                                      Found in decoders/pdfjs/jpx.js - About 45 mins to fix

                                                                                        Avoid deeply nested control flow statements.
                                                                                        Open

                                                                                                    if(isSigned){
                                                                                                      shift = 0;
                                                                                                      offset = 0;
                                                                                                    }else{
                                                                                                      shift = components[c].precision - 8;
                                                                                        Severity: Major
                                                                                        Found in decoders/pdfjs/jpx.js - About 45 mins to fix

                                                                                          Avoid deeply nested control flow statements.
                                                                                          Open

                                                                                                        if (k === null) {
                                                                                                          continue;
                                                                                                        }
                                                                                          Severity: Major
                                                                                          Found in decoders/pdfjs/jpx.js - About 45 mins to fix

                                                                                            Avoid deeply nested control flow statements.
                                                                                            Open

                                                                                                          for (; l < layersCount;) {
                                                                                                            var packet = createPacket(resolution, k, l);
                                                                                                            l++;
                                                                                                            return packet;
                                                                                                          }
                                                                                            Severity: Major
                                                                                            Found in decoders/pdfjs/jpx.js - About 45 mins to fix

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

                                                                                                  function BitModel(width, height, subband, zeroBitPlanes, mb) {
                                                                                              Severity: Minor
                                                                                              Found in decoders/pdfjs/jpx.js - About 35 mins to fix

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

                                                                                                    pxIndex, pyIndex, sizeInImageScale, precinctIterationSizes, resolution) {
                                                                                                Severity: Minor
                                                                                                Found in decoders/pdfjs/jpx.js - About 35 mins to fix

                                                                                                  Avoid too many return statements within this function.
                                                                                                  Open

                                                                                                        return value + 37;
                                                                                                  Severity: Major
                                                                                                  Found in decoders/pdfjs/jpx.js - About 30 mins to fix

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

                                                                                                      function LayerResolutionComponentPositionIterator(context) {
                                                                                                        var siz = context.SIZ;
                                                                                                        var tileIndex = context.currentTile.index;
                                                                                                        var tile = context.tiles[tileIndex];
                                                                                                        var layersCount = tile.codingStyleDefaultParameters.layersCount;
                                                                                                    Severity: Major
                                                                                                    Found in decoders/pdfjs/jpx.js and 1 other location - About 1 day to fix
                                                                                                    decoders/pdfjs/jpx.js on lines 649..687

                                                                                                    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 343.

                                                                                                    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

                                                                                                      function ResolutionLayerComponentPositionIterator(context) {
                                                                                                        var siz = context.SIZ;
                                                                                                        var tileIndex = context.currentTile.index;
                                                                                                        var tile = context.tiles[tileIndex];
                                                                                                        var layersCount = tile.codingStyleDefaultParameters.layersCount;
                                                                                                    Severity: Major
                                                                                                    Found in decoders/pdfjs/jpx.js and 1 other location - About 1 day to fix
                                                                                                    decoders/pdfjs/jpx.js on lines 610..648

                                                                                                    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 343.

                                                                                                    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

                                                                                                          for (n = len + 2; n--; j += 2) {
                                                                                                            next = gamma * x[j + 1];
                                                                                                            x[j] -= current + next;
                                                                                                            if (n--) {
                                                                                                              j += 2;
                                                                                                    Severity: Major
                                                                                                    Found in decoders/pdfjs/jpx.js and 1 other location - About 4 hrs to fix
                                                                                                    decoders/pdfjs/jpx.js on lines 2177..2187

                                                                                                    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 116.

                                                                                                    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

                                                                                                          for (n = len + 1; n--; j += 2) {
                                                                                                            next = beta * x[j + 1];
                                                                                                            x[j] -= current + next;
                                                                                                            if (n--) {
                                                                                                              j += 2;
                                                                                                    Severity: Major
                                                                                                    Found in decoders/pdfjs/jpx.js and 1 other location - About 4 hrs to fix
                                                                                                    decoders/pdfjs/jpx.js on lines 2162..2172

                                                                                                    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 116.

                                                                                                    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 (spqcdSize === 8) {
                                                                                                                      spqcd.epsilon = data[j++] >> 3;
                                                                                                                      spqcd.mu = 0;
                                                                                                                    } else {
                                                                                                                      spqcd.epsilon = data[j] >> 3;
                                                                                                    Severity: Major
                                                                                                    Found in decoders/pdfjs/jpx.js and 1 other location - About 3 hrs to fix
                                                                                                    decoders/pdfjs/jpx.js on lines 217..224

                                                                                                    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 108.

                                                                                                    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 (spqcdSize === 8) {
                                                                                                                      spqcd.epsilon = data[j++] >> 3;
                                                                                                                      spqcd.mu = 0;
                                                                                                                    } else {
                                                                                                                      spqcd.epsilon = data[j] >> 3;
                                                                                                    Severity: Major
                                                                                                    Found in decoders/pdfjs/jpx.js and 1 other location - About 3 hrs to fix
                                                                                                    decoders/pdfjs/jpx.js on lines 269..276

                                                                                                    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 108.

                                                                                                    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 HHContextLabel = new Uint8Array([
                                                                                                          0, 1, 2, 0, 1, 2, 2, 0, 2, 2, 2, 0, 0, 0, 0, 0, 3, 4, 5, 0, 4, 5, 5, 0, 5,
                                                                                                          5, 5, 0, 0, 0, 0, 0, 6, 7, 7, 0, 7, 7, 7, 0, 7, 7, 7, 0, 0, 0, 0, 0, 8, 8,
                                                                                                          8, 0, 8, 8, 8, 0, 8, 8, 8, 0, 0, 0, 0, 0, 8, 8, 8, 0, 8, 8, 8, 0, 8, 8, 8
                                                                                                        ]);
                                                                                                    Severity: Major
                                                                                                    Found in decoders/pdfjs/jpx.js and 1 other location - About 2 hrs to fix
                                                                                                    decoders/pdfjs/jpx.js on lines 1655..1659

                                                                                                    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 87.

                                                                                                    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 HLContextLabel = new Uint8Array([
                                                                                                          0, 3, 4, 0, 5, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 1, 3, 4, 0, 6, 7, 7, 0, 8,
                                                                                                          8, 8, 0, 0, 0, 0, 0, 2, 3, 4, 0, 6, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 2, 3,
                                                                                                          4, 0, 6, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 2, 3, 4, 0, 6, 7, 7, 0, 8, 8, 8
                                                                                                        ]);
                                                                                                    Severity: Major
                                                                                                    Found in decoders/pdfjs/jpx.js and 1 other location - About 2 hrs to fix
                                                                                                    decoders/pdfjs/jpx.js on lines 1660..1664

                                                                                                    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 87.

                                                                                                    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

                                                                                                                  switch (sqcd & 0x1F) {
                                                                                                                    case 0:
                                                                                                                      spqcdSize = 8;
                                                                                                                      scalarExpounded = true;
                                                                                                                      break;
                                                                                                    Severity: Major
                                                                                                    Found in decoders/pdfjs/jpx.js and 1 other location - About 2 hrs to fix
                                                                                                    decoders/pdfjs/jpx.js on lines 247..262

                                                                                                    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 78.

                                                                                                    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

                                                                                                                  switch (sqcd & 0x1F) {
                                                                                                                    case 0:
                                                                                                                      spqcdSize = 8;
                                                                                                                      scalarExpounded = true;
                                                                                                                      break;
                                                                                                    Severity: Major
                                                                                                    Found in decoders/pdfjs/jpx.js and 1 other location - About 2 hrs to fix
                                                                                                    decoders/pdfjs/jpx.js on lines 195..210

                                                                                                    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 78.

                                                                                                    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 (row + 1 < height) {
                                                                                                              i = index + width;
                                                                                                              if (left) {
                                                                                                                neighborsSignificance[i - 1] += 0x10;
                                                                                                              }
                                                                                                    Severity: Major
                                                                                                    Found in decoders/pdfjs/jpx.js and 1 other location - About 1 hr to fix
                                                                                                    decoders/pdfjs/jpx.js on lines 1718..1727

                                                                                                    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 70.

                                                                                                    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 (row > 0) {
                                                                                                              i = index - width;
                                                                                                              if (left) {
                                                                                                                neighborsSignificance[i - 1] += 0x10;
                                                                                                              }
                                                                                                    Severity: Major
                                                                                                    Found in decoders/pdfjs/jpx.js and 1 other location - About 1 hr to fix
                                                                                                    decoders/pdfjs/jpx.js on lines 1729..1738

                                                                                                    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 70.

                                                                                                    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 numprecinctshigh = (resolution.try1 > resolution.try0 ?
                                                                                                          Math.ceil(resolution.try1 / precinctHeight) -
                                                                                                          Math.floor(resolution.try0 / precinctHeight) : 0);
                                                                                                    Severity: Major
                                                                                                    Found in decoders/pdfjs/jpx.js and 1 other location - About 1 hr to fix
                                                                                                    decoders/pdfjs/jpx.js on lines 490..492

                                                                                                    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 61.

                                                                                                    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 numprecinctswide = (resolution.trx1 > resolution.trx0 ?
                                                                                                          Math.ceil(resolution.trx1 / precinctWidth) -
                                                                                                          Math.floor(resolution.trx0 / precinctWidth) : 0);
                                                                                                    Severity: Major
                                                                                                    Found in decoders/pdfjs/jpx.js and 1 other location - About 1 hr to fix
                                                                                                    decoders/pdfjs/jpx.js on lines 493..495

                                                                                                    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 61.

                                                                                                    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

                                                                                                        result.xcb_ = (r > 0 ? Math.min(codOrCoc.xcb, result.PPx - 1) :
                                                                                                                       Math.min(codOrCoc.xcb, result.PPx));
                                                                                                    Severity: Major
                                                                                                    Found in decoders/pdfjs/jpx.js and 1 other location - About 1 hr to fix
                                                                                                    decoders/pdfjs/jpx.js on lines 465..466

                                                                                                    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 58.

                                                                                                    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

                                                                                                        result.ycb_ = (r > 0 ? Math.min(codOrCoc.ycb, result.PPy - 1) :
                                                                                                                       Math.min(codOrCoc.ycb, result.PPy));
                                                                                                    Severity: Major
                                                                                                    Found in decoders/pdfjs/jpx.js and 1 other location - About 1 hr to fix
                                                                                                    decoders/pdfjs/jpx.js on lines 463..464

                                                                                                    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 58.

                                                                                                    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 (context.mainHeader) {
                                                                                                                    context.COD = cod;
                                                                                                                  } else {
                                                                                                                    context.currentTile.COD = cod;
                                                                                                                    context.currentTile.COC = [];
                                                                                                    Severity: Major
                                                                                                    Found in decoders/pdfjs/jpx.js and 1 other location - About 1 hr to fix
                                                                                                    decoders/pdfjs/jpx.js on lines 228..233

                                                                                                    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 57.

                                                                                                    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 (context.mainHeader) {
                                                                                                                    context.QCD = qcd;
                                                                                                                  } else {
                                                                                                                    context.currentTile.QCD = qcd;
                                                                                                                    context.currentTile.QCC = [];
                                                                                                    Severity: Major
                                                                                                    Found in decoders/pdfjs/jpx.js and 1 other location - About 1 hr to fix
                                                                                                    decoders/pdfjs/jpx.js on lines 342..347

                                                                                                    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 57.

                                                                                                    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 (i < precinct.cbxMin) {
                                                                                                                precinct.cbxMin = i;
                                                                                                              } else if (i > precinct.cbxMax) {
                                                                                                                precinct.cbxMax = i;
                                                                                                              }
                                                                                                    Severity: Minor
                                                                                                    Found in decoders/pdfjs/jpx.js and 1 other location - About 55 mins to fix
                                                                                                    decoders/pdfjs/jpx.js on lines 564..568

                                                                                                    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 53.

                                                                                                    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 (j < precinct.cbyMin) {
                                                                                                                precinct.cbxMin = j;
                                                                                                              } else if (j > precinct.cbyMax) {
                                                                                                                precinct.cbyMax = j;
                                                                                                              }
                                                                                                    Severity: Minor
                                                                                                    Found in decoders/pdfjs/jpx.js and 1 other location - About 55 mins to fix
                                                                                                    decoders/pdfjs/jpx.js on lines 559..563

                                                                                                    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 53.

                                                                                                    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 codOrCoc = (context.currentTile.COC[c] !== undefined  ?
                                                                                                            context.currentTile.COC[c] : context.currentTile.COD);
                                                                                                    Severity: Minor
                                                                                                    Found in decoders/pdfjs/jpx.js and 1 other location - About 40 mins to fix
                                                                                                    decoders/pdfjs/jpx.js on lines 1492..1493

                                                                                                    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

                                                                                                          var qcdOrQcc = (context.currentTile.QCC[c] !== undefined ?
                                                                                                            context.currentTile.QCC[c] : context.currentTile.QCD);
                                                                                                    Severity: Minor
                                                                                                    Found in decoders/pdfjs/jpx.js and 1 other location - About 40 mins to fix
                                                                                                    decoders/pdfjs/jpx.js on lines 1495..1496

                                                                                                    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

                                                                                                    There are no issues that match your filters.

                                                                                                    Category
                                                                                                    Status