ivmartel/dwv

View on GitHub

Showing 386 of 386 total issues

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

jpeg.lossless.Decoder.TABLE = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53,
    10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63];
Severity: Major
Found in decoders/rii-mango/lossless.js and 1 other location - About 2 hrs to fix
decoders/rii-mango/lossless.js on lines 224..225

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

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.IDCT_P = [0, 5, 40, 16, 45, 2, 7, 42, 21, 56, 8, 61, 18, 47, 1, 4, 41, 23, 58, 13, 32, 24, 37, 10, 63, 17, 44, 3, 6, 43, 20,
    57, 15, 34, 29, 48, 53, 26, 39, 9, 60, 19, 46, 22, 59, 12, 33, 31, 50, 55, 25, 36, 11, 62, 14, 35, 28, 49, 52, 27, 38, 30, 51, 54];
Severity: Major
Found in decoders/rii-mango/lossless.js and 1 other location - About 2 hrs to fix
decoders/rii-mango/lossless.js on lines 226..227

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

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

export function getDicomSRContentItem(content) {
  // dicom item (tags are in ~group/element order)
  let contentItem = {};

  if (typeof content.relationshipType !== 'undefined') {
Severity: Major
Found in src/dicom/dicomSRContent.js - About 2 hrs to fix

    Function getPrecinctSizesInImageScale has 57 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function getPrecinctSizesInImageScale(tile) {
        var componentsCount = tile.components.length;
        var minWidth = Number.MAX_VALUE;
        var minHeight = Number.MAX_VALUE;
        var maxNumWide = 0;
    Severity: Major
    Found in decoders/pdfjs/jpx.js - About 2 hrs to fix

      Function getSRContent has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

      export function getSRContent(dataElements) {
        // valueType -> ValueType (type1)
        let valueType = '';
        if (typeof dataElements[TagKeys.ValueType] !== 'undefined') {
          valueType = dataElements[TagKeys.ValueType].value[0];
      Severity: Minor
      Found in src/dicom/dicomSRContent.js - About 2 hrs 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 MessageHandler has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

      function MessageHandler(name, comObj) {
        this.name = name;
        this.comObj = comObj;
        this.callbackIndex = 1;
        this.postMessageTransfers = true;
      Severity: Minor
      Found in decoders/pdfjs/util.js - About 2 hrs 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 getDicomSRContentItem has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

      export function getDicomSRContentItem(content) {
        // dicom item (tags are in ~group/element order)
        let contentItem = {};
      
        if (typeof content.relationshipType !== 'undefined') {
      Severity: Minor
      Found in src/dicom/dicomSRContent.js - About 2 hrs 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 StatTimerClosure has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

      var StatTimer = (function StatTimerClosure() {
        function rpad(str, pad, length) {
          while (str.length < length) {
            str += pad;
          }
      Severity: Minor
      Found in decoders/pdfjs/util.js - About 2 hrs 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

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

      var XRefParseException = (function XRefParseExceptionClosure() {
        function XRefParseException(msg) {
          this.message = msg;
        }
      
      
      Severity: Major
      Found in decoders/pdfjs/util.js and 1 other location - About 2 hrs to fix
      decoders/pdfjs/util.js on lines 404..414

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

      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 NotImplementedException = (function NotImplementedExceptionClosure() {
        function NotImplementedException(msg) {
          this.message = msg;
        }
      
      
      Severity: Major
      Found in decoders/pdfjs/util.js and 1 other location - About 2 hrs to fix
      decoders/pdfjs/util.js on lines 430..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 80.

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

      export function range3d(dataAccessor, start, maxIter, increment,
        blockMaxIter, blockIncrement, reverse1, reverse2, isPlanar) {
        const iters = [];
        if (isPlanar) {
          iters.push(range(
      Severity: Major
      Found in src/image/iterator.js - About 2 hrs to fix

        Function MessageHandler has 55 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function MessageHandler(name, comObj) {
          this.name = name;
          this.comObj = comObj;
          this.callbackIndex = 1;
          this.postMessageTransfers = true;
        Severity: Major
        Found in decoders/pdfjs/util.js - About 2 hrs to fix

          Function StatTimerClosure has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var StatTimer = (function StatTimerClosure() {
            function rpad(str, pad, length) {
              while (str.length < length) {
                str += pad;
              }
          Severity: Major
          Found in decoders/pdfjs/util.js - About 2 hrs to fix

            Function TagTreeClosure has 55 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              var TagTree = (function TagTreeClosure() {
                function TagTree(width, height) {
                  var levelsLength = log2(Math.max(width, height)) + 1;
                  this.levels = [];
                  for (var i = 0; i < levelsLength; i++) {
            Severity: Major
            Found in decoders/pdfjs/jpx.js - About 2 hrs to fix

              File dicomCode.js has 258 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              // doc imports
              /* eslint-disable no-unused-vars */
              import {DataElement} from './dataElement';
              /* eslint-enable no-unused-vars */
              
              
              Severity: Minor
              Found in src/dicom/dicomCode.js - About 2 hrs to fix

                Function getDicomSegmentFrameInfoItem has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function getDicomSegmentFrameInfoItem(frameInfo) {
                  const item = {
                    FrameContentSequence: {
                      value: [
                        {
                Severity: Major
                Found in src/dicom/dicomSegmentFrameInfo.js - About 2 hrs to fix

                  Function ResolutionPositionComponentLayerIterator has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function ResolutionPositionComponentLayerIterator(context) {
                      var siz = context.SIZ;
                      var tileIndex = context.currentTile.index;
                      var tile = context.tiles[tileIndex];
                      var layersCount = tile.codingStyleDefaultParameters.layersCount;
                  Severity: Major
                  Found in decoders/pdfjs/jpx.js - About 2 hrs to fix

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

                                  switch (sqcd & 0x1F) {
                                    case 0:
                                      spqcdSize = 8;
                                      scalarExpounded = true;
                                      break;
                    Severity: Major
                    Found in decoders/pdfjs/jpx.js and 1 other location - About 2 hrs to fix
                    decoders/pdfjs/jpx.js on lines 247..262

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

                    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

                        for (let i = 0; i < shape.getLength(); ++i) {
                          scoord.graphicData.push(shape.getPoint(i).getX().toString());
                          scoord.graphicData.push(shape.getPoint(i).getY().toString());
                        }
                    Severity: Major
                    Found in src/dicom/dicomSpatialCoordinate.js and 1 other location - About 2 hrs to fix
                    src/dicom/dicomSpatialCoordinate.js on lines 150..153

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

                    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

                    const TagKeys = {
                      ReferencedSOPSequence: '00081199',
                      RelationshipType: '0040A010',
                      ValueType: '0040A040',
                      ConceptNameCodeSequence: '0040A043',
                    Severity: Major
                    Found in src/dicom/dicomSRContent.js and 1 other location - About 2 hrs to fix
                    src/dicom/dicomSegmentFrameInfo.js on lines 19..33

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

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language