Showing 271 of 665 total issues

Function _frameToCanvas has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

  _frameToCanvas() {
    const dimension = this._columns * this._rows;

    const params = {
      invert: this._invert,
Severity: Minor
Found in src/models/models.frame.js - About 1 hr 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 uniforms has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  static uniforms() {
    return {
      uCanvasWidth: {
        type: 'f',
        value: 0,
Severity: Minor
Found in src/shaders/shaders.localizer.uniform.js - About 1 hr to fix

    Function _frameToCanvas has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      _frameToCanvas() {
        const dimension = this._columns * this._rows;
    
        const params = {
          invert: this._invert,
    Severity: Minor
    Found in src/models/models.frame.js - About 1 hr to fix

      Function prepare has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        prepare() {
          // if segmentation, merge some frames...
          if (this._modality === 'SEG') {
            this.prepareSegmentation();
          }
      Severity: Minor
      Found in src/models/models.stack.js - About 1 hr to fix

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

            onMove(evt) {
              if (this.active) {
                const prevPosition = this._moveHandle.worldPosition.clone();
        
                this._moveHandle.onMove(evt, true);
        Severity: Minor
        Found in src/widgets/widgets.velocityTimeIntegral.js - About 1 hr to fix

          Function prepareSegmentation has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            prepareSegmentation() {
              // store frame and do special pre-processing
              this._frameSegment = this._frame;
              let mergedFrames = [];
          
          
          Severity: Minor
          Found in src/models/models.stack.js - About 1 hr to fix

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

            const helpersMaterialMixin = (three = window.THREE) => {
              if (three === undefined || three.Object3D === undefined) {
                return null;
              }
            
            
            Severity: Minor
            Found in src/helpers/helpers.material.mixin.js - About 1 hr to fix

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

                constructor() {
                  super();
              
                  this._uid = null;
                  this._stackID = -1;
              Severity: Minor
              Found in src/models/models.stack.js - About 1 hr to fix

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

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

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

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

                    Function geometriesSlice has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const geometriesSlice = (three = window.THREE) => {
                      if (three === undefined || three.ShapeBufferGeometry === undefined) {
                        return null;
                      }
                    
                    
                    Severity: Minor
                    Found in src/geometries/geometries.slice.js - About 1 hr to fix

                      Function helpersBorder has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                      const helpersBorder = (three = window.THREE) => {
                        if (three === undefined || three.Object3D === undefined) {
                          return null;
                        }
                      
                      
                      Severity: Minor
                      Found in src/helpers/helpers.border.js - About 1 hr 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 getRoI has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                        static getRoI(mesh, camera, stack) {
                          mesh.geometry.computeBoundingBox();
                      
                          const bbox = new Box3().setFromObject(mesh);
                          const min = bbox.min.clone().project(camera);
                      Severity: Minor
                      Found in src/core/core.utils.js - About 1 hr 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 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 geometriesVoxel has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const geometriesVoxel = (three = window.THREE) => {
                          if (three === undefined || three.BoxGeometry === undefined) {
                            return null;
                          }
                        
                        
                        Severity: Minor
                        Found in src/geometries/geometries.voxel.js - About 1 hr to fix

                          Function uniforms has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            static uniforms() {
                              return {
                                uTextureBackTest0: {
                                  type: 't',
                                  value: [],
                          Severity: Minor
                          Found in src/shaders/shaders.layer.uniform.js - About 1 hr to fix

                            Consider simplifying this complex logical expression.
                            Open

                                if (
                                  !(
                                    objectToTest !== null &&
                                    typeof objectToTest !== 'undefined' &&
                                    objectToTest.hasOwnProperty('center') &&
                            Severity: Critical
                            Found in src/core/core.validators.js - About 1 hr to fix

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

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

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

                                  computeDefinition() {
                                    let content = `
                                      step( abs( textureIndexF - 0.0 ), 0.0 ) * texture2D(uTextureContainer[0], uv) +
                                      step( abs( textureIndexF - 1.0 ), 0.0 ) * texture2D(uTextureContainer[1], uv) +
                                      step( abs( textureIndexF - 2.0 ), 0.0 ) * texture2D(uTextureContainer[2], uv) +
                                Severity: Minor
                                Found in src/shaders/helpers/shaders.helpers.texture3d.js - About 1 hr to fix

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

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