Showing 665 of 665 total issues

Similar blocks of code found in 2 locations. 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 and 1 other location - About 5 days to fix
src/widgets/widgets.freehand.js on lines 409..484

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

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

    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 and 1 other location - About 5 days to fix
src/widgets/widgets.polygon.js on lines 413..488

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

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

    updateMesh() {
      if (this._mesh) {
        this.remove(this._mesh);
      }

Severity: Major
Found in src/widgets/widgets.polygon.js and 1 other location - About 5 days to fix
src/widgets/widgets.freehand.js on lines 289..358

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

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

    updateMesh() {
      if (this._mesh) {
        this.remove(this._mesh);
      }

Severity: Major
Found in src/widgets/widgets.freehand.js and 1 other location - About 5 days to fix
src/widgets/widgets.polygon.js on lines 323..394

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 845.

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

const helpersLut = (three = window.THREE) => {
  if (three === undefined || three.Object3D === undefined) {
    return null;
  }
  const Constructor = three.Object3D;
Severity: Major
Found in src/helpers/helpers.lut.js - About 3 days to fix

    File presets.segmentation.freesurfer.js has 1383 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    const segmentationFs = {
      0: { color: [0, 0, 0], opacity: 0, label: 'Unknown' },
      1: { color: [70, 130, 180], opacity: 1, label: 'Left-Cerebral-Exterior' },
      2: { color: [245, 245, 245], opacity: 1, label: 'Left-Cerebral-White-Matter' },
      3: { color: [205, 62, 78], opacity: 1, label: 'Left-Cerebral-Cortex' },
    Severity: Major
    Found in src/presets/presets.segmentation.freesurfer.js - About 3 days to fix

      Function camerasOrthographic has a Cognitive Complexity of 159 (exceeds 5 allowed). Consider refactoring.
      Open

      const camerasOrthographic = (three = window.THREE) => {
        if (three === undefined || three.OrthographicCamera === undefined) {
          return null;
        }
      
      
      Severity: Minor
      Found in src/cameras/cameras.orthographic.js - About 3 days 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

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

          free() {
            this.removeEventListeners();
      
            this._handles.forEach(h => {
              this.remove(h);
      Severity: Major
      Found in src/widgets/widgets.polygon.js and 1 other location - About 2 days to fix
      src/widgets/widgets.freehand.js on lines 519..562

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

      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

          free() {
            this.removeEventListeners();
      
            this._handles.forEach(h => {
              this.remove(h);
      Severity: Major
      Found in src/widgets/widgets.freehand.js and 1 other location - About 2 days to fix
      src/widgets/widgets.polygon.js on lines 520..563

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

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

      const camerasOrthographic = (three = window.THREE) => {
        if (three === undefined || three.OrthographicCamera === undefined) {
          return null;
        }
      
      
      Severity: Major
      Found in src/cameras/cameras.orthographic.js - About 2 days to fix

        Function widgetsVelocityTimeIntegral has 497 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const widgetsVelocityTimeIntegral = (three = window.THREE) => {
          if (three === undefined || three.Object3D === undefined) {
            return null;
          }
        
        
        Severity: Major
        Found in src/widgets/widgets.velocityTimeIntegral.js - About 2 days to fix

          Function widgetsCrossRuler has 477 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const widgetsCrossRuler = (three = window.THREE) => {
            if (three === undefined || three.Object3D === undefined) {
              return null;
            }
          
          
          Severity: Major
          Found in src/widgets/widgets.crossRuler.js - About 2 days to fix

            Function widgetsPolygon has 446 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const widgetsPolygon = (three = window.THREE) => {
              if (three === undefined || three.Object3D === undefined) {
                return null;
              }
            
            
            Severity: Major
            Found in src/widgets/widgets.polygon.js - About 2 days to fix

              Function widgetsFreehand has 445 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const widgetsFreehand = (three = window.THREE) => {
                if (three === undefined || three.Object3D === undefined) {
                  return null;
                }
              
              
              Severity: Major
              Found in src/widgets/widgets.freehand.js - About 2 days to fix

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

                    onEnd() {
                      this._handles[0].onEnd(); // First Handle
                
                      if (
                        this._handles[1].tracking &&
                Severity: Major
                Found in src/widgets/widgets.ellipse.js and 1 other location - About 2 days to fix
                src/widgets/widgets.rectangle.js on lines 145..175

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

                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

                    onEnd() {
                      this._handles[0].onEnd(); // First Handle
                
                      if (
                        this._handles[1].tracking &&
                Severity: Major
                Found in src/widgets/widgets.rectangle.js and 1 other location - About 2 days to fix
                src/widgets/widgets.ellipse.js on lines 150..180

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

                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 parsers.dicom.js has 865 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /** * Imports ***/
                import UtilsCore from '../core/core.utils';
                import ParsersVolume from './parsers.volume';
                
                import * as OpenJPEG from 'OpenJPEG.js/dist/openJPEG-DynamicMemory-browser.js';
                Severity: Major
                Found in src/parsers/parsers.dicom.js - About 2 days to fix

                  Function helpersSlice has 417 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const helpersSlice = (three = window.THREE) => {
                    if (three === undefined || three.Object3D === undefined) {
                      return null;
                    }
                  
                  
                  Severity: Major
                  Found in src/helpers/helpers.slice.js - About 2 days to fix

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

                        updateDOMPosition() {
                          if (this._handles.length < 2) {
                            return;
                          }
                          // update lines and get coordinates of lowest handle
                    Severity: Major
                    Found in src/widgets/widgets.freehand.js and 1 other location - About 2 days to fix
                    src/widgets/widgets.velocityTimeIntegral.js on lines 511..542

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

                    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

                        updateDOMPosition() {
                          if (this._handles.length < 2) {
                            return;
                          }
                          // update lines and get coordinates of lowest handle
                    Severity: Major
                    Found in src/widgets/widgets.velocityTimeIntegral.js and 1 other location - About 2 days to fix
                    src/widgets/widgets.freehand.js on lines 486..517

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

                    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