Showing 665 of 665 total issues

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

      if (!this._dragged && this._active && this._initialized) {
        this._selected = !this._selected; // change state if there was no dragging
        this._handles[0].selected = this._selected;
        this._handles[1].selected = this._selected;
      }
Severity: Major
Found in src/widgets/widgets.annotation.js and 1 other location - About 1 hr to fix
src/widgets/widgets.biruler.js on lines 108..112

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

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

const geometriesSlice = (three = window.THREE) => {
  if (three === undefined || three.ShapeBufferGeometry === undefined) {
    return null;
  }

Severity: Minor
Found in src/geometries/geometries.slice.js - About 1 hr to fix

    Function helpersBorder has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    const helpersBorder = (three = window.THREE) => {
      if (three === undefined || three.Object3D === undefined) {
        return null;
      }
    
    
    Severity: Minor
    Found in src/helpers/helpers.border.js - About 1 hr 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 getRoI has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

      static getRoI(mesh, camera, stack) {
        mesh.geometry.computeBoundingBox();
    
        const bbox = new Box3().setFromObject(mesh);
        const min = bbox.min.clone().project(camera);
    Severity: Minor
    Found in src/core/core.utils.js - About 1 hr 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 constructor has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        constructor(targetMesh, controls, params = {}) {
          super(targetMesh, controls, params);
    
          this._widgetType = 'PressureHalfTime';
    
    
    Severity: Minor
    Found in src/widgets/widgets.pressureHalfTime.js - About 1 hr to fix

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

            if (!this._dragged && this._active && this._initialized) {
              this._selected = !this._selected; // change state if there was no dragging
              this._handle.selected = this._selected;
            }
      Severity: Major
      Found in src/widgets/widgets.voxelProbe.js and 1 other location - About 1 hr to fix
      src/widgets/widgets.peakVelocity.js on lines 138..141

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

      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

            if (!this._dragged && this._active && this._initialized) {
              this._selected = !this._selected; // change state if there was no dragging
              this._handle.selected = this._selected;
            }
      Severity: Major
      Found in src/widgets/widgets.peakVelocity.js and 1 other location - About 1 hr to fix
      src/widgets/widgets.voxelProbe.js on lines 101..104

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

      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

          let y = new Vector3(
            parseFloat(this._header.TransformMatrix[3]) * invertX,
            parseFloat(this._header.TransformMatrix[4]) * invertY,
            parseFloat(this._header.TransformMatrix[5])
          );
      Severity: Major
      Found in src/parsers/parsers.mhd.js and 1 other location - About 1 hr to fix
      src/parsers/parsers.mhd.js on lines 130..134

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

      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

          let x = new Vector3(
            parseFloat(this._header.TransformMatrix[0]) * invertX,
            parseFloat(this._header.TransformMatrix[1]) * invertY,
            parseFloat(this._header.TransformMatrix[2])
          );
      Severity: Major
      Found in src/parsers/parsers.mhd.js and 1 other location - About 1 hr to fix
      src/parsers/parsers.mhd.js on lines 137..141

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

      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

          let y = new Vector3(
            this._dataSet.spaceDirections[1][0] * invertX,
            this._dataSet.spaceDirections[1][1] * invertY,
            this._dataSet.spaceDirections[1][2]
          );
      Severity: Major
      Found in src/parsers/parsers.nrrd.js and 1 other location - About 1 hr to fix
      src/parsers/parsers.nrrd.js on lines 206..210

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

      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

          let x = new Vector3(
            this._dataSet.spaceDirections[0][0] * invertX,
            this._dataSet.spaceDirections[0][1] * invertY,
            this._dataSet.spaceDirections[0][2]
          );
      Severity: Major
      Found in src/parsers/parsers.nrrd.js and 1 other location - About 1 hr to fix
      src/parsers/parsers.nrrd.js on lines 213..217

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

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

        static uniforms() {
          return {
            uTextureBackTest0: {
              type: 't',
              value: [],
      Severity: Minor
      Found in src/shaders/shaders.layer.uniform.js - About 1 hr to fix

        Function geometriesVoxel has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const geometriesVoxel = (three = window.THREE) => {
          if (three === undefined || three.BoxGeometry === undefined) {
            return null;
          }
        
        
        Severity: Minor
        Found in src/geometries/geometries.voxel.js - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

              if (
                !(
                  objectToTest !== null &&
                  typeof objectToTest !== 'undefined' &&
                  objectToTest.hasOwnProperty('center') &&
          Severity: Critical
          Found in src/core/core.validators.js - About 1 hr to fix

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

                removeEventListeners() {
                  this._label.removeEventListener('mouseenter', this.onHover);
                  this._label.removeEventListener('mouseleave', this.onHover);
            
                  this._container.removeEventListener('wheel', this.onMove);
            Severity: Major
            Found in src/widgets/widgets.voxelProbe.js and 5 other locations - About 1 hr to fix
            src/widgets/widgets.freehand.js on lines 64..69
            src/widgets/widgets.freehand.js on lines 71..76
            src/widgets/widgets.velocityTimeIntegral.js on lines 76..81
            src/widgets/widgets.velocityTimeIntegral.js on lines 83..88
            src/widgets/widgets.voxelProbe.js on lines 51..56

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

            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

                removeEventListeners() {
                  this._container.removeEventListener('wheel', this.onMove);
            
                  this._label.removeEventListener('mouseenter', this.onHover);
                  this._label.removeEventListener('mouseleave', this.onHover);
            Severity: Major
            Found in src/widgets/widgets.velocityTimeIntegral.js and 5 other locations - About 1 hr to fix
            src/widgets/widgets.freehand.js on lines 64..69
            src/widgets/widgets.freehand.js on lines 71..76
            src/widgets/widgets.velocityTimeIntegral.js on lines 76..81
            src/widgets/widgets.voxelProbe.js on lines 51..56
            src/widgets/widgets.voxelProbe.js on lines 58..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 68.

            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

                addEventListeners() {
                  this._label.addEventListener('mouseenter', this.onHover);
                  this._label.addEventListener('mouseleave', this.onHover);
            
                  this._container.addEventListener('wheel', this.onMove);
            Severity: Major
            Found in src/widgets/widgets.voxelProbe.js and 5 other locations - About 1 hr to fix
            src/widgets/widgets.freehand.js on lines 64..69
            src/widgets/widgets.freehand.js on lines 71..76
            src/widgets/widgets.velocityTimeIntegral.js on lines 76..81
            src/widgets/widgets.velocityTimeIntegral.js on lines 83..88
            src/widgets/widgets.voxelProbe.js on lines 58..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 68.

            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

                removeEventListeners() {
                  this._container.removeEventListener('wheel', this.onMove);
            
                  this._label.removeEventListener('mouseenter', this.onHover);
                  this._label.removeEventListener('mouseleave', this.onHover);
            Severity: Major
            Found in src/widgets/widgets.freehand.js and 5 other locations - About 1 hr to fix
            src/widgets/widgets.freehand.js on lines 64..69
            src/widgets/widgets.velocityTimeIntegral.js on lines 76..81
            src/widgets/widgets.velocityTimeIntegral.js on lines 83..88
            src/widgets/widgets.voxelProbe.js on lines 51..56
            src/widgets/widgets.voxelProbe.js on lines 58..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 68.

            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

                addEventListeners() {
                  this._container.addEventListener('wheel', this.onMove);
            
                  this._label.addEventListener('mouseenter', this.onHover);
                  this._label.addEventListener('mouseleave', this.onHover);
            Severity: Major
            Found in src/widgets/widgets.freehand.js and 5 other locations - About 1 hr to fix
            src/widgets/widgets.freehand.js on lines 71..76
            src/widgets/widgets.velocityTimeIntegral.js on lines 76..81
            src/widgets/widgets.velocityTimeIntegral.js on lines 83..88
            src/widgets/widgets.voxelProbe.js on lines 51..56
            src/widgets/widgets.voxelProbe.js on lines 58..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 68.

            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

                addEventListeners() {
                  this._container.addEventListener('wheel', this.onMove);
            
                  this._label.addEventListener('mouseenter', this.onHover);
                  this._label.addEventListener('mouseleave', this.onHover);
            Severity: Major
            Found in src/widgets/widgets.velocityTimeIntegral.js and 5 other locations - About 1 hr to fix
            src/widgets/widgets.freehand.js on lines 64..69
            src/widgets/widgets.freehand.js on lines 71..76
            src/widgets/widgets.velocityTimeIntegral.js on lines 83..88
            src/widgets/widgets.voxelProbe.js on lines 51..56
            src/widgets/widgets.voxelProbe.js on lines 58..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 68.

            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