ivmartel/dwv

View on GitHub

Showing 214 of 418 total issues

Function getn has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

jpeg.lossless.Decoder.prototype.getn = function (PRED, n, temp, index) {
    /*jslint bitwise: true */

    var result, one, n_one, mask, input;
    one = 1;
Severity: Major
Found in decoders/rii-mango/lossless.js - About 2 hrs to fix

    Function decodeACSuccessive has 62 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function decodeACSuccessive(component, offset) {
          var k = spectralStart;
          var e = spectralEnd;
          var r = 0;
          var s;
    Severity: Major
    Found in decoders/pdfjs/jpg.js - About 2 hrs to fix

      Function parseMultipart has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

      export function parseMultipart(arr) {
        const u8Array = new Uint8Array(arr);
      
        const parts = [];
        // check input
      Severity: Minor
      Found in src/utils/array.js - About 2 hrs 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 getSRContent has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

      export function getSRContent(dataElements) {
        // valueType -> ValueType (type1)
        let valueType = '';
        if (typeof dataElements[TagKeys.ValueType] !== 'undefined') {
          valueType = dataElements[TagKeys.ValueType].value[0];
      Severity: Minor
      Found in src/dicom/dicomSRContent.js - About 2 hrs 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 getDicomSRContentItem has 58 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function getDicomSRContentItem(content) {
        // dicom item (tags are in ~group/element order)
        let contentItem = {};
      
        if (typeof content.relationshipType !== 'undefined') {
      Severity: Major
      Found in src/dicom/dicomSRContent.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 MessageHandler has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

          function MessageHandler(name, comObj) {
            this.name = name;
            this.comObj = comObj;
            this.callbackIndex = 1;
            this.postMessageTransfers = true;
          Severity: Minor
          Found in decoders/pdfjs/util.js - About 2 hrs 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 getDicomSRContentItem has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

          export function getDicomSRContentItem(content) {
            // dicom item (tags are in ~group/element order)
            let contentItem = {};
          
            if (typeof content.relationshipType !== 'undefined') {
          Severity: Minor
          Found in src/dicom/dicomSRContent.js - About 2 hrs 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 StatTimerClosure has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

          var StatTimer = (function StatTimerClosure() {
            function rpad(str, pad, length) {
              while (str.length < length) {
                str += pad;
              }
          Severity: Minor
          Found in decoders/pdfjs/util.js - About 2 hrs 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 range3d has 56 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function range3d(dataAccessor, start, maxIter, increment,
            blockMaxIter, blockIncrement, reverse1, reverse2, isPlanar) {
            const iters = [];
            if (isPlanar) {
              iters.push(range(
          Severity: Major
          Found in src/image/iterator.js - About 2 hrs to fix

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

            var StatTimer = (function StatTimerClosure() {
              function rpad(str, pad, length) {
                while (str.length < length) {
                  str += pad;
                }
            Severity: Major
            Found in decoders/pdfjs/util.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 MessageHandler has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function MessageHandler(name, comObj) {
                  this.name = name;
                  this.comObj = comObj;
                  this.callbackIndex = 1;
                  this.postMessageTransfers = true;
                Severity: Major
                Found in decoders/pdfjs/util.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 getVariableRegionSliceIterator has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function getVariableRegionSliceIterator(
                      image, index, isRescaled, regions) {
                      if (image.getNumberOfComponents() !== 1) {
                        throw new Error('Unsupported number of components for region iterator: ' +
                          image.getNumberOfComponents());
                    Severity: Major
                    Found in src/image/iterator.js - About 2 hrs to fix

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

                        create(points, style, viewController) {
                          // physical shape
                          const roi = new ROI();
                          // add input points to the ROI
                          roi.addPoints(points);
                      Severity: Major
                      Found in src/tools/roi.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 decodeKeyValueUri has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export function decodeKeyValueUri(uri, replaceMode) {
                            const result = [];
                          
                            // repeat key replace mode (default to keep key)
                            let repeatKeyReplaceMode = 'key';
                          Severity: Major
                          Found in src/utils/uri.js - About 2 hrs to fix

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

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

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

                              },{"./data-stream.js":2,"./frame-header.js":4,"./huffman-table.js":5,"./quantization-table.js":7,"./scan-header.js":9,"./utils.js":10}],4:[function(require,module,exports){
                              /*
                               * Copyright (C) 2015 Michael Martinez
                               * Changes: Added support for selection values 2-7, fixed minor bugs &
                               * warnings, split into multiple class files, and general clean up.
                              Severity: Major
                              Found in decoders/rii-mango/lossless.js - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language