Showing 665 of 665 total issues

Function prepareSegmentation has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

  prepareSegmentation() {
    // store frame and do special pre-processing
    this._frameSegment = this._frame;
    let mergedFrames = [];

Severity: Minor
Found in src/models/models.stack.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 updateDOM has 67 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    updateDOM() {
      if (!this._geometry) {
        return;
      }

Severity: Major
Found in src/widgets/widgets.ellipse.js - About 2 hrs to fix

    File widgets.ruler.js has 278 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { widgetsBase } from './widgets.base';
    import { widgetsHandle as widgetsHandleFactory } from './widgets.handle';
    
    /**
     * @module widgets/ruler
    Severity: Minor
    Found in src/widgets/widgets.ruler.js - About 2 hrs to fix

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

          addEventListeners() {
            this._container.addEventListener('dblclick', this.onDoubleClick);
            this._container.addEventListener('wheel', this.onMove);
      
            this._label.addEventListener('mouseenter', this.onHover);
      Severity: Major
      Found in src/widgets/widgets.polygon.js and 1 other location - About 2 hrs to fix
      src/widgets/widgets.polygon.js on lines 74..80

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

      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

          update() {
            if (this._mesh) {
              this.remove(this._mesh);
              this._mesh.geometry.dispose();
              this._mesh.geometry = null;
      Severity: Major
      Found in src/helpers/helpers.localizer.js and 1 other location - About 2 hrs to fix
      src/helpers/helpers.contour.js on lines 65..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 88.

      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

          update() {
            if (this._mesh) {
              this.remove(this._mesh);
              this._mesh.geometry.dispose();
              this._mesh.geometry = null;
      Severity: Major
      Found in src/helpers/helpers.contour.js and 1 other location - About 2 hrs to fix
      src/helpers/helpers.localizer.js on lines 84..93

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

      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

          removeEventListeners() {
            this._container.removeEventListener('dblclick', this.onDoubleClick);
            this._container.removeEventListener('wheel', this.onMove);
      
            this._label.removeEventListener('mouseenter', this.onHover);
      Severity: Major
      Found in src/widgets/widgets.polygon.js and 1 other location - About 2 hrs to fix
      src/widgets/widgets.polygon.js on lines 66..72

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

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

      function decode8(imageFrame, pixelData) {
        const frameData = pixelData;
        const frameSize = imageFrame.rows * imageFrame.columns;
        const outFrame = new ArrayBuffer(frameSize * imageFrame.samplesPerPixel);
        const header = new DataView(frameData.buffer, frameData.byteOffset);
      Severity: Minor
      Found in src/decoders/decoders.rle.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 _decodeUncompressed has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

        _decodeUncompressed(frameIndex = 0) {
          let pixelRepresentation = this.pixelRepresentation(frameIndex);
          let bitsAllocated = this.bitsAllocated(frameIndex);
          let pixelDataElement = this._dataSet.elements.x7fe00010;
          let pixelDataOffset = pixelDataElement.dataOffset;
      Severity: Minor
      Found in src/parsers/parsers.dicom.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 parse has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

        parse: function(data) {
          let littleEndian = this.littleEndian();
          let reader = new DataView(data);
          let offset = 0;
          let surfDesc = undefined;
      Severity: Minor
      Found in src/loaders/loaders.freesurfer.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 _convertColorSpace has 64 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        _convertColorSpace(uncompressedData) {
          let rgbData = null;
          let photometricInterpretation = this.photometricInterpretation();
          let planarConfiguration = this.planarConfiguration();
          if  (planarConfiguration === null) {
      Severity: Major
      Found in src/parsers/parsers.dicom.js - About 2 hrs to fix

        Function updateDOMContent has 64 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            updateDOMContent(clear) {
              const meanSDContainer = this._label.querySelector('.mean-sd');
              const maxMinContainer = this._label.querySelector('.max-min');
              const areaContainer = this._label.querySelector('.area');
        
        
        Severity: Major
        Found in src/widgets/widgets.freehand.js - About 2 hrs to fix

          Function updateDOMContent has 64 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              updateDOMContent(clear) {
                const meanSDContainer = this._label.querySelector('.mean-sd');
                const maxMinContainer = this._label.querySelector('.max-min');
                const areaContainer = this._label.querySelector('.area');
          
          
          Severity: Major
          Found in src/widgets/widgets.polygon.js - About 2 hrs to fix

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

                updateDOMColor() {
                  if (this._handles.length >= 2) {
                    this._lines.forEach(elem => (elem.style.backgroundColor = this._color));
                  }
                  this._label.style.borderColor = this._color;
            Severity: Major
            Found in src/widgets/widgets.freehand.js and 1 other location - About 2 hrs to fix
            src/widgets/widgets.velocityTimeIntegral.js on lines 464..469

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

            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

                updateDOMColor() {
                  if (this._handles.length >= 2) {
                    this._lines.forEach(elem => (elem.style.backgroundColor = this._color));
                  }
                  this._label.style.borderColor = this._color;
            Severity: Major
            Found in src/widgets/widgets.velocityTimeIntegral.js and 1 other location - About 2 hrs to fix
            src/widgets/widgets.freehand.js on lines 402..407

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

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

              main() {
                // need to pre-call main to fill up the functions list
                this._main = `
            void intersectionProjection(
              in vec4 plane,
            Severity: Major
            Found in src/shaders/shaders.localizer.fragment.js - About 2 hrs to fix

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

                  showDOM() {
                    this._handles.forEach(elem => elem.showDOM());
              
                    this._lines.forEach(elem => (elem.style.display = ''));
                    this._label.style.display = '';
              Severity: Major
              Found in src/widgets/widgets.polygon.js and 5 other locations - About 2 hrs to fix
              src/widgets/widgets.freehand.js on lines 260..265
              src/widgets/widgets.freehand.js on lines 267..272
              src/widgets/widgets.polygon.js on lines 294..299
              src/widgets/widgets.velocityTimeIntegral.js on lines 544..549
              src/widgets/widgets.velocityTimeIntegral.js on lines 551..556

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

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

                  showDOM() {
                    this._handles.forEach(elem => elem.showDOM());
              
                    this._lines.forEach(elem => (elem.style.display = ''));
                    this._label.style.display = '';
              Severity: Major
              Found in src/widgets/widgets.velocityTimeIntegral.js and 5 other locations - About 2 hrs to fix
              src/widgets/widgets.freehand.js on lines 260..265
              src/widgets/widgets.freehand.js on lines 267..272
              src/widgets/widgets.polygon.js on lines 294..299
              src/widgets/widgets.polygon.js on lines 301..306
              src/widgets/widgets.velocityTimeIntegral.js on lines 544..549

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

              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

                  addEventListeners() {
                    window.addEventListener('resize', this.onResize);
              
                    this._dom.addEventListener('mouseenter', this.onHover);
                    this._dom.addEventListener('mouseleave', this.onHover);
              Severity: Major
              Found in src/widgets/widgets.handle.js and 1 other location - About 2 hrs to fix
              src/widgets/widgets.handle.js on lines 71..78

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

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

                  update() {
                    this.updateColor();
              
                    this._handles[0].update();
                    this._handles[1].update();
              Severity: Major
              Found in src/widgets/widgets.rectangle.js and 2 other locations - About 2 hrs to fix
              src/widgets/widgets.annotation.js on lines 266..276
              src/widgets/widgets.ellipse.js on lines 244..254

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

              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