ivmartel/dwv

View on GitHub

Showing 386 of 386 total issues

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

    function BitModel(width, height, subband, zeroBitPlanes, mb) {
Severity: Minor
Found in decoders/pdfjs/jpx.js - About 35 mins to fix

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

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

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

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

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

          image, index, isRescaled, min, max) {
        Severity: Minor
        Found in src/image/iterator.js - About 35 mins to fix

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

              function decodeMcu(component, decode, mcu, row, col) {
          Severity: Minor
          Found in decoders/pdfjs/jpg.js - About 35 mins to fix

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

                      var blocksPerLine = Math.ceil(Math.ceil(frame.samplesPerLine / 8) *
                                                    component.h / frame.maxH);
            Severity: Minor
            Found in decoders/pdfjs/jpg.js and 1 other location - About 35 mins to fix
            decoders/pdfjs/jpg.js on lines 615..616

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

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

              warn: function (msg) {
                if (this.level <= this.levels.WARN) {
                  console.warn(msg);
                }
              },
            Severity: Major
            Found in src/utils/logger.js and 4 other locations - About 35 mins to fix
            src/utils/logger.js on lines 25..29
            src/utils/logger.js on lines 37..41
            src/utils/logger.js on lines 48..52
            src/utils/logger.js on lines 70..74

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

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

              info: function (msg) {
                if (this.level <= this.levels.INFO) {
                  console.info(msg);
                }
              },
            Severity: Major
            Found in src/utils/logger.js and 4 other locations - About 35 mins to fix
            src/utils/logger.js on lines 25..29
            src/utils/logger.js on lines 37..41
            src/utils/logger.js on lines 59..63
            src/utils/logger.js on lines 70..74

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

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

              debug: function (msg) {
                if (this.level <= this.levels.DEBUG) {
                  console.debug(msg);
                }
              },
            Severity: Major
            Found in src/utils/logger.js and 4 other locations - About 35 mins to fix
            src/utils/logger.js on lines 25..29
            src/utils/logger.js on lines 48..52
            src/utils/logger.js on lines 59..63
            src/utils/logger.js on lines 70..74

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

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

              error: function (msg) {
                if (this.level <= this.levels.ERROR) {
                  console.error(msg);
                }
              }
            Severity: Major
            Found in src/utils/logger.js and 4 other locations - About 35 mins to fix
            src/utils/logger.js on lines 25..29
            src/utils/logger.js on lines 37..41
            src/utils/logger.js on lines 48..52
            src/utils/logger.js on lines 59..63

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

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

              trace: function (msg) {
                if (this.level <= this.levels.TRACE) {
                  console.trace(msg);
                }
              },
            Severity: Major
            Found in src/utils/logger.js and 4 other locations - About 35 mins to fix
            src/utils/logger.js on lines 37..41
            src/utils/logger.js on lines 48..52
            src/utils/logger.js on lines 59..63
            src/utils/logger.js on lines 70..74

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

            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 blocksPerColumn = Math.ceil(Math.ceil(frame.scanLines  / 8) *
                                                      component.v / frame.maxV);
            Severity: Minor
            Found in decoders/pdfjs/jpg.js and 1 other location - About 35 mins to fix
            decoders/pdfjs/jpg.js on lines 613..614

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

            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 arrayContains has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            export function arrayContains(arr0, arr1) {
              // check input
              if (arr0 === null ||
                arr1 === null ||
                typeof arr0 === 'undefined' ||
            Severity: Minor
            Found in src/utils/array.js - About 35 mins 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 getSuvFactor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            export function getSuvFactor(elements) {
              let warning = '';
            
              // CorrectedImage (type2): must contain ATTN and DECY
              const corrImageTagStr = 'Corrected Image (00280051)';
            Severity: Minor
            Found in src/dicom/dicomElementsWrapper.js - About 35 mins 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 getFileExtension has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            export function getFileExtension(filePath) {
              let ext = null;
              if (typeof filePath !== 'undefined' &&
                filePath !== null &&
                filePath[0] !== '.') {
            Severity: Minor
            Found in src/utils/string.js - About 35 mins 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

                if (typeof dirSeq[i]['00041430'] === 'undefined' ||
                  typeof dirSeq[i]['00041430'].value === 'undefined') {
                  continue;
                }
            Severity: Minor
            Found in src/dicom/dicomElementsWrapper.js and 1 other location - About 35 mins to fix
            src/dicom/dicomElementsWrapper.js on lines 923..926

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

            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 content.conceptNameCode !== 'undefined') {
                contentItem.ConceptNameCodeSequence = {
                  value: [getDicomCodeItem(content.conceptNameCode)]
                };
              }
            Severity: Minor
            Found in src/dicom/dicomSRContent.js and 1 other location - About 35 mins to fix
            src/dicom/dicomNumericMeasurement.js on lines 92..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 46.

            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 measurement.numericValueQualifierCode !== 'undefined') {
                item.NumericValueQualifierCodeSequence = {
                  value: [getDicomCodeItem(measurement.numericValueQualifierCode)]
                };
              }
            Severity: Minor
            Found in src/dicom/dicomNumericMeasurement.js and 1 other location - About 35 mins to fix
            src/dicom/dicomSRContent.js on lines 282..286

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

            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 dirSeq[i]['00041500'] === 'undefined' ||
                    typeof dirSeq[i]['00041500'].value === 'undefined') {
                    continue;
                  }
            Severity: Minor
            Found in src/dicom/dicomElementsWrapper.js and 1 other location - About 35 mins to fix
            src/dicom/dicomElementsWrapper.js on lines 908..911

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

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

            jpeg.lossless.Utils = jpeg.lossless.Utils || ((typeof require !== 'undefined') ? require('./utils.js') : null);
            Severity: Major
            Found in decoders/rii-mango/lossless.js and 4 other locations - About 30 mins to fix
            decoders/rii-mango/lossless.js on lines 1027..1027
            decoders/rii-mango/lossless.js on lines 1319..1319
            decoders/rii-mango/lossless.js on lines 1368..1368
            decoders/rii-mango/lossless.js on lines 1589..1589

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

            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