Showing 665 of 665 total issues

Function helpersSlice has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
Open

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

Severity: Minor
Found in src/helpers/helpers.slice.js - About 1 day 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 widgetsPressureHalfTime has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
Open

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

Severity: Minor
Found in src/widgets/widgets.pressureHalfTime.js - About 1 day 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 widgetsHandle has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
Open

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

Severity: Minor
Found in src/widgets/widgets.handle.js - About 1 day 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 widgetsPeakVelocity has 213 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

Severity: Major
Found in src/widgets/widgets.peakVelocity.js - About 1 day to fix

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

            if (!this._initialized) {
              this._handles[this._handles.length - 1].hovered = false;
              this._handles[this._handles.length - 1].active = false;
              this._handles[this._handles.length - 1].tracking = false;
    
    
    Severity: Major
    Found in src/widgets/widgets.freehand.js and 1 other location - About 1 day to fix
    src/widgets/widgets.velocityTimeIntegral.js on lines 146..177

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

    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._initialized) {
              this._handles[this._handles.length - 1].hovered = false;
              this._handles[this._handles.length - 1].active = false;
              this._handles[this._handles.length - 1].tracking = false;
    
    
    Severity: Major
    Found in src/widgets/widgets.velocityTimeIntegral.js and 1 other location - About 1 day to fix
    src/widgets/widgets.freehand.js on lines 126..154

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

    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 cameras.orthographic.js has 513 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import Intersections from '../core/core.intersections';
    import Validators from '../core/core.validators';
    
    /**
     * Orthographic camera from THREE.JS with some extra convenience
    Severity: Major
    Found in src/cameras/cameras.orthographic.js - About 1 day to fix

      File widgets.velocityTimeIntegral.js has 504 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: Major
      Found in src/widgets/widgets.velocityTimeIntegral.js - About 1 day to fix

        Function widgetsRectangle has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
        Open

        const widgetsRectangle = (three = window.THREE) => {
          if (three === undefined || three.Object3D === undefined) {
            return null;
          }
        
        
        Severity: Minor
        Found in src/widgets/widgets.rectangle.js - About 1 day 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 parse has 202 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          parse: function(data) {
            let littleEndian = this.littleEndian();
            let reader = new DataView(data);
        
            // String.fromCharCode
        Severity: Major
        Found in src/loaders/loaders.trk.js - About 1 day to fix

          Function helpersVolumeRendering has 196 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const helpersVolumeRendering = (three = window.THREE) => {
            if (three === undefined || three.Object3D === undefined) {
              return null;
            }
          
          
          Severity: Major
          Found in src/helpers/helpers.volumerendering.js - About 7 hrs to fix

            Function widgetsVoxelprobe has 196 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const widgetsVoxelprobe = (three = window.THREE) => {
              if (three === undefined || three.Object3D === undefined) {
                return null;
              }
            
            
            Severity: Major
            Found in src/widgets/widgets.voxelProbe.js - About 7 hrs to fix

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

                  createMesh() {
                    // geometry
                    this._geometry = new three.Geometry();
                    this._geometry.vertices = [
                      this._handles[0].worldPosition,
              Severity: Major
              Found in src/widgets/widgets.biruler.js and 2 other locations - About 7 hrs to fix
              src/widgets/widgets.angle.js on lines 203..222
              src/widgets/widgets.crossRuler.js on lines 208..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 190.

              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

                  createMesh() {
                    // geometry
                    this._geometry = new three.Geometry();
                    this._geometry.vertices = [
                      this._handles[0].worldPosition,
              Severity: Major
              Found in src/widgets/widgets.angle.js and 2 other locations - About 7 hrs to fix
              src/widgets/widgets.biruler.js on lines 148..167
              src/widgets/widgets.crossRuler.js on lines 208..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 190.

              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

                  createMesh() {
                    // geometry
                    this._geometry = new three.Geometry();
                    this._geometry.vertices = [
                      this._handles[0].worldPosition,
              Severity: Major
              Found in src/widgets/widgets.crossRuler.js and 2 other locations - About 7 hrs to fix
              src/widgets/widgets.angle.js on lines 203..222
              src/widgets/widgets.biruler.js on lines 148..167

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

              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 widgets.crossRuler.js has 483 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import { widgetsBase } from './widgets.base';
              import { widgetsHandle as widgetsHandleFactory } from './widgets.handle';
              
              /**
               * @module widgets/crossRuler
              Severity: Minor
              Found in src/widgets/widgets.crossRuler.js - About 7 hrs to fix

                Function parse has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
                Open

                  parse: function(data) {
                    let littleEndian = this.littleEndian();
                    let reader = new DataView(data);
                
                    // String.fromCharCode
                Severity: Minor
                Found in src/loaders/loaders.trk.js - About 7 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

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

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

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

                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

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

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

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

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