Showing 665 of 665 total issues

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

    set active(active) {
      this._active = active;
      this._controls.enabled = !this._active;

      this.update();
Severity: Minor
Found in src/widgets/widgets.voxelProbe.js and 1 other location - About 50 mins to fix
src/widgets/widgets.peakVelocity.js on lines 290..295

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

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._geometry.vertices[2].copy(
          new three.Vector3().subVectors(this._handles[1].worldPosition, progection)
        );
Severity: Minor
Found in src/widgets/widgets.rectangle.js and 1 other location - About 50 mins to fix
src/widgets/widgets.rectangle.js on lines 267..269

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

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._geometry.vertices[1].copy(
          new three.Vector3().addVectors(this._handles[0].worldPosition, progection)
        );
Severity: Minor
Found in src/widgets/widgets.rectangle.js and 1 other location - About 50 mins to fix
src/widgets/widgets.rectangle.js on lines 270..272

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

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

Avoid deeply nested control flow statements.
Open

        for (let j = 0; j < -n + 1 && outIndex < endOfSegment; ++j) {
          out[outIndex] = value;
          outIndex++;
        }
Severity: Major
Found in src/decoders/decoders.rle.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

            if (!Number.isNaN(raw)) {
              data[4 * packIndex] = raw & 0x000000ff;
              data[4 * packIndex + 1] = (raw >>> 8) & 0x000000ff;
              data[4 * packIndex + 2] = (raw >>> 16) & 0x000000ff;
              data[4 * packIndex + 3] = (raw >>> 24) & 0x000000ff;
    Severity: Major
    Found in src/models/models.stack.js - About 45 mins to fix

      Function imageOrientation has a Cognitive Complexity of 8 (exceeds 5 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 45 mins 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

      Avoid deeply nested control flow statements.
      Open

              for (let j = 0; j < -n + 1 && outIndex < endOfSegment; ++j) {
                out[outIndex] = value;
                outIndex += imageFrame.samplesPerPixel;
              }
      Severity: Major
      Found in src/decoders/decoders.rle.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

              for (let i = startVoxel; i < stopVoxel; i++) {
                frameIndex = ~~(i / frameDimension);
                inFrameIndex = i % frameDimension;
        
                let raw = frame[frameIndex].pixelData[inFrameIndex] + offset;
        Severity: Major
        Found in src/models/models.stack.js - About 45 mins to fix

          Function helpersBoundingBox has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          const helpersBoundingBox = (three = window.THREE) => {
            if (three === undefined || three.Object3D === undefined) {
              return null;
            }
          
          
          Severity: Minor
          Found in src/helpers/helpers.boundingbox.js - About 45 mins 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

          Avoid deeply nested control flow statements.
          Open

                        if (superiorDirection.z > 0) {
                          superiorDirection.negate();
                        }
          Severity: Major
          Found in src/cameras/cameras.orthographic.js - About 45 mins to fix

            Function _decompressUncompressed has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

              _decompressUncompressed(frameIndex = 0) {
                let buffer = this._buffer;
                let numberOfChannels = this.numberOfChannels();
                let numPixels = this.rows(frameIndex) * this.columns(frameIndex) * numberOfChannels;
                if (!this.rightHanded()) {
            Severity: Minor
            Found in src/parsers/parsers.mhd.js - About 45 mins 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

            Avoid deeply nested control flow statements.
            Open

                          if (superiorDirection.z < 0) {
                            superiorDirection.negate();
                          }
            Severity: Major
            Found in src/cameras/cameras.orthographic.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                            if (posteriorDirection.y > 0) {
                              posteriorDirection.negate();
                            }
              Severity: Major
              Found in src/cameras/cameras.orthographic.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                    } else if (bitsAllocated === 8 && channels === 3) {
                      let data = new Uint8Array(textureSize * textureSize * 3);
                
                      for (let i = startVoxel; i < stopVoxel; i++) {
                        frameIndex = ~~(i / frameDimension);
                Severity: Major
                Found in src/models/models.stack.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                if (superiorDirection.z < 0) {
                                  superiorDirection.negate();
                                }
                  Severity: Major
                  Found in src/cameras/cameras.orthographic.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                  if (posteriorDirection.y > 0) {
                                    posteriorDirection.negate();
                                  }
                    Severity: Major
                    Found in src/cameras/cameras.orthographic.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                    if (leftDirection.x > 0) {
                                      leftDirection.negate();
                                    }
                      Severity: Major
                      Found in src/cameras/cameras.orthographic.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                for (let j = 0; j < -n + 1 && outIndex < frameSize; ++j) {
                                  out[outIndex * 2 + highByte] = value;
                                  outIndex++;
                                }
                        Severity: Major
                        Found in src/decoders/decoders.rle.js - About 45 mins to fix

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

                              return this.fetch(url, requests)
                                .then(rawdata => {
                                  return this.parse(rawdata);
                                })
                                .then(data => {
                          Severity: Minor
                          Found in src/loaders/loaders.base.js and 1 other location - About 45 mins to fix
                          src/loaders/loaders.base.js on lines 206..220

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

                          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

                                  if (this._plane3) {
                                    this._uniforms.uPlane3.value = this._plane3;
                                    this._uniforms.uPlaneColor3.value = this._color3;
                                  }
                          Severity: Major
                          Found in src/helpers/helpers.localizer.js and 2 other locations - About 45 mins to fix
                          src/helpers/helpers.localizer.js on lines 52..55
                          src/helpers/helpers.localizer.js on lines 57..60

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

                          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