Showing 271 of 665 total issues

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

/** * Imports ***/
import ModelsBase from '../models/models.base';

import { Vector3 } from 'three/src/math/Vector3';

Severity: Minor
Found in src/models/models.frame.js - About 5 hrs to fix

    Function helpersLut has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

    const helpersLut = (three = window.THREE) => {
      if (three === undefined || three.Object3D === undefined) {
        return null;
      }
      const Constructor = three.Object3D;
    Severity: Minor
    Found in src/helpers/helpers.lut.js - About 4 hrs 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 119 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      constructor(data, id) {
        super();
    
        /**
         * @member
    Severity: Major
    Found in src/parsers/parsers.mgh.js - About 4 hrs to fix

      File widgets.base.ts has 363 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import WidgetsCss from './widgets.css';
      
      import {COLORS} from '../core/core.colors';
      import CoreUtils from '../core/core.utils';
      
      
      Severity: Minor
      Found in src/widgets/widgets.base.ts - About 4 hrs to fix

        ParsersVolume has 35 functions (exceeds 20 allowed). Consider refactoring.
        Open

        export default class ParsersVolume {
          constructor() {
            this._rightHanded = true;
          }
        
        
        Severity: Minor
        Found in src/parsers/parsers.volume.js - About 4 hrs to fix

          Function parse has 112 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            parse: function(data) {
              let littleEndian = this.littleEndian();
              let reader = new DataView(data);
              let offset = 0;
              let surfDesc = undefined;
          Severity: Major
          Found in src/loaders/loaders.freesurfer.js - About 4 hrs to fix

            File widgets.biruler.js has 353 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import { widgetsBase } from './widgets.base';
            import { widgetsHandle as widgetsHandleFactory } from './widgets.handle';
            
            /**
             * @module widgets/biruler
            Severity: Minor
            Found in src/widgets/widgets.biruler.js - About 4 hrs to fix

              Function uFloat32 has 107 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                uFloat32() {
                  return `
              void uFloat32(in float r, in float g, in float b, in float a, out float value){
              
                // create arrays containing bits for rgba values
              Severity: Major
              Found in src/shaders/helpers/shaders.helpers.unpack.js - About 4 hrs to fix

                Function _packTo8Bits has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                Open

                  _packTo8Bits(channels, frame, textureSize, startVoxel, stopVoxel) {
                    const packed = {
                      textureType: null,
                      data: null,
                    };
                Severity: Minor
                Found in src/models/models.stack.js - About 4 hrs 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 106 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  static uniforms() {
                    return {
                      uTextureSize: {
                        type: 'i',
                        value: 0,
                Severity: Major
                Found in src/shaders/shaders.vr.secondpass.uniform.js - About 4 hrs to fix

                  File widgets.rectangle.js has 343 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import { widgetsBase } from './widgets.base';
                  import { widgetsHandle as widgetsHandleFactory } from './widgets.handle';
                  import CoreUtils from '../core/core.utils';
                  
                  /**
                  Severity: Minor
                  Found in src/widgets/widgets.rectangle.js - About 4 hrs to fix

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

                          updateDOM() {
                            this.updateDOMColor();
                      
                            // update first line
                            const lineData = this.getLineData(
                      Severity: Major
                      Found in src/widgets/widgets.biruler.js - About 4 hrs to fix

                        Function _packTo8Bits has 97 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          _packTo8Bits(channels, frame, textureSize, startVoxel, stopVoxel) {
                            const packed = {
                              textureType: null,
                              data: null,
                            };
                        Severity: Major
                        Found in src/models/models.stack.js - About 3 hrs to fix

                          File parsers.mgh.js has 328 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          /** * Imports ***/
                          import ParsersVolume from './parsers.volume';
                          
                          import { Vector3 } from 'three/src/math/Vector3';
                          
                          
                          Severity: Minor
                          Found in src/parsers/parsers.mgh.js - About 3 hrs to fix

                            Function parse has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              parse(response) {
                                // emit 'parse-start' event
                                this.emit('parse-start', {
                                  file: response.url,
                                  time: new Date(),
                            Severity: Major
                            Found in src/loaders/loaders.volume.js - About 3 hrs to fix

                              File widgets.annotation.js has 318 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import { widgetsBase } from './widgets.base';
                              import { widgetsHandle as widgetsHandleFactory } from './widgets.handle';
                              
                              /**
                               * @module widgets/annotation
                              Severity: Minor
                              Found in src/widgets/widgets.annotation.js - About 3 hrs to fix

                                Function main has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  main() {
                                    // need to pre-call main to fill up the functions list
                                    this._main = `
                                void main(void) {
                                
                                
                                Severity: Major
                                Found in src/shaders/shaders.data.fragment.js - About 3 hrs to fix

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

                                    computeDefinition() {
                                      this._definition = `
                                  void trilinearInterpolation(
                                    in vec3 normalizedPosition,
                                    out vec4 interpolatedValue,
                                  Severity: Major
                                  Found in src/shaders/interpolation/shaders.interpolation.trilinear.js - About 3 hrs to fix

                                    File widgets.angle.js has 316 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    import { widgetsBase } from './widgets.base';
                                    import { widgetsHandle as widgetsHandleFactory } from './widgets.handle';
                                    
                                    /**
                                     * @module widgets/angle
                                    Severity: Minor
                                    Found in src/widgets/widgets.angle.js - About 3 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language