Showing 665 of 665 total issues

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

    onStart(evt) {
      this._moveHandle.onMove(evt, true);

      this._handles[0].onStart(evt);
      this._handles[1].onStart(evt);
Severity: Major
Found in src/widgets/widgets.rectangle.js and 2 other locations - About 7 hrs to fix
src/widgets/widgets.ellipse.js on lines 110..124
src/widgets/widgets.ruler.js on lines 100..114

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    onStart(evt) {
      this._moveHandle.onMove(evt, true);

      this._handles[0].onStart(evt);
      this._handles[1].onStart(evt);
Severity: Major
Found in src/widgets/widgets.ellipse.js and 2 other locations - About 7 hrs to fix
src/widgets/widgets.rectangle.js on lines 105..119
src/widgets/widgets.ruler.js on lines 100..114

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    onStart(evt) {
      this._moveHandle.onMove(evt, true);

      this._handles[0].onStart(evt);
      this._handles[1].onStart(evt);
Severity: Major
Found in src/widgets/widgets.ruler.js and 2 other locations - About 7 hrs to fix
src/widgets/widgets.ellipse.js on lines 110..124
src/widgets/widgets.rectangle.js on lines 105..119

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

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

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

Severity: Major
Found in src/helpers/helpers.localizer.js - About 6 hrs to fix

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

    import { widgetsBase } from './widgets.base';
    import { widgetsHandle as widgetsHandleFactory } from './widgets.handle';
    import CoreUtils from '../core/core.utils';
    
    /**
    Severity: Minor
    Found in src/widgets/widgets.polygon.js - About 6 hrs to fix

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

      import { widgetsBase } from './widgets.base';
      import { widgetsHandle as widgetsHandleFactory } from './widgets.handle';
      import CoreUtils from '../core/core.utils';
      
      /**
      Severity: Minor
      Found in src/widgets/widgets.freehand.js - About 6 hrs to fix

        Function uniforms has 171 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          static uniforms() {
            return {
              uTextureSize: {
                type: 'i',
                value: 0,
        Severity: Major
        Found in src/shaders/shaders.vr.uniform.js - About 6 hrs to fix

          Function main has 170 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            main() {
              // need to pre-call main to fill up the functions list
              this._main = `
          void getIntensity(in vec3 dataCoordinates, out float intensity, out vec3 gradient){
          
          
          Severity: Major
          Found in src/shaders/shaders.vr.fragment.js - About 6 hrs to fix

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

              _readChar(len = 1) {
                let tempBuff = new DataView(this._buffer.slice(this._bufferPos, this._bufferPos + len));
                this._bufferPos += len;
                let v = undefined;
                if (len == 1) {
            Severity: Major
            Found in src/parsers/parsers.mgh.js and 1 other location - About 6 hrs to fix
            src/parsers/parsers.mgh.js on lines 317..330

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

            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

              _readUChar(len = 1) {
                let tempBuff = new DataView(this._buffer.slice(this._bufferPos, this._bufferPos + len));
                this._bufferPos += len;
                let v = undefined;
                if (len == 1) {
            Severity: Major
            Found in src/parsers/parsers.mgh.js and 1 other location - About 6 hrs to fix
            src/parsers/parsers.mgh.js on lines 301..314

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

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

            const widgetsAngle = (three = window.THREE) => {
              if (three === undefined || three.Object3D === undefined) {
                return null;
              }
            
            
            Severity: Minor
            Found in src/widgets/widgets.angle.js - About 6 hrs to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

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

                function onloaded(event) {
                  if (event.target.status === 200 || event.target.status === 0) {
                    let geometry = scope.parse(event.target.response || event.target.responseText);
                    scope.dispatchEvent({
                      type: 'load',
            Severity: Major
            Found in src/loaders/loaders.freesurfer.js and 1 other location - About 6 hrs to fix
            src/loaders/loaders.trk.js on lines 14..31

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

            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

                function onloaded(event) {
                  if (event.target.status === 200 || event.target.status === 0) {
                    let geometry = scope.parse(event.target.response || event.target.responseText);
                    scope.dispatchEvent({
                      type: 'load',
            Severity: Major
            Found in src/loaders/loaders.trk.js and 1 other location - About 6 hrs to fix
            src/loaders/loaders.freesurfer.js on lines 11..28

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

            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

                } else if (this._dataSet.type === 'int16' || this._dataSet.type === 'short') {
                  frameOffset = frameOffset * 2;
                  return new Int16Array(buffer, frameOffset, numPixels);
                } else if (this._dataSet.type === 'uint16') {
                  frameOffset = frameOffset * 2;
            Severity: Major
            Found in src/parsers/parsers.nrrd.js and 1 other location - About 6 hrs to fix
            src/parsers/parsers.mhd.js on lines 172..187

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

            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

                } else if (this._header.ElementType === 'MET_SHORT') {
                  frameOffset = frameOffset * 2;
                  return new Int16Array(buffer, frameOffset, numPixels);
                } else if (this._header.ElementType === 'MET_USHORT') {
                  frameOffset = frameOffset * 2;
            Severity: Major
            Found in src/parsers/parsers.mhd.js and 1 other location - About 6 hrs to fix
            src/parsers/parsers.nrrd.js on lines 278..293

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

            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 helpers.slice.js has 426 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /** * Imports ***/
            import { geometriesSlice } from '../geometries/geometries.slice';
            import ShadersUniform from '../shaders/shaders.data.uniform';
            import ShadersVertex from '../shaders/shaders.data.vertex';
            import ShadersFragment from '../shaders/shaders.data.fragment';
            Severity: Minor
            Found in src/helpers/helpers.slice.js - About 6 hrs to fix

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

                    if (this._active) {
                      const prevPosition = this._moveHandle.worldPosition.clone();
              
                      this._dragged = true;
                      this._moveHandle.onMove(evt, true);
              Severity: Major
              Found in src/widgets/widgets.ruler.js and 2 other locations - About 6 hrs to fix
              src/widgets/widgets.angle.js on lines 132..145
              src/widgets/widgets.crossRuler.js on lines 134..147

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

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

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

                    if (this._active) {
                      const prevPosition = this._moveHandle.worldPosition.clone();
              
                      this._dragged = true;
                      this._moveHandle.onMove(evt, true);
              Severity: Major
              Found in src/widgets/widgets.crossRuler.js and 2 other locations - About 6 hrs to fix
              src/widgets/widgets.angle.js on lines 132..145
              src/widgets/widgets.ruler.js on lines 117..130

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

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

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

                    if (this._active) {
                      const prevPosition = this._moveHandle.worldPosition.clone();
              
                      this._dragged = true;
                      this._moveHandle.onMove(evt, true);
              Severity: Major
              Found in src/widgets/widgets.angle.js and 2 other locations - About 6 hrs to fix
              src/widgets/widgets.crossRuler.js on lines 134..147
              src/widgets/widgets.ruler.js on lines 117..130

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

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

              const widgetsAnnotation = (three = window.THREE) => {
                if (three === undefined || three.Object3D === undefined) {
                  return null;
                }
              
              
              Severity: Minor
              Found in src/widgets/widgets.annotation.js - About 5 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Severity
              Category
              Status
              Source
              Language