Showing 271 of 665 total issues

Consider simplifying this complex logical expression.
Open

    } else if (
      this._frame[0].imagePosition &&
      this._frame[0].imageOrientation &&
      this._frame[1] &&
      this._frame[1].imagePosition &&
Severity: Major
Found in src/models/models.stack.js - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

        if (
          index.x >= 0 &&
          index.y >= 0 &&
          index.z >= 0 &&
          index.x < dimensions.x &&
    Severity: Major
    Found in src/models/models.stack.js - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

            if (
              (vMaxIndex === 2 && verticalDirection.getComponent(vMaxIndex) < 0) ||
              (vMaxIndex === 1 && verticalDirection.getComponent(vMaxIndex) > 0) ||
              (vMaxIndex === 0 && verticalDirection.getComponent(vMaxIndex) > 0)
            ) {
      Severity: Major
      Found in src/cameras/cameras.orthographic.js - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

            if (
              !(
                objectToTest !== null &&
                typeof objectToTest !== 'undefined' &&
                objectToTest.hasOwnProperty('position') &&
        Severity: Major
        Found in src/core/core.validators.js - About 40 mins to fix

          Consider simplifying this complex logical expression.
          Open

              if (
                !(
                  objectToTest !== null &&
                  typeof objectToTest !== 'undefined' &&
                  objectToTest.hasOwnProperty('x') &&
          Severity: Major
          Found in src/core/core.validators.js - About 40 mins to fix

            Function pixelSpacing has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

              pixelSpacing(frameIndex = 0) {
                // expect frame index to start at 0!
                let pixelSpacing = this._findStringEverywhere('x00289110', 'x00280030', frameIndex);
            
                if (pixelSpacing === null) {
            Severity: Minor
            Found in src/parsers/parsers.dicom.js - About 35 mins 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 _decodePixelData has a Cognitive Complexity of 7 (exceeds 5 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 35 mins 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

            Avoid too many return statements within this function.
            Open

                  return new Int16Array(buffer, frameOffset, numPixels);
            Severity: Major
            Found in src/parsers/parsers.nifti.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return new Int32Array(buffer, frameOffset, numPixels);
              Severity: Major
              Found in src/parsers/parsers.nifti.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return newArray;
                Severity: Major
                Found in src/parsers/parsers.dicom.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return new Float32Array(buffer, frameOffset, numPixels);
                  Severity: Major
                  Found in src/parsers/parsers.nrrd.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return new Uint32Array(buffer, frameOffset, numPixels);
                    Severity: Major
                    Found in src/parsers/parsers.mhd.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                            return this._decodeUncompressed(frameIndex);
                      Severity: Major
                      Found in src/parsers/parsers.dicom.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                              return new Float32Array(buffer, frameOffset, numPixels);
                        Severity: Major
                        Found in src/parsers/parsers.mhd.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                return new Uint32Array(buffer, frameOffset, numPixels);
                          Severity: Major
                          Found in src/parsers/parsers.nrrd.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                  return new Int32Array(buffer, frameOffset, numPixels);
                            Severity: Major
                            Found in src/parsers/parsers.mhd.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                    return data;
                              Severity: Major
                              Found in src/parsers/parsers.nifti.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                      return new Int32Array(buffer, frameOffset, numPixels);
                                Severity: Major
                                Found in src/parsers/parsers.nrrd.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                        return this._swapFrame(frame);
                                  Severity: Major
                                  Found in src/parsers/parsers.dicom.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                        return true;
                                    Severity: Major
                                    Found in src/core/core.intersections.js - About 30 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language