ivmartel/dwv

View on GitHub

Showing 386 of 386 total issues

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

  '0038': {
    '0000': ['UL', '1', 'GenericGroupLength'],
    '0004': ['SQ', '1', 'ReferencedPatientAliasSequence'],
    '0008': ['CS', '1', 'VisitStatusID'],
    '0010': ['LO', '1', 'AdmissionID'],
Severity: Major
Found in src/dicom/dictionary.js and 1 other location - About 1 day to fix
src/dicom/dictionary.js on lines 2286..2318

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

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

File dicomElementsWrapper.js has 686 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {
  DicomParser,
  getTransferSyntaxName
} from './dicomParser';
import {
Severity: Major
Found in src/dicom/dicomElementsWrapper.js - About 1 day to fix

    Function BitModelClosure has 299 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      var BitModel = (function BitModelClosure() {
        var UNIFORM_CONTEXT = 17;
        var RUNLENGTH_CONTEXT = 18;
        // Table D-1
        // The index is binary presentation: 0dddvvhh, ddd - sum of Di (0..4),
    Severity: Major
    Found in decoders/pdfjs/jpx.js - About 1 day to fix

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

        '0400': {
          '0000': ['UL', '1', 'GenericGroupLength'],
          '0005': ['US', '1', 'MACIDNumber'],
          '0010': ['UI', '1', 'MACCalculationTransferSyntaxUID'],
          '0015': ['CS', '1', 'MACAlgorithm'],
      Severity: Major
      Found in src/dicom/dictionary.js and 1 other location - About 1 day to fix
      src/dicom/dictionary.js on lines 4992..5022

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

      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

        '4008': {
          '0000': ['UL', '1', 'GenericGroupLength'],
          '0040': ['SH', '1', 'ResultsID'],
          '0042': ['LO', '1', 'ResultsIDIssuer'],
          '0050': ['SQ', '1', 'ReferencedInterpretationSequence'],
      Severity: Major
      Found in src/dicom/dictionary.js and 1 other location - About 1 day to fix
      src/dicom/dictionary.js on lines 3758..3788

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

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

        '5000': {
          '0000': ['UL', '1', 'GenericGroupLength'],
          '0005': ['US', '1', 'CurveDimensions'],
          '0010': ['US', '1', 'NumberOfPoints'],
          '0020': ['CS', '1', 'TypeOfData'],
      Severity: Major
      Found in src/dicom/dictionary.js and 2 other locations - About 1 day to fix
      src/dicom/dictionary.js on lines 2931..2959
      src/dicom/dictionary.js on lines 3826..3854

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

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

        '2010': {
          '0000': ['UL', '1', 'GenericGroupLength'],
          '0010': ['ST', '1', 'ImageDisplayFormat'],
          '0030': ['CS', '1', 'AnnotationDisplayFormatID'],
          '0040': ['CS', '1', 'FilmOrientation'],
      Severity: Major
      Found in src/dicom/dictionary.js and 2 other locations - About 1 day to fix
      src/dicom/dictionary.js on lines 2931..2959
      src/dicom/dictionary.js on lines 5116..5144

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

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

        '0052': {
          '0000': ['UL', '1', 'GenericGroupLength'],
          '0001': ['FL', '1', 'ContrastBolusIngredientPercentByVolume'],
          '0002': ['FD', '1', 'OCTFocalDistance'],
          '0003': ['FD', '1', 'BeamSpotSize'],
      Severity: Major
      Found in src/dicom/dictionary.js and 2 other locations - About 1 day to fix
      src/dicom/dictionary.js on lines 3826..3854
      src/dicom/dictionary.js on lines 5116..5144

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

      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

              while (current !== 0x0FFDA) { // SOS
                  switch (current) {
                      case 0xFFC4: // DHT
                          this.huffTable.read(this.stream, this.HuffTab);
                          break;
      Severity: Major
      Found in decoders/rii-mango/lossless.js and 1 other location - About 1 day to fix
      decoders/rii-mango/lossless.js on lines 274..315

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

      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

          while ((((current >> 4) !== 0x0FFC) || (current === 0xFFC4))) { // SOF 0~15
              switch (current) {
                  case 0xFFC4: // DHT
                      this.huffTable.read(this.stream, this.HuffTab);
                      break;
      Severity: Major
      Found in decoders/rii-mango/lossless.js and 1 other location - About 1 day to fix
      decoders/rii-mango/lossless.js on lines 325..366

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

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

      export function mergeObjects(obj1, obj2, idKey, valueKey) {
        const res = {};
        // check id key
        if (!idKey) {
          throw new Error('Cannot merge object with an undefined id key: ' + idKey);
      Severity: Minor
      Found in src/utils/operator.js - About 1 day 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

        '3002': {
          '0000': ['UL', '1', 'GenericGroupLength'],
          '0002': ['SH', '1', 'RTImageLabel'],
          '0003': ['LO', '1', 'RTImageName'],
          '0004': ['ST', '1', 'RTImageDescription'],
      Severity: Major
      Found in src/dicom/dictionary.js and 1 other location - About 1 day to fix
      src/dicom/dictionary.js on lines 2755..2782

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

      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

        '0044': {
          '0000': ['UL', '1', 'GenericGroupLength'],
          '0001': ['ST', '1', 'ProductPackageIdentifier'],
          '0002': ['CS', '1', 'SubstanceAdministrationApproval'],
          '0003': ['LT', '1', 'ApprovalStatusFurtherDescription'],
      Severity: Major
      Found in src/dicom/dictionary.js and 1 other location - About 1 day to fix
      src/dicom/dictionary.js on lines 3952..3979

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

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

          parseCodestream: function JpxImage_parseCodestream(data, start, end) {
            var context = {};
            try {
              var doNotRecover = false;
              var position = start;
      Severity: Major
      Found in decoders/pdfjs/jpx.js - About 1 day to fix

        Function PromiseClosure has 248 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        (function PromiseClosure() {
          if (globalScope.Promise) {
            // Promises existing in the DOM/Worker, checking presence of all/resolve
            if (typeof globalScope.Promise.all !== 'function') {
              globalScope.Promise.all = function (iterable) {
        Severity: Major
        Found in decoders/pdfjs/util.js - About 1 day to fix

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

            '0012': {
              '0000': ['UL', '1', 'GenericGroupLength'],
              '0010': ['LO', '1', 'ClinicalTrialSponsorName'],
              '0020': ['LO', '1', 'ClinicalTrialProtocolID'],
              '0021': ['LO', '1', 'ClinicalTrialProtocolName'],
          Severity: Major
          Found in src/dicom/dictionary.js and 2 other locations - About 1 day to fix
          src/dicom/dictionary.js on lines 3714..3740
          src/dicom/dictionary.js on lines 3980..4006

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

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

            '3004': {
              '0000': ['UL', '1', 'GenericGroupLength'],
              '0001': ['CS', '1', 'DVHType'],
              '0002': ['CS', '1', 'DoseUnits'],
              '0004': ['CS', '1', 'DoseType'],
          Severity: Major
          Found in src/dicom/dictionary.js and 2 other locations - About 1 day to fix
          src/dicom/dictionary.js on lines 416..442
          src/dicom/dictionary.js on lines 3714..3740

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

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

            '0082': {
              '0000': ['UL', '1', 'GenericGroupLength'],
              '0001': ['CS', '1', 'AssessmentSummary'],
              '0003': ['UT', '1', 'AssessmentSummaryDescription'],
              '0004': ['SQ', '1', 'AssessedSOPInstanceSequence'],
          Severity: Major
          Found in src/dicom/dictionary.js and 2 other locations - About 1 day to fix
          src/dicom/dictionary.js on lines 416..442
          src/dicom/dictionary.js on lines 3980..4006

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

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

            function decodeScan(data, offset, frame, components, resetInterval,
                                spectralStart, spectralEnd, successivePrev, successive) {
              var mcusPerLine = frame.mcusPerLine;
              var progressive = frame.progressive;
          
          
          Severity: Major
          Found in decoders/pdfjs/jpg.js - About 1 day to fix

            Function parse has 237 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                parse: function parse(data) {
            
                  function readUint16() {
                    var value = (data[offset] << 8) | data[offset + 1];
                    offset += 2;
            Severity: Major
            Found in decoders/pdfjs/jpg.js - About 1 day to fix
              Severity
              Category
              Status
              Source
              Language