ivmartel/dwv

View on GitHub

Showing 386 of 386 total issues

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

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

      jpeg.lossless.Decoder.prototype.select6 = function (compOffset) {
          return this.getPreviousY(compOffset) + ((this.getPreviousX(compOffset) - this.getPreviousXY(compOffset)) >> 1);
      };
      Severity: Major
      Found in decoders/rii-mango/lossless.js and 1 other location - About 1 hr to fix
      decoders/rii-mango/lossless.js on lines 537..539

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

      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

      jpeg.lossless.Decoder.prototype.select5 = function (compOffset) {
          return this.getPreviousX(compOffset) + ((this.getPreviousY(compOffset) - this.getPreviousXY(compOffset)) >> 1);
      };
      Severity: Major
      Found in decoders/rii-mango/lossless.js and 1 other location - About 1 hr to fix
      decoders/rii-mango/lossless.js on lines 543..545

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

      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

      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

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

                if (typeof dataElements[TagKeys.SegmentedPropertyCategoryCodeSequence] !==
                  'undefined') {
                  segment.propertyCategoryCode =
                    getCode(
                      dataElements[TagKeys.SegmentedPropertyCategoryCodeSequence].value[0]
              Severity: Major
              Found in src/dicom/dicomSegment.js and 1 other location - About 1 hr to fix
              src/dicom/dicomSegment.js on lines 172..178

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

              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 (typeof dataElements[TagKeys.SegmentedPropertyTypeCodeSequence] !==
                  'undefined') {
                  segment.propertyTypeCode =
                    getCode(dataElements[TagKeys.SegmentedPropertyTypeCodeSequence].value[0]);
                } else {
              Severity: Major
              Found in src/dicom/dicomSegment.js and 1 other location - About 1 hr to fix
              src/dicom/dicomSegment.js on lines 162..170

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

              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

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

                    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

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

                        if (typeof seg1.displayRGBValue !== 'undefined' &&
                          typeof seg2.displayRGBValue !== 'undefined') {
                          isSimilar = isSimilar ||
                            isEqualRgb(seg1.displayRGBValue, seg2.displayRGBValue);
                        } else if (typeof seg1.displayValue !== 'undefined' &&
                      Severity: Major
                      Found in src/dicom/dicomSegment.js and 1 other location - About 1 hr to fix
                      src/dicom/dicomSegment.js on lines 207..217

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

                      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 (typeof seg1.displayRGBValue !== 'undefined' &&
                          typeof seg2.displayRGBValue !== 'undefined') {
                          isEqual = isEqual &&
                            isEqualRgb(seg1.displayRGBValue, seg2.displayRGBValue);
                        } else if (typeof seg1.displayValue !== 'undefined' &&
                      Severity: Major
                      Found in src/dicom/dicomSegment.js and 1 other location - About 1 hr to fix
                      src/dicom/dicomSegment.js on lines 249..259

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

                      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

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

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

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

                        export function simpleRange3d(
                          dataAccessor, start, end, increment, isPlanar) {
                          if (typeof increment === 'undefined') {
                            increment = 1;
                          }
                        Severity: Minor
                        Found in src/image/iterator.js - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language