src/widgets/widgets.rectangle.js

Summary

Maintainability
F
1 wk
Test Coverage

Function widgetsRectangle has 336 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

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

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

    const widgetsRectangle = (three = window.THREE) => {
      if (three === undefined || three.Object3D === undefined) {
        return null;
      }
    
    
    Severity: Minor
    Found in src/widgets/widgets.rectangle.js - About 1 day to fix

    Cognitive Complexity

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

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

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

    Further reading

    File widgets.rectangle.js has 343 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.rectangle.js - About 4 hrs to fix

      Function updateDOM has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          updateDOM() {
            this.updateDOMColor();
      
            const regions = this._stack.frame[this._params.frameIndex].ultrasoundRegions || [];
      
      
      Severity: Major
      Found in src/widgets/widgets.rectangle.js - About 2 hrs to fix

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

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

          TODO found
          Open

                this.updateRoI(); // TODO: if (this._dragged || !this._initialized)
          Severity: Minor
          Found in src/widgets/widgets.rectangle.js by fixme

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

              onEnd() {
                this._handles[0].onEnd(); // First Handle
          
                if (
                  this._handles[1].tracking &&
          Severity: Major
          Found in src/widgets/widgets.rectangle.js and 1 other location - About 2 days to fix
          src/widgets/widgets.ellipse.js on lines 150..180

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

          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._calibrationFactor) {
                  this._area *= Math.pow(this._calibrationFactor, 2);
                } else if (regions && regions.length > 0 && this._stack.lps2IJK) {
                  const region0 = this.getRegionByXY(
                    regions,
          Severity: Major
          Found in src/widgets/widgets.rectangle.js and 1 other location - About 1 day to fix
          src/widgets/widgets.ellipse.js on lines 338..367

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

          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

              onMove(evt) {
                if (this._active) {
                  const prevPosition = this._moveHandle.worldPosition.clone();
          
                  this._dragged = true;
          Severity: Major
          Found in src/widgets/widgets.rectangle.js and 1 other location - About 1 day to fix
          src/widgets/widgets.ellipse.js on lines 126..148

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

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

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

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

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

          Refactorings

          Further Reading

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

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

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 175.

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

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

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

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

          Refactorings

          Further Reading

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

                if (this._units === 'units' && !this._label.hasAttribute('title')) {
                  this._label.setAttribute('title', 'Calibration is required to display the area in cm²');
                  this._label.style.color = this._colors.error;
                } else if (this._units !== 'units' && this._label.hasAttribute('title')) {
                  this._label.removeAttribute('title');
          Severity: Major
          Found in src/widgets/widgets.rectangle.js and 1 other location - About 5 hrs to fix
          src/widgets/widgets.ellipse.js on lines 369..375

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

          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

              onHover(evt) {
                if (evt) {
                  this.hoverDom(evt);
                }
          
          
          Severity: Major
          Found in src/widgets/widgets.rectangle.js and 3 other locations - About 3 hrs to fix
          src/widgets/widgets.ellipse.js on lines 91..100
          src/widgets/widgets.pressureHalfTime.js on lines 96..105
          src/widgets/widgets.ruler.js on lines 81..90

          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

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

              removeEventListeners() {
                this._container.removeEventListener('wheel', this.onMove);
          
                this._rectangle.removeEventListener('mouseenter', this.onHover);
                this._rectangle.removeEventListener('mouseleave', this.onHover);
          Severity: Major
          Found in src/widgets/widgets.rectangle.js and 9 other locations - About 3 hrs to fix
          src/widgets/widgets.crossRuler.js on lines 71..78
          src/widgets/widgets.crossRuler.js on lines 80..87
          src/widgets/widgets.peakVelocity.js on lines 65..72
          src/widgets/widgets.peakVelocity.js on lines 74..81
          src/widgets/widgets.pressureHalfTime.js on lines 78..85
          src/widgets/widgets.pressureHalfTime.js on lines 87..94
          src/widgets/widgets.rectangle.js on lines 68..75
          src/widgets/widgets.ruler.js on lines 63..70
          src/widgets/widgets.ruler.js on lines 72..79

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

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

              addEventListeners() {
                this._container.addEventListener('wheel', this.onMove);
          
                this._rectangle.addEventListener('mouseenter', this.onHover);
                this._rectangle.addEventListener('mouseleave', this.onHover);
          Severity: Major
          Found in src/widgets/widgets.rectangle.js and 9 other locations - About 3 hrs to fix
          src/widgets/widgets.crossRuler.js on lines 71..78
          src/widgets/widgets.crossRuler.js on lines 80..87
          src/widgets/widgets.peakVelocity.js on lines 65..72
          src/widgets/widgets.peakVelocity.js on lines 74..81
          src/widgets/widgets.pressureHalfTime.js on lines 78..85
          src/widgets/widgets.pressureHalfTime.js on lines 87..94
          src/widgets/widgets.rectangle.js on lines 77..84
          src/widgets/widgets.ruler.js on lines 63..70
          src/widgets/widgets.ruler.js on lines 72..79

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

          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

              update() {
                this.updateColor();
          
                this._handles[0].update();
                this._handles[1].update();
          Severity: Major
          Found in src/widgets/widgets.rectangle.js and 2 other locations - About 2 hrs to fix
          src/widgets/widgets.annotation.js on lines 266..276
          src/widgets/widgets.ellipse.js on lines 244..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 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

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

              set worldPosition(worldPosition) {
                this._handles[0].worldPosition.copy(worldPosition);
                this._handles[1].worldPosition.copy(worldPosition);
                this._worldPosition.copy(worldPosition);
                this.update();
          Severity: Major
          Found in src/widgets/widgets.rectangle.js and 4 other locations - About 2 hrs to fix
          src/widgets/widgets.annotation.js on lines 418..423
          src/widgets/widgets.ellipse.js on lines 468..473
          src/widgets/widgets.pressureHalfTime.js on lines 440..445
          src/widgets/widgets.ruler.js on lines 353..358

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

          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

                const labelTransform = this.adjustLabelTransform(
                  this._label,
                  this._handles[1].screenPosition
                    .clone()
                    .add(rectData.paddingVector.multiplyScalar(15 + this._label.offsetHeight / 2))
          Severity: Major
          Found in src/widgets/widgets.rectangle.js and 1 other location - About 2 hrs to fix
          src/widgets/widgets.ellipse.js on lines 384..389

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

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

                for (let i = 0; i < 2; i++) {
                  handle = new WidgetsHandle(targetMesh, controls, params);
                  this.add(handle);
                  this._handles.push(handle);
                }
          Severity: Major
          Found in src/widgets/widgets.rectangle.js and 7 other locations - About 1 hr to fix
          src/widgets/widgets.angle.js on lines 43..47
          src/widgets/widgets.annotation.js on lines 49..53
          src/widgets/widgets.biruler.js on lines 44..48
          src/widgets/widgets.crossRuler.js on lines 50..54
          src/widgets/widgets.ellipse.js on lines 49..53
          src/widgets/widgets.pressureHalfTime.js on lines 58..62
          src/widgets/widgets.ruler.js on lines 43..47

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

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

              set targetMesh(targetMesh) {
                this._targetMesh = targetMesh;
                this._handles.forEach(elem => (elem.targetMesh = targetMesh));
                this.update();
              }
          Severity: Major
          Found in src/widgets/widgets.rectangle.js and 7 other locations - About 1 hr to fix
          src/widgets/widgets.angle.js on lines 391..395
          src/widgets/widgets.annotation.js on lines 408..412
          src/widgets/widgets.biruler.js on lines 419..423
          src/widgets/widgets.crossRuler.js on lines 603..607
          src/widgets/widgets.ellipse.js on lines 458..462
          src/widgets/widgets.pressureHalfTime.js on lines 430..434
          src/widgets/widgets.ruler.js on lines 343..347

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

          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

              updateDOMColor() {
                this._rectangle.style.borderColor = this._color;
                this._label.style.borderColor = this._color;
              }
          Severity: Major
          Found in src/widgets/widgets.rectangle.js and 3 other locations - About 55 mins to fix
          src/widgets/widgets.peakVelocity.js on lines 224..227
          src/widgets/widgets.pressureHalfTime.js on lines 380..383
          src/widgets/widgets.ruler.js on lines 297..300

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

          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._label.querySelector('.area').innerHTML = `Area: ${this._area.toFixed(2)} ${
                  this._units
                }`;
          Severity: Minor
          Found in src/widgets/widgets.rectangle.js and 1 other location - About 50 mins to fix
          src/widgets/widgets.ellipse.js on lines 376..378

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

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

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

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

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

          Refactorings

          Further Reading

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

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

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 51.

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

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

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

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

          Refactorings

          Further Reading

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

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

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 51.

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

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

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

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

          Refactorings

          Further Reading

          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.rectangle.js and 3 other locations - About 40 mins to fix
          src/widgets/widgets.ellipse.js on lines 26..29
          src/widgets/widgets.freehand.js on lines 26..29
          src/widgets/widgets.polygon.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

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

                this._label.style.transform =
                  'translate3D(' + labelTransform.x + 'px,' + labelTransform.y + 'px, 0)';
          Severity: Minor
          Found in src/widgets/widgets.rectangle.js and 1 other location - About 30 mins to fix
          src/widgets/widgets.ellipse.js on lines 406..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 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