src/widgets/widgets.velocityTimeIntegral.js

Summary

Maintainability
F
2 wks
Test Coverage

Function widgetsVelocityTimeIntegral has 497 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

Severity: Major
Found in src/widgets/widgets.velocityTimeIntegral.js - About 2 days to fix

    Function widgetsVelocityTimeIntegral has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring.
    Open

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

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

          updateValues() {
            const region = this._regions[
              this.getRegionByXY(
                this._regions,
                CoreUtils.worldToData(this._params.lps2IJK, this._handles[0]._worldPosition)
      Severity: Major
      Found in src/widgets/widgets.velocityTimeIntegral.js - About 2 hrs to fix

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

            onMove(evt) {
              if (this.active) {
                const prevPosition = this._moveHandle.worldPosition.clone();
        
                this._moveHandle.onMove(evt, true);
        Severity: Minor
        Found in src/widgets/widgets.velocityTimeIntegral.js - About 1 hr to fix

          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

            Function free has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                free() {
                  this.removeEventListeners();
            
                  this._handles.forEach(elem => {
                    this.remove(elem);
            Severity: Minor
            Found in src/widgets/widgets.velocityTimeIntegral.js - About 1 hr to fix

              Function updateDOMContent has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  updateDOMContent(clear) {
                    const vMaxContainer = this._label.querySelector('.vmax');
                    const vMeanContainer = this._label.querySelector('.vmean');
                    const gMaxContainer = this._label.querySelector('.gmax');
                    const gMeanContainer = this._label.querySelector('.gmean');
              Severity: Minor
              Found in src/widgets/widgets.velocityTimeIntegral.js - About 1 hr to fix

                Function finalize has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    finalize() {
                      if (this._initialized) {
                        // remove old axis handles
                        this._handles.splice(-2).forEach(elem => {
                          this.remove(elem);
                Severity: Minor
                Found in src/widgets/widgets.velocityTimeIntegral.js - About 1 hr to fix

                  Function onEnd has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      onEnd() {
                        if (this._handles.length < 3) {
                          return;
                        }
                  
                  
                  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

                        updateDOMPosition() {
                          if (this._handles.length < 2) {
                            return;
                          }
                          // update lines and get coordinates of lowest handle
                    Severity: Major
                    Found in src/widgets/widgets.velocityTimeIntegral.js and 1 other location - About 2 days to fix
                    src/widgets/widgets.freehand.js on lines 486..517

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

                    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

                        pushPopHandle() {
                          let handle0 = this._handles[this._handles.length - 3];
                          let handle1 = this._handles[this._handles.length - 2];
                          let newhandle = this._handles[this._handles.length - 1];
                          let isOnLine = this.isPointOnLine(
                    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 378..400

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

                    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

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

                          if (this._dragged || !this._handles[this._handles.length - 1].tracking) {
                            this._handles[this._handles.length - 1].tracking = false;
                            this._handles[this._handles.length - 1].onEnd();
                          } else {
                            this._handles[this._handles.length - 1].tracking = false;
                    Severity: Major
                    Found in src/widgets/widgets.velocityTimeIntegral.js and 1 other location - About 5 hrs to fix
                    src/widgets/widgets.freehand.js on lines 185..190

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

                    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

                        onHover(evt) {
                          if (evt) {
                            this.hoverDom(evt);
                          }
                    
                    
                    Severity: Major
                    Found in src/widgets/widgets.velocityTimeIntegral.js and 2 other locations - About 4 hrs to fix
                    src/widgets/widgets.freehand.js on lines 78..91
                    src/widgets/widgets.polygon.js on lines 82..95

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

                    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

                        checkHandle(index, shift) {
                          const region = this.getRegionByXY(
                            this._regions,
                            CoreUtils.worldToData(
                              this._params.lps2IJK,
                    Severity: Major
                    Found in src/widgets/widgets.velocityTimeIntegral.js and 1 other location - About 3 hrs to fix
                    src/widgets/widgets.pressureHalfTime.js on lines 203..217

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 113.

                    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

                        createLine() {
                          const line = document.createElement('div');
                    
                          line.className = 'widgets-line';
                          line.addEventListener('mouseenter', this.onHover);
                    Severity: Major
                    Found in src/widgets/widgets.velocityTimeIntegral.js and 2 other locations - About 3 hrs to fix
                    src/widgets/widgets.freehand.js on lines 250..258
                    src/widgets/widgets.polygon.js on lines 284..292

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

                    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

                        updateDOMColor() {
                          if (this._handles.length >= 2) {
                            this._lines.forEach(elem => (elem.style.backgroundColor = this._color));
                          }
                          this._label.style.borderColor = this._color;
                    Severity: Major
                    Found in src/widgets/widgets.velocityTimeIntegral.js and 1 other location - About 2 hrs to fix
                    src/widgets/widgets.freehand.js on lines 402..407

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

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

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

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

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

                    Refactorings

                    Further Reading

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

                        hideDOM() {
                          this._handles.forEach(elem => elem.hideDOM());
                    
                          this._lines.forEach(elem => (elem.style.display = 'none'));
                          this._label.style.display = 'none';
                    Severity: Major
                    Found in src/widgets/widgets.velocityTimeIntegral.js and 5 other locations - About 2 hrs to fix
                    src/widgets/widgets.freehand.js on lines 260..265
                    src/widgets/widgets.freehand.js on lines 267..272
                    src/widgets/widgets.polygon.js on lines 294..299
                    src/widgets/widgets.polygon.js on lines 301..306
                    src/widgets/widgets.velocityTimeIntegral.js on lines 551..556

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

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

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

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

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

                    Refactorings

                    Further Reading

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

                        showDOM() {
                          this._handles.forEach(elem => elem.showDOM());
                    
                          this._lines.forEach(elem => (elem.style.display = ''));
                          this._label.style.display = '';
                    Severity: Major
                    Found in src/widgets/widgets.velocityTimeIntegral.js and 5 other locations - About 2 hrs to fix
                    src/widgets/widgets.freehand.js on lines 260..265
                    src/widgets/widgets.freehand.js on lines 267..272
                    src/widgets/widgets.polygon.js on lines 294..299
                    src/widgets/widgets.polygon.js on lines 301..306
                    src/widgets/widgets.velocityTimeIntegral.js on lines 544..549

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

                    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._dragged && this._active) {
                            this._selected = !this._selected; // change state if there was no dragging
                            this._handles.forEach(elem => (elem.selected = this._selected));
                          }
                    Severity: Major
                    Found in src/widgets/widgets.velocityTimeIntegral.js and 2 other locations - About 1 hr to fix
                    src/widgets/widgets.freehand.js on lines 201..204
                    src/widgets/widgets.polygon.js on lines 207..210

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 73.

                    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

                        set targetMesh(targetMesh) {
                          this._targetMesh = targetMesh;
                          this._handles.forEach(elem => (elem.targetMesh = targetMesh));
                          this._moveHandle.targetMesh = targetMesh;
                          this.update();
                    Severity: Major
                    Found in src/widgets/widgets.velocityTimeIntegral.js and 2 other locations - About 1 hr to fix
                    src/widgets/widgets.freehand.js on lines 575..580
                    src/widgets/widgets.polygon.js on lines 576..581

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

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

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

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

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

                    Refactorings

                    Further Reading

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

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

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 68.

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

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

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

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

                    Refactorings

                    Further Reading

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

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

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 68.

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

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

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

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

                    Refactorings

                    Further Reading

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

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

                          this._handles.slice(0, -1).forEach(elem => {
                            elem.onEnd();
                            active = active || elem.active;
                          });
                    Severity: Major
                    Found in src/widgets/widgets.velocityTimeIntegral.js and 1 other location - About 1 hr to fix
                    src/widgets/widgets.freehand.js on lines 179..182

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

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

                          this._handles.forEach(elem => {
                            elem.onStart(evt);
                            active = active || elem.active;
                          });
                    Severity: Major
                    Found in src/widgets/widgets.velocityTimeIntegral.js and 4 other locations - About 35 mins to fix
                    src/widgets/widgets.freehand.js on lines 105..108
                    src/widgets/widgets.freehand.js on lines 157..160
                    src/widgets/widgets.polygon.js on lines 108..111
                    src/widgets/widgets.polygon.js on lines 166..169

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

                    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

                          ['vmax', 'vmean', 'gmax', 'gmean', 'envti', 'vti', 'info'].forEach(name => {
                            const div = document.createElement('div');
                    
                            div.className = name;
                            measurementsContainer.appendChild(div);
                    Severity: Minor
                    Found in src/widgets/widgets.velocityTimeIntegral.js and 1 other location - About 30 mins to fix
                    src/widgets/widgets.pressureHalfTime.js on lines 251..256

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

                    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

                    There are no issues that match your filters.

                    Category
                    Status