Showing 665 of 665 total issues

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

      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.ellipse.js and 1 other location - About 1 day to fix
src/widgets/widgets.rectangle.js on lines 313..342

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

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

        if (this._convention === 'radio') {
          switch (this._orientation) {
            case 'axial':
              // up vector is 'anterior'
              if (posteriorDirection.y > 0) {
Severity: Major
Found in src/cameras/cameras.orthographic.js and 1 other location - About 1 day to fix
src/cameras/cameras.orthographic.js on lines 212..275

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

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

        } else if (this._convention === 'neuro') {
          switch (this._orientation) {
            case 'axial':
              // up vector is 'anterior'
              if (posteriorDirection.y > 0) {
Severity: Major
Found in src/cameras/cameras.orthographic.js and 1 other location - About 1 day to fix
src/cameras/cameras.orthographic.js on lines 151..275

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

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

ModelsStack has 100 functions (exceeds 20 allowed). Consider refactoring.
Open

export default class ModelsStack extends ModelsBase {
  /**
   * Models Stack constructor
   */
  constructor() {
Severity: Major
Found in src/models/models.stack.js - About 1 day to fix

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

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

    Cognitive Complexity

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

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

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

    Further reading

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

    export default class ShadersFragment {
      // pass uniforms object
      constructor(uniforms) {
        this._uniforms = uniforms;
        this._functions = {};
    Severity: Major
    Found in src/shaders/shaders.layer.fragment.js and 1 other location - About 1 day to fix
    src/shaders/shaders.contour.fragment.js on lines 1..119

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

    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

    export default class ShadersFragment {
      // pass uniforms object
      constructor(uniforms) {
        this._uniforms = uniforms;
        this._functions = {};
    Severity: Major
    Found in src/shaders/shaders.contour.fragment.js and 1 other location - About 1 day to fix
    src/shaders/shaders.layer.fragment.js on lines 1..110

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

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

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

      File models.stack.js has 779 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /** * Imports ***/
      import { Matrix4 } from 'three/src/math/Matrix4';
      import { Vector3 } from 'three/src/math/Vector3';
      import { RGBFormat, RGBAFormat } from 'three/src/constants';
      
      
      Severity: Major
      Found in src/models/models.stack.js - About 1 day to fix

        Function widgetsCrossRuler has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring.
        Open

        const widgetsCrossRuler = (three = window.THREE) => {
          if (three === undefined || three.Object3D === undefined) {
            return null;
          }
        
        
        Severity: Minor
        Found in src/widgets/widgets.crossRuler.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 widgetsPolygon has a Cognitive Complexity of 88 (exceeds 5 allowed). Consider refactoring.
        Open

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

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

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

          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

          File helpers.lut.js has 736 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import CoreUtils from '../core/core.utils';
          
          /**
           * @module helpers/lut
           */
          Severity: Major
          Found in src/helpers/helpers.lut.js - About 1 day to fix

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

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

                  Function widgetsAnnotation has 312 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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