src/widgets/widgets.freehand.js

Summary

Maintainability
F
1 mo
Test Coverage

Function widgetsFreehand has 445 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

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

    Function widgetsFreehand has a Cognitive Complexity of 95 (exceeds 5 allowed). Consider refactoring.
    Open

    const widgetsFreehand = (three = window.THREE) => {
      if (three === undefined || three.Object3D === undefined) {
        return null;
      }
    
    
    Severity: Minor
    Found in src/widgets/widgets.freehand.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.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 updateDOMContent has 64 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          updateDOMContent(clear) {
            const meanSDContainer = this._label.querySelector('.mean-sd');
            const maxMinContainer = this._label.querySelector('.max-min');
            const areaContainer = this._label.querySelector('.area');
      
      
      Severity: Major
      Found in src/widgets/widgets.freehand.js - About 2 hrs to fix

        Function updateMesh has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            updateMesh() {
              if (this._mesh) {
                this.remove(this._mesh);
              }
        
        
        Severity: Minor
        Found in src/widgets/widgets.freehand.js - About 1 hr to fix

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

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

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

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

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

                  onEnd() {
                    if (this._handles.length < 3) {
                      return;
                    }
              
              
              Severity: Minor
              Found in src/widgets/widgets.freehand.js - About 1 hr to fix

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

                    constructor(targetMesh, controls, params = {}) {
                      super(targetMesh, controls, params);
                
                      this._widgetType = 'Freehand';
                
                
                Severity: Minor
                Found in src/widgets/widgets.freehand.js - About 1 hr to fix

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

                      updateDOMContent(clear) {
                        const meanSDContainer = this._label.querySelector('.mean-sd');
                        const maxMinContainer = this._label.querySelector('.max-min');
                        const areaContainer = this._label.querySelector('.area');
                  
                  
                  Severity: Major
                  Found in src/widgets/widgets.freehand.js and 1 other location - About 5 days to fix
                  src/widgets/widgets.polygon.js on lines 413..488

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

                  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

                      updateMesh() {
                        if (this._mesh) {
                          this.remove(this._mesh);
                        }
                  
                  
                  Severity: Major
                  Found in src/widgets/widgets.freehand.js and 1 other location - About 5 days to fix
                  src/widgets/widgets.polygon.js on lines 323..394

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

                  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

                      free() {
                        this.removeEventListeners();
                  
                        this._handles.forEach(h => {
                          this.remove(h);
                  Severity: Major
                  Found in src/widgets/widgets.freehand.js and 1 other location - About 2 days to fix
                  src/widgets/widgets.polygon.js on lines 520..563

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

                  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

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

                  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];
                  
                  
                  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 295..316

                  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

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

                      createDOM() {
                        this._label = document.createElement('div');
                        this._label.className = 'widgets-label';
                  
                        // measurements
                  Severity: Major
                  Found in src/widgets/widgets.freehand.js and 1 other location - About 1 day to fix
                  src/widgets/widgets.voxelProbe.js on lines 137..161

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

                  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.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._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.freehand.js and 1 other location - About 5 hrs to fix
                  src/widgets/widgets.velocityTimeIntegral.js on lines 205..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 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.freehand.js and 2 other locations - About 4 hrs to fix
                  src/widgets/widgets.polygon.js on lines 82..95
                  src/widgets/widgets.velocityTimeIntegral.js on lines 90..103

                  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

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

                      update() {
                        this.updateColor();
                  
                        // update handles
                        this._handles.forEach(elem => elem.update());
                  Severity: Major
                  Found in src/widgets/widgets.freehand.js and 1 other location - About 3 hrs to fix
                  src/widgets/widgets.polygon.js on lines 308..321

                  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

                  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.freehand.js and 2 other locations - About 3 hrs to fix
                  src/widgets/widgets.polygon.js on lines 284..292
                  src/widgets/widgets.velocityTimeIntegral.js on lines 285..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 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.freehand.js and 1 other location - About 2 hrs to fix
                  src/widgets/widgets.velocityTimeIntegral.js on lines 464..469

                  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

                      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.freehand.js and 5 other locations - About 2 hrs to fix
                  src/widgets/widgets.freehand.js on lines 260..265
                  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
                  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

                      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.freehand.js and 5 other locations - About 2 hrs to fix
                  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
                  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 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.freehand.js and 2 other locations - About 1 hr to fix
                  src/widgets/widgets.polygon.js on lines 207..210
                  src/widgets/widgets.velocityTimeIntegral.js on lines 217..220

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 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.freehand.js and 2 other locations - About 1 hr to fix
                  src/widgets/widgets.polygon.js on lines 576..581
                  src/widgets/widgets.velocityTimeIntegral.js on lines 617..622

                  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

                      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.freehand.js and 5 other locations - About 1 hr to fix
                  src/widgets/widgets.freehand.js on lines 71..76
                  src/widgets/widgets.velocityTimeIntegral.js on lines 76..81
                  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 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.freehand.js and 5 other locations - About 1 hr to fix
                  src/widgets/widgets.freehand.js on lines 64..69
                  src/widgets/widgets.velocityTimeIntegral.js on lines 76..81
                  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

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

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 67.

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

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

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

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

                  Refactorings

                  Further Reading

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

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

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 65.

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

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

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

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

                  Refactorings

                  Further Reading

                  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.freehand.js and 1 other location - About 1 hr to fix
                  src/widgets/widgets.velocityTimeIntegral.js on lines 199..202

                  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

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

                        this._units =
                          !this._calibrationFactor && !params.stack.frame[params.frameIndex].pixelSpacing
                            ? 'units'
                            : 'cm²';
                  Severity: Major
                  Found in src/widgets/widgets.freehand.js and 3 other locations - About 40 mins to fix
                  src/widgets/widgets.ellipse.js on lines 26..29
                  src/widgets/widgets.polygon.js on lines 26..29
                  src/widgets/widgets.rectangle.js on lines 26..29

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

                  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.freehand.js and 4 other locations - About 35 mins to fix
                  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
                  src/widgets/widgets.velocityTimeIntegral.js on lines 117..120

                  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

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

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

                  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

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

                        if (this._domHovered && this._initialized) {
                          this._moving = true;
                          this._controls.enabled = false;
                        }
                  Severity: Minor
                  Found in src/widgets/widgets.freehand.js and 2 other locations - About 30 mins to fix
                  src/widgets/widgets.crossRuler.js on lines 125..128
                  src/widgets/widgets.polygon.js on lines 120..123

                  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