Showing 665 of 665 total issues

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

  api(
    baseFragment = this._base,
    packedData = this._packedData,
    offset = this._offset,
    unpackedData = this._unpackedData
Severity: Major
Found in src/shaders/helpers/shaders.helpers.unpack.js and 2 other locations - About 1 hr to fix
src/shaders/helpers/shaders.helpers.texture3d.js on lines 14..22
src/shaders/interpolation/shaders.interpolation.trilinear.js on lines 15..23

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

  api(
    baseFragment = this._base,
    currentVoxel = this._currentVoxel,
    dataValue = this._dataValue,
    gradient = this._gradient
src/shaders/helpers/shaders.helpers.texture3d.js on lines 14..22
src/shaders/helpers/shaders.helpers.unpack.js on lines 32..40

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

  api(
    baseFragment = this._base,
    dataCoordinates = this._dataCoordinates,
    dataValue = this._dataValue,
    offset = this._offset
Severity: Major
Found in src/shaders/helpers/shaders.helpers.texture3d.js and 2 other locations - About 1 hr to fix
src/shaders/helpers/shaders.helpers.unpack.js on lines 32..40
src/shaders/interpolation/shaders.interpolation.trilinear.js on lines 15..23

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

Function constructor has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    constructor(targetMesh, controls, params = {}) {
      super(targetMesh, controls, params);

      this._widgetType = 'VelocityTimeIntegral';

Severity: Minor
Found in src/widgets/widgets.velocityTimeIntegral.js - About 1 hr to fix

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

        createMaterial() {
          this._material = new three.MeshBasicMaterial({ side: THREE.DoubleSide });
          this._material.transparent = true;
          this._material.opacity = 0.2;
        }
    Severity: Major
    Found in src/widgets/widgets.polygon.js and 1 other location - About 1 hr to fix
    src/widgets/widgets.freehand.js on lines 218..222

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

    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

        createMaterial() {
          this._material = new three.MeshBasicMaterial({ side: three.DoubleSide });
          this._material.transparent = true;
          this._material.opacity = 0.2;
        }
    Severity: Major
    Found in src/widgets/widgets.freehand.js and 1 other location - About 1 hr to fix
    src/widgets/widgets.polygon.js on lines 250..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 67.

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

      computeDefinition() {
        let content = `
          step( abs( textureIndexF - 0.0 ), 0.0 ) * texture2D(uTextureContainer[0], uv) +
          step( abs( textureIndexF - 1.0 ), 0.0 ) * texture2D(uTextureContainer[1], uv) +
          step( abs( textureIndexF - 2.0 ), 0.0 ) * texture2D(uTextureContainer[2], uv) +
    Severity: Minor
    Found in src/shaders/helpers/shaders.helpers.texture3d.js - About 1 hr to fix

      Function onMove has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          onMove(evt) {
            let hovered = false;
      
            if (this.active) {
              this._dragged = true;
      Severity: Minor
      Found in src/widgets/widgets.freehand.js - About 1 hr to fix

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

              for (let j = 0; j < this._textures.length; j++) {
                this._textures[j].dispose();
                this._textures[j] = null;
              }
        Severity: Major
        Found in src/helpers/helpers.volumerendering.js and 1 other location - About 1 hr to fix
        src/helpers/helpers.slice.js on lines 515..518

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

        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

              for (let j = 0; j < this._textures.length; j++) {
                this._textures[j].dispose();
                this._textures[j] = null;
              }
        Severity: Major
        Found in src/helpers/helpers.slice.js and 1 other location - About 1 hr to fix
        src/helpers/helpers.volumerendering.js on lines 224..227

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

        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

            getMeasurements() {
              return {
                vMax: this._vMax,
                vMean: this._vMean,
                gMax: this._gMax,
        Severity: Major
        Found in src/widgets/widgets.velocityTimeIntegral.js and 1 other location - About 1 hr to fix
        src/widgets/widgets.pressureHalfTime.js on lines 415..424

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

        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

            getMeasurements() {
              return {
                vMax: this._vMax,
                gMax: this._gMax,
                pht: this._pht,
        Severity: Major
        Found in src/widgets/widgets.pressureHalfTime.js and 1 other location - About 1 hr to fix
        src/widgets/widgets.velocityTimeIntegral.js on lines 602..611

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

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

          imageOrientation(frameIndex = 0) {
            // http://nifti.nimh.nih.gov/pub/dist/src/niftilib/nifti1.h
            // http://nifti.nimh.nih.gov/pub/dist/src/niftilib/nifti1_io.c
            if (this._dataSet.qform_code > 0) {
              // METHOD 2 (used when qform_code > 0, which should be the "normal" case):
        Severity: Minor
        Found in src/parsers/parsers.nifti.js - About 1 hr to fix

          Function constructor has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              constructor(targetMesh: THREE.Mesh, controls: THREE.OrbitControls, params: WidgetParameter) {
                super();
          
                this._widgetType = 'Base';
          
          
          Severity: Minor
          Found in src/widgets/widgets.base.ts - About 1 hr to fix

            Function updateDOM has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                updateDOM() {
                  this.updateDOMColor();
            
                  // update first line
                  const lineData = this.getLineData(
            Severity: Minor
            Found in src/widgets/widgets.angle.js - About 1 hr to fix

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

                  set worldPosition(worldPosition) {
                    this._handles.forEach(elem => elem._worldPosition.copy(worldPosition));
                    this._worldPosition.copy(worldPosition);
                    this.update();
                  }
              Severity: Major
              Found in src/widgets/widgets.velocityTimeIntegral.js and 3 other locations - About 1 hr to fix
              src/widgets/widgets.biruler.js on lines 429..433
              src/widgets/widgets.freehand.js on lines 586..590
              src/widgets/widgets.polygon.js on lines 587..591

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

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

                  set worldPosition(worldPosition) {
                    this._handles.forEach(elem => elem._worldPosition.copy(worldPosition));
                    this._worldPosition.copy(worldPosition);
                    this.update();
                  }
              Severity: Major
              Found in src/widgets/widgets.freehand.js and 3 other locations - About 1 hr to fix
              src/widgets/widgets.biruler.js on lines 429..433
              src/widgets/widgets.polygon.js on lines 587..591
              src/widgets/widgets.velocityTimeIntegral.js on lines 628..632

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

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

                  set worldPosition(worldPosition) {
                    this._handles.forEach(elem => elem.worldPosition.copy(worldPosition));
                    this._worldPosition.copy(worldPosition);
                    this.update();
                  }
              Severity: Major
              Found in src/widgets/widgets.polygon.js and 3 other locations - About 1 hr to fix
              src/widgets/widgets.biruler.js on lines 429..433
              src/widgets/widgets.freehand.js on lines 586..590
              src/widgets/widgets.velocityTimeIntegral.js on lines 628..632

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

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

                  set worldPosition(worldPosition) {
                    this._handles.forEach(elem => elem.worldPosition.copy(worldPosition));
                    this._worldPosition.copy(worldPosition);
                    this.update();
                  }
              Severity: Major
              Found in src/widgets/widgets.biruler.js and 3 other locations - About 1 hr to fix
              src/widgets/widgets.freehand.js on lines 586..590
              src/widgets/widgets.polygon.js on lines 587..591
              src/widgets/widgets.velocityTimeIntegral.js on lines 628..632

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

              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

                    this._handles[2].worldPosition.copy(
                      intersect.clone().add(this._normal.clone().multiplyScalar(this._distances[2]))
                    );
              Severity: Major
              Found in src/widgets/widgets.crossRuler.js and 1 other location - About 1 hr to fix
              src/widgets/widgets.crossRuler.js on lines 478..480

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

              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