Showing 665 of 665 total issues

Function widgetsAngle has 310 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

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

    Function presetLuts has 303 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        static presetLuts() {
          return {
            default: [[0, 0, 0, 0], [1, 1, 1, 1]],
            spectrum: [
              [0, 0, 0, 0],
    Severity: Major
    Found in src/helpers/helpers.lut.js - About 1 day to fix

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

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

      Cognitive Complexity

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

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

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

      Further reading

      Function widgetsRuler has 272 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        ParsersDicom has 72 functions (exceeds 20 allowed). Consider refactoring.
        Open

        export default class ParsersDicom extends ParsersVolume {
          constructor(data, id) {
            super();
        
            this._id = id;
        Severity: Major
        Found in src/parsers/parsers.dicom.js - About 1 day to fix

          Function presetLutsO has 266 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              static presetLutsO() {
                return {
                  linear: [[0, 0], [1, 1]],
                  lowpass: [[0, 0.8], [0.2, 0.6], [0.3, 0.1], [1, 0]],
                  bandpass: [[0, 0], [0.4, 0.8], [0.6, 0.8], [1, 0]],
          Severity: Major
          Found in src/helpers/helpers.lut.js - About 1 day to fix

            ModelsFrame has 71 functions (exceeds 20 allowed). Consider refactoring.
            Open

            export default class ModelsFrame extends ModelsBase {
              /**
               * Constructor
               */
              constructor() {
            Severity: Major
            Found in src/models/models.frame.js - About 1 day to fix

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

                  pushPopHandle() {
                    let handle0 = this._handles[this._handles.length - 3];
                    let handle1 = this._handles[this._handles.length - 2];
                    let newhandle = this._handles[this._handles.length - 1];
                    let isOnLine = this.isPointOnLine(
              Severity: Major
              Found in src/widgets/widgets.velocityTimeIntegral.js and 1 other location - About 1 day to fix
              src/widgets/widgets.freehand.js on lines 378..400

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 240.

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

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

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

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

              Refactorings

              Further Reading

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

                  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

              Function widgetsBase has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
              Open

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

              Cognitive Complexity

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

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

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

              Further reading

              Function widgetsBiruler has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
              Open

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

              Similar blocks of code found in 2 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,
                      paddingVector = lineData.line.normalize().multiplyScalar(labelPadding),
              Severity: Major
              Found in src/widgets/widgets.crossRuler.js and 1 other location - About 1 day to fix
              src/widgets/widgets.crossRuler.js on lines 383..392

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

              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 label2Padding =
                        Math.tan(angle2) < this._label2.offsetHeight / this._label2.offsetWidth
                          ? this._label2.offsetWidth / 2 / Math.cos(angle2) + 15 // 5px for each handle + padding
                          : this._label2.offsetHeight / 2 / Math.cos(Math.PI / 2 - angle2) + 15,
                      paddingVector2 = line2Data.line.normalize().multiplyScalar(label2Padding),
              Severity: Major
              Found in src/widgets/widgets.crossRuler.js and 1 other location - About 1 day to fix
              src/widgets/widgets.crossRuler.js on lines 365..374

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

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

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

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

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

              Refactorings

              Further Reading

              Function widgetsEllipse has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
              Open

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

              Cognitive Complexity

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

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

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

              Further reading

              Function helpersStack has 242 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const helpersStack = (three = window.THREE) => {
                if (three === undefined || three.Object3D === undefined) {
                  return null;
                }
              
              
              Severity: Major
              Found in src/helpers/helpers.stack.js - About 1 day to fix

                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.voxelProbe.js and 1 other location - About 1 day to fix
                src/widgets/widgets.freehand.js on lines 224..248

                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

                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

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

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

                Function widgetsHandle has 234 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const widgetsHandle = (three = window.THREE) => {
                  if (three === undefined || three.Object3D === undefined) {
                    return null;
                  }
                
                
                Severity: Major
                Found in src/widgets/widgets.handle.js - About 1 day to fix
                  Severity
                  Category
                  Status
                  Source
                  Language