Showing 271 of 665 total issues

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

    constructor(targetMesh, controls, params = {}) {
      super(targetMesh, controls, params);

      this._widgetType = 'Polygon';

Severity: Minor
Found in src/widgets/widgets.polygon.js - About 1 hr to fix

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

        free() {
          this.removeEventListeners();
    
          this._handles.forEach(h => {
            this.remove(h);
    Severity: Minor
    Found in src/widgets/widgets.annotation.js - About 1 hr to fix

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

          onEnd() {
            let numHandles = this._handles.length;
            let active = false;
      
            if (
      Severity: Minor
      Found in src/widgets/widgets.polygon.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 _vector2Label has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _vector2Label(direction) {
                const index = this._getMaxIndex(direction);
                // set vector max value to 1
                const scaledDirection = direction
                  .clone()
          Severity: Minor
          Found in src/cameras/cameras.orthographic.js - About 1 hr to fix

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

                constructor(left, right, top, bottom, near, far) {
                  super(left, right, top, bottom, near, far);
            
                  this._front = null;
                  this._back = null;
            Severity: Minor
            Found in src/cameras/cameras.orthographic.js - About 1 hr to fix

              Function orderFrames has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                orderFrames() {
                  // order the frames based on theirs dimension indices
                  // first index is the most important.
                  // 1,1,1,1 will be first
                  // 1,1,2,1 will be next
              Severity: Minor
              Found in src/models/models.stack.js - About 1 hr to fix

                Function initCoordinates has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    initCoordinates(first, second, third, fourth) {
                      const intersectR = new three.Vector3();
                      const intersectS = new three.Vector3();
                      const ray = new three.Ray(first);
                
                
                Severity: Minor
                Found in src/widgets/widgets.crossRuler.js - About 1 hr to fix

                  Function finalize has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      finalize() {
                        if (this._initialized) {
                          // remove old axis handles
                          this._handles.splice(-2).forEach(elem => {
                            this.remove(elem);
                  Severity: Minor
                  Found in src/widgets/widgets.velocityTimeIntegral.js - About 1 hr to fix

                    Function onEnd has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        onEnd() {
                          if (this._handles.length < 3) {
                            return;
                          }
                    
                    
                    Severity: Minor
                    Found in src/widgets/widgets.freehand.js - About 1 hr to fix

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

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

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

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

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

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

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

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

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

                                load() {
                                  if (this.file) {
                                    // instantiate the loader
                                    // it loads and parses the dicom image
                                    const loader = new LoadersVolume(this._progressbarContainer);
                              Severity: Minor
                              Found in src/helpers/x/helpers.x.volume.js - About 1 hr to fix

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

                                  static validateAabb(aabb) {
                                    //
                                    if (aabb === null) {
                                      window.console.log('Invalid aabb.');
                                      window.console.log(aabb);
                                Severity: Minor
                                Found in src/core/core.intersections.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

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

                                        free() {
                                          this.removeEventListeners();
                                    
                                          this._handles.forEach(h => {
                                            this.remove(h);
                                    Severity: Minor
                                    Found in src/widgets/widgets.ellipse.js - About 1 hr to fix

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

                                        _parser(extension) {
                                          let Parser = null;
                                      
                                          switch (extension.toUpperCase()) {
                                            case 'NII':
                                      Severity: Minor
                                      Found in src/loaders/loaders.volume.js - About 1 hr to fix

                                        Function instanceNumber has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                          instanceNumber(frameIndex = 0) {
                                            let instanceNumber = null;
                                            // first look for frame!
                                            // per frame functionnal group sequence
                                            let perFrameFunctionnalGroupSequence = this._dataSet.elements.x52009230;
                                        Severity: Minor
                                        Found in src/parsers/parsers.dicom.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

                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language