Showing 271 of 665 total issues

Function _decompressUncompressed has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  _decompressUncompressed(frameIndex = 0) {
    let buffer = this._dataSet.buffer;
    const numberOfChannels = this.numberOfChannels();
    const numPixels = this.rows(frameIndex) * this.columns(frameIndex) * numberOfChannels;
    if (!this.rightHanded()) {
Severity: Minor
Found in src/parsers/parsers.nrrd.js - About 1 hr to fix

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

        constructor(
          stack,
          index = 0,
          position = new three.Vector3(0, 0, 0),
          direction = new three.Vector3(0, 0, 1),
    Severity: Minor
    Found in src/helpers/helpers.slice.js - About 1 hr to fix

      Function _decompressUncompressed has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        _decompressUncompressed(frameIndex = 0) {
          // papaya.volume.nifti.NIFTI_TYPE_UINT8           = 2;
          // papaya.volume.nifti.NIFTI_TYPE_INT16           = 4;
          // papaya.volume.nifti.NIFTI_TYPE_INT32           = 8;
          // papaya.volume.nifti.NIFTI_TYPE_FLOAT32        = 16;
      Severity: Minor
      Found in src/parsers/parsers.nifti.js - About 1 hr to fix

        Function decode8Planar has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function decode8Planar(imageFrame, pixelData) {
          const frameData = pixelData;
          const frameSize = imageFrame.rows * imageFrame.columns;
          const outFrame = new ArrayBuffer(frameSize * imageFrame.samplesPerPixel);
          const header = new DataView(frameData.buffer, frameData.byteOffset);
        Severity: Minor
        Found in src/decoders/decoders.rle.js - About 1 hr to fix

          Function decode8 has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function decode8(imageFrame, pixelData) {
            const frameData = pixelData;
            const frameSize = imageFrame.rows * imageFrame.columns;
            const outFrame = new ArrayBuffer(frameSize * imageFrame.samplesPerPixel);
            const header = new DataView(frameData.buffer, frameData.byteOffset);
          Severity: Minor
          Found in src/decoders/decoders.rle.js - About 1 hr to fix

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

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

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

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

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

                    onEnd() {
                      this._handles[0].onEnd(); // First Handle
                
                      if (
                        (this._handles[1].tracking &&
                Severity: Minor
                Found in src/widgets/widgets.angle.js - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                      if (
                        this._stackID === stack.stackID &&
                        this._numberOfFrames === 1 &&
                        stack._numberOfFrames === 1 &&
                        this._frame[0].columns === stack.frame[0].columns &&
                  Severity: Critical
                  Found in src/models/models.stack.js - About 1 hr to fix

                    Consider simplifying this complex logical expression.
                    Open

                        if (
                          !(
                            super.validate(model) &&
                            typeof model.mergeSeries === 'function' &&
                            model.hasOwnProperty('_seriesInstanceUID') &&
                    Severity: Critical
                    Found in src/models/models.series.js - About 1 hr to fix

                      Function _reorderData has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        _reorderData() {
                          let numberOfChannels = this.numberOfChannels();
                          let numPixels = this.rows() * this.columns() * numberOfChannels;
                          let buffer = this._niftiImage;
                      
                      
                      Severity: Minor
                      Found in src/parsers/parsers.nifti.js - About 1 hr to fix

                        Function _decodePixelData has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          _decodePixelData(frameIndex = 0) {
                            // if compressed..?
                            let transferSyntaxUID = this.transferSyntaxUID();
                        
                            // find compression scheme
                        Severity: Minor
                        Found in src/parsers/parsers.dicom.js - About 1 hr to fix

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

                              onEnd() {
                                this._handles[0].onEnd();
                                this._handles[2].onEnd();
                                this._handles[3].onEnd();
                          
                          
                          Severity: Minor
                          Found in src/widgets/widgets.crossRuler.js - About 1 hr to fix

                            Function orderIntersections has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              static orderIntersections(points, direction) {
                                let reference = this.centerOfMass(points);
                                // direction from first point to reference
                                let referenceDirection = new Vector3(
                                  points[0].x - reference.x,
                            Severity: Minor
                            Found in src/core/core.utils.js - About 1 hr to fix

                              Function updateDOM has 33 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.ruler.js - About 1 hr to fix

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

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

                                  Function updateDOMContent has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      updateDOMContent(clear) {
                                        const vMaxContainer = this._label.querySelector('.vmax');
                                        const vMeanContainer = this._label.querySelector('.vmean');
                                        const gMaxContainer = this._label.querySelector('.gmax');
                                        const gMeanContainer = this._label.querySelector('.gmean');
                                  Severity: Minor
                                  Found in src/widgets/widgets.velocityTimeIntegral.js - About 1 hr to fix

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

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

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

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

                                        Function merge has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                          merge(series) {
                                            if (!this.validate(series)) {
                                              return false;
                                            }
                                        
                                        
                                        Severity: Minor
                                        Found in src/models/models.series.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