src/widgets/widgets.pressureHalfTime.js

Summary

Maintainability
F
1 wk
Test Coverage

Function widgetsPressureHalfTime has 335 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

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

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

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

    Cognitive Complexity

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

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

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

    Further reading

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

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

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

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

            updateDOM() {
              this.updateDOMColor();
        
              // update line
              const lineData = this.getLineData(
        Severity: Minor
        Found in src/widgets/widgets.pressureHalfTime.js - About 1 hr to fix

          Function updateValues has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              updateValues() {
                const usPosition0 = this.getUsPoint(
                  this._regions,
                  CoreUtils.worldToData(this._params.lps2IJK, this._handles[0].worldPosition)
                );
          Severity: Minor
          Found in src/widgets/widgets.pressureHalfTime.js - About 1 hr to fix

            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.pressureHalfTime.js and 1 other location - About 1 day to fix
            src/widgets/widgets.ruler.js on lines 302..330

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 311.

            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

                  const labelPadding =
                    Math.tan(angle) < this._label.offsetHeight / this._label.offsetWidth
                      ? this._label.offsetWidth / 2 / Math.cos(angle) + 15 // 5px for each handle + padding
                      : this._label.offsetHeight / 2 / Math.cos(Math.PI / 2 - angle) + 15;
            Severity: Major
            Found in src/widgets/widgets.pressureHalfTime.js and 4 other locations - About 4 hrs to fix
            src/widgets/widgets.angle.js on lines 334..337
            src/widgets/widgets.biruler.js on lines 331..334
            src/widgets/widgets.biruler.js on lines 349..352
            src/widgets/widgets.ruler.js on lines 283..286

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

            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.pressureHalfTime.js and 3 other locations - About 3 hrs to fix
            src/widgets/widgets.ellipse.js on lines 91..100
            src/widgets/widgets.rectangle.js on lines 86..95
            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 2 locations. Consider refactoring.
            Open

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

            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._line.removeEventListener('mouseenter', this.onHover);
                  this._line.removeEventListener('mouseleave', this.onHover);
            Severity: Major
            Found in src/widgets/widgets.pressureHalfTime.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.rectangle.js on lines 68..75
            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

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

                addEventListeners() {
                  this._container.addEventListener('wheel', this.onMove);
            
                  this._line.addEventListener('mouseenter', this.onHover);
                  this._line.addEventListener('mouseleave', this.onHover);
            Severity: Major
            Found in src/widgets/widgets.pressureHalfTime.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 87..94
            src/widgets/widgets.rectangle.js on lines 68..75
            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 2 locations. Consider refactoring.
            Open

                showDOM() {
                  this._line.style.display = '';
                  this._label.style.display = '';
                  this._handles[0].showDOM();
                  this._handles[1].showDOM();
            Severity: Major
            Found in src/widgets/widgets.pressureHalfTime.js and 1 other location - About 2 hrs to fix
            src/widgets/widgets.ruler.js on lines 210..215

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

            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.pressureHalfTime.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.rectangle.js on lines 431..436
            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

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

                  const paddingPoint =
                    lineData.length > labelPadding * 2
                      ? this._handles[1].screenPosition.clone().sub(paddingVector)
                      : this._handles[1].screenPosition.clone().add(paddingVector);
            Severity: Major
            Found in src/widgets/widgets.pressureHalfTime.js and 3 other locations - About 2 hrs to fix
            src/widgets/widgets.biruler.js on lines 336..339
            src/widgets/widgets.biruler.js on lines 354..357
            src/widgets/widgets.ruler.js on lines 288..291

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

            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

                hideDOM() {
                  this._line.style.display = 'none';
                  this._label.style.display = 'none';
                  this._handles.forEach(elem => elem.hideDOM());
                }
            Severity: Major
            Found in src/widgets/widgets.pressureHalfTime.js and 1 other location - About 1 hr to fix
            src/widgets/widgets.ruler.js on lines 204..208

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

                getMeasurements() {
                  return {
                    vMax: this._vMax,
                    gMax: this._gMax,
                    pht: this._pht,
            Severity: Major
            Found in src/widgets/widgets.pressureHalfTime.js and 1 other location - About 1 hr to fix
            src/widgets/widgets.velocityTimeIntegral.js on lines 602..611

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 66.

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

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

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

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

            Refactorings

            Further Reading

            Similar blocks of code found in 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.pressureHalfTime.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.rectangle.js on lines 48..52
            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.pressureHalfTime.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.rectangle.js on lines 421..425
            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 2 locations. Consider refactoring.
            Open

                  this._dt =
                    dtKoeff === 1
                      ? Number.POSITIVE_INFINITY
                      : Math.abs(vMaxTime - (time0 - dtKoeff * time1) / (1 - dtKoeff)) * 1000;
            Severity: Major
            Found in src/widgets/widgets.pressureHalfTime.js and 1 other location - About 1 hr to fix
            src/widgets/widgets.pressureHalfTime.js on lines 313..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 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 2 locations. Consider refactoring.
            Open

                  this._pht =
                    phtKoeff === 1
                      ? Number.POSITIVE_INFINITY
                      : Math.abs(vMaxTime - (time0 - phtKoeff * time1) / (1 - phtKoeff)) * 1000;
            Severity: Major
            Found in src/widgets/widgets.pressureHalfTime.js and 1 other location - About 1 hr to fix
            src/widgets/widgets.pressureHalfTime.js on lines 318..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 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._line.style.backgroundColor = this._color;
                  this._label.style.borderColor = this._color;
                }
            Severity: Major
            Found in src/widgets/widgets.pressureHalfTime.js and 3 other locations - About 55 mins to fix
            src/widgets/widgets.peakVelocity.js on lines 224..227
            src/widgets/widgets.rectangle.js on lines 302..305
            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

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

                  const usPosition1 = this.getUsPoint(
                    this._regions,
                    CoreUtils.worldToData(this._params.lps2IJK, this._handles[1].worldPosition)
                  );
            Severity: Minor
            Found in src/widgets/widgets.pressureHalfTime.js and 1 other location - About 40 mins to fix
            src/widgets/widgets.pressureHalfTime.js on lines 292..295

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

                  const usPosition0 = this.getUsPoint(
                    this._regions,
                    CoreUtils.worldToData(this._params.lps2IJK, this._handles[0].worldPosition)
                  );
            Severity: Minor
            Found in src/widgets/widgets.pressureHalfTime.js and 1 other location - About 40 mins to fix
            src/widgets/widgets.pressureHalfTime.js on lines 296..299

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

                  this._line.style.transform = `translate3D(${lineData.transformX}px, ${
                    lineData.transformY
                  }px, 0)
                            rotate(${lineData.transformAngle}rad)`;
            Severity: Major
            Found in src/widgets/widgets.pressureHalfTime.js and 10 other locations - About 40 mins to fix
            src/widgets/widgets.angle.js on lines 302..305
            src/widgets/widgets.angle.js on lines 314..317
            src/widgets/widgets.annotation.js on lines 304..307
            src/widgets/widgets.annotation.js on lines 338..341
            src/widgets/widgets.biruler.js on lines 245..248
            src/widgets/widgets.biruler.js on lines 257..260
            src/widgets/widgets.biruler.js on lines 277..280
            src/widgets/widgets.crossRuler.js on lines 299..302
            src/widgets/widgets.crossRuler.js on lines 311..314
            src/widgets/widgets.ruler.js on lines 262..265

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

            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._label.querySelector('.vmax').innerHTML = `Vmax: ${this._vMax.toFixed(2)} m/s`;
            Severity: Minor
            Found in src/widgets/widgets.pressureHalfTime.js and 1 other location - About 35 mins to fix
            src/widgets/widgets.peakVelocity.js on lines 212..212

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

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

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

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

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

            Refactorings

            Further Reading

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

                  ['vmax', 'gmax', 'pht', 'mva', 'dt', 'ds'].forEach(name => {
                    const div = document.createElement('div');
            
                    div.className = name;
                    measurementsContainer.appendChild(div);
            Severity: Minor
            Found in src/widgets/widgets.pressureHalfTime.js and 1 other location - About 30 mins to fix
            src/widgets/widgets.velocityTimeIntegral.js on lines 272..277

            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