ivmartel/dwv

View on GitHub

Showing 209 of 399 total issues

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

},{}],9:[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: Minor
Found in decoders/rii-mango/lossless.js - About 1 hr to fix

    Function range has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function range(dataAccessor, start, maxIter, increment,
      blockMaxIter, blockIncrement, reverse1, reverse2) {
      if (typeof reverse1 === 'undefined') {
        reverse1 = false;
      }
    Severity: Minor
    Found in src/image/iterator.js - About 1 hr to fix

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

      export function getDimensionOrganization(dataElements) {
        // Dimension Organization Sequence (required)
        const orgSq = dataElements['00209221'];
        if (typeof orgSq === 'undefined' || orgSq.value.length !== 1) {
          throw new Error('Unsupported dimension organization sequence length');
      Severity: Minor
      Found in src/dicom/dicomElementsWrapper.js - About 1 hr 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 getHuffmanValue has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          jpeg.lossless.Decoder.prototype.getHuffmanValue = function (table, temp, index) {
              /*jslint bitwise: true */
          
              var code, input, mask;
              mask = 0xFFFF;
          Severity: Minor
          Found in decoders/rii-mango/lossless.js - About 1 hr to fix

            Function range has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

            export function range(dataAccessor, start, maxIter, increment,
              blockMaxIter, blockIncrement, reverse1, reverse2) {
              if (typeof reverse1 === 'undefined') {
                reverse1 = false;
              }
            Severity: Minor
            Found in src/image/iterator.js - About 1 hr 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 PageViewportClosure has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

            var PageViewport = PDFJS.PageViewport = (function PageViewportClosure() {
              /**
               * @constructor
               * @private
               * @param viewBox {Array} xMin, yMin, xMax and yMax coordinates.
            Severity: Minor
            Found in decoders/pdfjs/util.js - About 1 hr 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 read has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            jpeg.lossless.QuantizationTable.prototype.read = function (data, table) {
                /*jslint bitwise: true */
            
                var count = 0, length, temp, t, i;
            
            
            Severity: Minor
            Found in decoders/rii-mango/lossless.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

                Consider simplifying this complex logical expression.
                Open

                    } else if (isOtherVR ||
                        dicomElement.vr === 'pi' ||
                        dicomElement.vr === 'UL' ||
                        dicomElement.vr === 'US' ||
                        dicomElement.vr === 'SL' ||
                Severity: Critical
                Found in src/dicom/dicomElementsWrapper.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 convertCmykToRgb has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        _convertCmykToRgb: function convertCmykToRgb(data) {
                          var c, m, y, k;
                          var offset = 0;
                          var min = -255 * 255 * 255;
                          var scale = 1 / 255 / 255;
                    Severity: Minor
                    Found in decoders/pdfjs/jpg.js - About 1 hr to fix

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

                      jpeg.lossless.HuffmanTable.prototype.read = function(data, HuffTab) {
                          /*jslint bitwise: true */
                      
                          var count = 0, length, temp, t, c, i, j;
                      
                      
                      Severity: Minor
                      Found in decoders/rii-mango/lossless.js - About 1 hr to fix

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

                            _getLinearizedBlockData: function getLinearizedBlockData(width, height) {
                              var scaleX = this.width / width, scaleY = this.height / height;
                        
                              var component, componentScaleX, componentScaleY, blocksPerScanline;
                              var x, y, i, j, k;
                        Severity: Minor
                        Found in decoders/pdfjs/jpg.js - About 1 hr to fix

                          Function replaceFlags has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export function replaceFlags(inputStr, values) {
                            let res = '';
                            // check input string
                            if (inputStr === null || typeof inputStr === 'undefined') {
                              return res;
                          Severity: Minor
                          Found in src/utils/string.js - About 1 hr 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 getFileListFromDicomDir has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export function getFileListFromDicomDir(data) {
                            // parse file
                            const parser = new DicomParser();
                            parser.parse(data);
                            const elements = parser.getDicomElements();
                          Severity: Minor
                          Found in src/dicom/dicomElementsWrapper.js - About 1 hr 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 Promise_all has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

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

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

                            module.exports = function (config) {
                              config.set({
                                basePath: '.',
                                frameworks: ['qunit', 'webpack'],
                                files: [
                            Severity: Minor
                            Found in karma.conf.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 convertYcckToRgb has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    _convertYcckToRgb: function convertYcckToRgb(data) {
                                      var Y, Cb, Cr, k;
                                      var offset = 0;
                                      for (var i = 0, length = data.length; i < length; i += 4) {
                                        Y  = data[i];
                                Severity: Minor
                                Found in decoders/pdfjs/jpg.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language