ivmartel/dwv

View on GitHub

Showing 386 of 386 total issues

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 getSliceIterator has 92 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function getSliceIterator(
        image, position, isRescaled, viewOrientation) {
        const size = image.getGeometry().getSize();
        // zero-ify non direction index
        let dirMax2Index = 2;
      Severity: Major
      Found in src/image/iterator.js - About 3 hrs to fix

        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

        Function 7 has 88 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        },{"./component-spec.js":1,"./data-stream.js":2,"./decoder.js":3,"./frame-header.js":4,"./huffman-table.js":5,"./quantization-table.js":7,"./scan-component.js":8,"./scan-header.js":9,"./utils.js":10}],7:[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 3 hrs to fix

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

                  } else {
                      for (i = 0; i < 64; i+=1) {
                          if (count > length) {
                              throw new Error("ERROR: Quantization table format error");
                          }
          Severity: Major
          Found in decoders/rii-mango/lossless.js and 1 other location - About 3 hrs to fix
          decoders/rii-mango/lossless.js on lines 1451..1462

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

          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 (this.precision[t] === 8) {
                      for (i = 0; i < 64; i+=1) {
                          if (count > length) {
                              throw new Error("ERROR: Quantization table format error");
                          }
          Severity: Major
          Found in decoders/rii-mango/lossless.js and 1 other location - About 3 hrs to fix
          decoders/rii-mango/lossless.js on lines 1462..1473

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

          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

          export function isEqualCode(code1, code2) {
            return Object.keys(code1).length === Object.keys(code2).length &&
            Object.keys(code1).every(key =>
              Object.prototype.hasOwnProperty.call(code2, key) &&
              code1[key] === code2[key]
          Severity: Major
          Found in src/dicom/dicomCode.js and 1 other location - About 3 hrs to fix
          src/dicom/dicomSRContent.js on lines 195..201

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

          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

          export function isEqualContentItem(item1, item2) {
            return Object.keys(item1).length === Object.keys(item2).length &&
            Object.keys(item1).every(key =>
              Object.prototype.hasOwnProperty.call(item2, key) &&
              item1[key] === item2[key]
          Severity: Major
          Found in src/dicom/dicomSRContent.js and 1 other location - About 3 hrs to fix
          src/dicom/dicomCode.js on lines 80..86

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

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

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

              if (node.y() < min.getY()) {
                node.y(min.getY());
                changed = true;
              } else if (node.y() > max.getY()) {
                node.y(max.getY());
            Severity: Major
            Found in src/tools/drawBounds.js and 1 other location - About 3 hrs to fix
            src/tools/drawBounds.js on lines 107..113

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

            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 (node.x() < min.getX()) {
                node.x(min.getX());
                changed = true;
              } else if (node.x() > max.getX()) {
                node.x(max.getX());
            Severity: Major
            Found in src/tools/drawBounds.js and 1 other location - About 3 hrs to fix
            src/tools/drawBounds.js on lines 114..120

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

            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

              if (typeof origin === 'string') {
                info['origin'] = {value: origin};
              } else {
                info['fileName'] = {value: origin.name};
                info['fileType'] = {value: origin.type};
            Severity: Major
            Found in src/image/domReader.js and 1 other location - About 3 hrs to fix
            src/image/domReader.js on lines 90..96

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

            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

              if (typeof origin === 'string') {
                info['origin'] = {value: origin};
              } else {
                info['fileName'] = {value: origin.name};
                info['fileType'] = {value: origin.type};
            Severity: Major
            Found in src/image/domReader.js and 1 other location - About 3 hrs to fix
            src/image/domReader.js on lines 143..149

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

            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 getScoordFromShape has 77 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function getScoordFromShape(shape) {
              const scoord = new SpatialCoordinate();
            
              if (shape instanceof Point2D) {
                scoord.graphicData = [
            Severity: Major
            Found in src/dicom/dicomSpatialCoordinate.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 decode has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                dwvdecoder.RleDecoder.prototype.decode = function (buffer,
                  bitsAllocated, isSigned, sliceSize, samplesPerPixel, planarConfiguration) {
                
                  // bytes per element
                  var bpe = bitsAllocated / 8;
                Severity: Major
                Found in decoders/dwv/rle.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
                      Severity
                      Category
                      Status
                      Source
                      Language