ivmartel/dwv

View on GitHub

Showing 386 of 386 total issues

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

  return {
    l: 655.35 * triplet.l,
    a: 257 * triplet.a + 32896,
    b: 257 * triplet.b + 32896,
  };
Severity: Minor
Found in src/utils/colour.js and 1 other location - About 45 mins to fix
src/utils/colour.js on lines 156..160

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

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

Avoid deeply nested control flow statements.
Open

            for (pos = c, j = 0, jj = items.length; j < jj; j++) {
              val = items[j];
              out[pos] = (val + offset);
              pos += componentsCount;
            }
Severity: Major
Found in decoders/pdfjs/jpx.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if ((value >> 4) === 0) {
                            break;
                        }
    Severity: Major
    Found in decoders/rii-mango/lossless.js - About 45 mins to fix

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

        return {
          l: 0.001525902 * triplet.l,
          a: 0.003891051 * triplet.a - 128,
          b: 0.003891051 * triplet.b - 128,
        };
      Severity: Minor
      Found in src/utils/colour.js and 1 other location - About 45 mins to fix
      src/utils/colour.js on lines 175..179

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

      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

      Avoid deeply nested control flow statements.
      Open

                  for (var l=0; l < layerNumber; l++) {
                    if (readBits(1) !== 0) {
                      throw new Error('JPX Error: Invalid tag tree');
                    }
                  }
      Severity: Major
      Found in decoders/pdfjs/jpx.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                    if (sign[position] !== 0) {
                      n = -n;
                    }
        Severity: Major
        Found in decoders/pdfjs/jpx.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                      while (true) {
                        if (readBits(1)) {
                          valueReady = !inclusionTree.nextLevel();
                          if (valueReady) {
                            codeblock.included = true;
          Severity: Major
          Found in decoders/pdfjs/jpx.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                          if (k === null) {
                            continue;
                          }
            Severity: Major
            Found in decoders/pdfjs/jpx.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                            for (; l < layersCount;) {
                              var packet = createPacket(resolution, k, l);
                              l++;
                              return packet;
                            }
              Severity: Major
              Found in decoders/pdfjs/jpx.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                            for (pos = c, j = 0, jj = items.length; j < jj; j++) {
                              val = items[j];
                              out[pos] = val <= min ? 0 :
                                         val >= max ? 255 : (val + offset) >> shift;
                              pos += componentsCount;
                Severity: Major
                Found in decoders/pdfjs/jpx.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                              if(isSigned){
                                shift = 0;
                                offset = 0;
                              }else{
                                shift = components[c].precision - 8;
                  Severity: Major
                  Found in decoders/pdfjs/jpx.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                    for (j = 0; j < 64; j++) {
                                      z = dctZigZag[j];
                                      tableData[z] = data[offset++];
                                    }
                    Severity: Major
                    Found in decoders/pdfjs/jpg.js - About 45 mins to fix

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

                              } else {
                                  this.outputData = new Uint16Array(new ArrayBuffer(this.xDim * this.yDim * this.numBytes * this.numComp));
                              }
                      Severity: Minor
                      Found in decoders/rii-mango/lossless.js and 1 other location - About 45 mins to fix
                      decoders/rii-mango/lossless.js on lines 438..440

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

                      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.numComp === 3) {
                                      this.getter = this.getValueRGB;
                                      this.setter = this.setValueRGB;
                                      this.output = this.outputRGB;
                                  } else {
                      Severity: Minor
                      Found in decoders/rii-mango/lossless.js and 1 other location - About 40 mins to fix
                      decoders/rii-mango/lossless.js on lines 385..399

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

                      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 codOrCoc = (context.currentTile.COC[c] !== undefined  ?
                              context.currentTile.COC[c] : context.currentTile.COD);
                      Severity: Minor
                      Found in decoders/pdfjs/jpx.js and 1 other location - About 40 mins to fix
                      decoders/pdfjs/jpx.js on lines 1492..1493

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

                      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 qcdOrQcc = (context.currentTile.QCC[c] !== undefined ?
                              context.currentTile.QCC[c] : context.currentTile.QCD);
                      Severity: Minor
                      Found in decoders/pdfjs/jpx.js and 1 other location - About 40 mins to fix
                      decoders/pdfjs/jpx.js on lines 1495..1496

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

                      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.numBytes === 1) {
                                  if (this.numComp === 3) {
                                      this.getter = this.getValueRGB;
                                      this.setter = this.setValueRGB;
                                      this.output = this.outputRGB;
                      Severity: Minor
                      Found in decoders/rii-mango/lossless.js and 1 other location - About 40 mins to fix
                      decoders/rii-mango/lossless.js on lines 386..394

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

                      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 generateImageDataMonochrome has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                        array,
                        iterator,
                        alphaFunc,
                        windowLut,
                        colourMap) {
                      Severity: Minor
                      Found in src/image/viewMonochrome.js - About 35 mins to fix

                        Function getPrecinctIndexIfExist has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            pxIndex, pyIndex, sizeInImageScale, precinctIterationSizes, resolution) {
                        Severity: Minor
                        Found in decoders/pdfjs/jpx.js - About 35 mins to fix

                          Function simpleRange3d has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                            dataAccessor, start, end, increment, isPlanar) {
                          Severity: Minor
                          Found in src/image/iterator.js - About 35 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language