ivmartel/dwv

View on GitHub

Showing 386 of 386 total issues

Identical blocks of code found in 4 locations. Consider refactoring.
Open

            if (input === 0xFF) {
                this.marker = this.stream.get8();
                if (this.marker !== 0) {
                    this.markerIndex = 9;
                }
Severity: Major
Found in decoders/rii-mango/lossless.js and 3 other locations - About 1 hr to fix
decoders/rii-mango/lossless.js on lines 680..685
decoders/rii-mango/lossless.js on lines 703..708
decoders/rii-mango/lossless.js on lines 766..771

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

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

  } else if (typeof dataElements[TagKeys.URNCodeValue] !== 'undefined') {
    code.urnValue = dataElements[TagKeys.URNCodeValue].value[0];
  } else {
    throw new Error(
      'Invalid code with no value, no long value and no urn value.');
Severity: Major
Found in src/dicom/dicomCode.js and 1 other location - About 1 hr to fix
src/dicom/dicomCode.js on lines 113..119

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

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 4 locations. Consider refactoring.
Open

        if (input === 0xFF) {
            this.marker = this.stream.get8();
            if (this.marker !== 0) {
                this.markerIndex = 9;
            }
Severity: Major
Found in decoders/rii-mango/lossless.js and 3 other locations - About 1 hr to fix
decoders/rii-mango/lossless.js on lines 680..685
decoders/rii-mango/lossless.js on lines 766..771
decoders/rii-mango/lossless.js on lines 785..790

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

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

export function dcmdump(dicomElements) {
  const keys = Object.keys(dicomElements);
  let result = '\n';
  result += '# Dicom-File-Format\n';
  result += '\n';
Severity: Minor
Found in src/dicom/dicomElementsWrapper.js - About 1 hr to fix

    Function isEqualSegmentFrameInfo has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function isEqualSegmentFrameInfo(dsfi1, dsfi2) {
      // basics
      if (typeof dsfi1 === 'undefined' ||
        typeof dsfi2 === 'undefined' ||
        dsfi1 === null ||
    Severity: Minor
    Found in src/dicom/dicomSegmentFrameInfo.js - About 1 hr to fix

      Function isEqualSegment has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function isEqualSegment(seg1, seg2) {
        // basics
        if (typeof seg1 === 'undefined' ||
          typeof seg2 === 'undefined' ||
          seg1 === null ||
      Severity: Minor
      Found in src/dicom/dicomSegment.js - About 1 hr to fix

        Function rangeRegions has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function rangeRegions(
          dataAccessor, start, end, increment, regions) {
          let nextIndex = start;
          let regionCount = 0;
          let regionElementCount = 0;
        Severity: Minor
        Found in src/image/iterator.js - About 1 hr to fix

          Function buildHuffmanTable has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function buildHuffmanTable(codeLengths, values) {
              var k = 0, code = [], i, j, length = 16;
              while (length > 0 && !codeLengths[length - 1]) {
                length--;
              }
          Severity: Minor
          Found in decoders/pdfjs/jpg.js - About 1 hr to fix

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

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

              Function getData has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  getData: function getData(width, height, forceRGBoutput) {
                    if (this.numComponents > 4) {
                      throw 'Unsupported color mode';
                    }
                    // type of data: Uint8Array(width * height * numComponents)
              Severity: Minor
              Found in decoders/pdfjs/jpg.js - About 1 hr to fix

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

                var StreamType = {
                  UNKNOWN: 0,
                  FLATE: 1,
                  LZW: 2,
                  DCT: 3,
                Severity: Major
                Found in decoders/pdfjs/util.js and 1 other location - About 1 hr to fix
                decoders/pdfjs/util.js on lines 28..39

                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

                  constructor(dimIndex, imagePosPat, derivationImages, refSegmentNumber) {
                    this.dimIndex = dimIndex;
                    this.imagePosPat = imagePosPat;
                    this.derivationImages = derivationImages;
                    this.refSegmentNumber = refSegmentNumber;
                Severity: Major
                Found in src/dicom/dicomSegmentFrameInfo.js and 1 other location - About 1 hr to fix
                src/math/stats.js on lines 55..60

                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

                  constructor(min, max, mean, stdDev) {
                    this.min = min;
                    this.max = max;
                    this.mean = mean;
                    this.stdDev = stdDev;
                Severity: Major
                Found in src/math/stats.js and 1 other location - About 1 hr to fix
                src/dicom/dicomSegmentFrameInfo.js on lines 86..91

                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

                var TextRenderingMode = {
                  FILL: 0,
                  STROKE: 1,
                  FILL_STROKE: 2,
                  INVISIBLE: 3,
                Severity: Major
                Found in decoders/pdfjs/util.js and 1 other location - About 1 hr to fix
                decoders/pdfjs/util.js on lines 53..64

                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 (appData[0] === 0x41 && appData[1] === 0x64 &&
                                  appData[2] === 0x6F && appData[3] === 0x62 &&
                                  appData[4] === 0x65) { // 'Adobe'
                                adobe = {
                                  version: (appData[5] << 8) | appData[6],
                Severity: Major
                Found in decoders/pdfjs/jpg.js and 1 other location - About 1 hr to fix
                decoders/pdfjs/jpg.js on lines 665..678

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

                              if (appData[0] === 0x4A && appData[1] === 0x46 &&
                                  appData[2] === 0x49 && appData[3] === 0x46 &&
                                  appData[4] === 0) { // 'JFIF\x00'
                                jfif = {
                                  version: { major: appData[5], minor: appData[6] },
                Severity: Major
                Found in decoders/pdfjs/jpg.js and 1 other location - About 1 hr to fix
                decoders/pdfjs/jpg.js on lines 682..691

                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

                Function range3d has 9 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                export function range3d(dataAccessor, start, maxIter, increment,
                  blockMaxIter, blockIncrement, reverse1, reverse2, isPlanar) {
                Severity: Major
                Found in src/image/iterator.js - About 1 hr to fix

                  Function decodeScan has 9 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                    function decodeScan(data, offset, frame, components, resetInterval,
                                        spectralStart, spectralEnd, successivePrev, successive) {
                  Severity: Major
                  Found in decoders/pdfjs/jpg.js - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language