Showing 271 of 665 total issues

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

const helpersContour = (three = window.THREE) => {
  if (three === undefined || three.Object3D === undefined) {
    return null;
  }

Severity: Minor
Found in src/helpers/helpers.contour.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 dimensionIndexValues has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  dimensionIndexValues(frameIndex = 0) {
    let dimensionIndexValues = null;

    // try to get it from enhanced MR images
    // per-frame functionnal group sequence
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

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

const helpersVolumeRendering = (three = window.THREE) => {
  if (three === undefined || three.Object3D === undefined) {
    return null;
  }

Severity: Minor
Found in src/helpers/helpers.volumerendering.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 _orderFrameOnDimensionIndicesArraySort has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  _orderFrameOnDimensionIndicesArraySort(a, b) {
    if (
      'dimensionIndexValues' in a &&
      Object.prototype.toString.call(a.dimensionIndexValues) === '[object Array]' &&
      'dimensionIndexValues' in b &&
Severity: Minor
Found in src/models/models.stack.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 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

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

  static stringToNumber(numberAsString) {
    let number = Number(numberAsString);

    // returns true is number is NaN
    if (number !== number) {
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 main has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  main() {
    // need to pre-call main to fill up the functions list
    this._main = `

float luma (vec3 rgb) {
Severity: Minor
Found in src/shaders/shaders.contour.fragment.js - About 1 hr to fix

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

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

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

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

        Function updateMeshPosition has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

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

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

            Function main has 26 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: Minor
            Found in src/shaders/shaders.layer.fragment.js - About 1 hr to fix

              Function _prepareMaterial has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _prepareMaterial() {
                    if (!this._material) {
                      // reference plane
                      this._uniforms.uSlice.value = this._referencePlane;
              
              
              Severity: Minor
              Found in src/helpers/helpers.localizer.js - About 1 hr to fix

                Function cosines has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  cosines() {
                    let cosines = [new Vector3(1, 0, 0), new Vector3(0, 1, 0), new Vector3(0, 0, 1)];
                
                    if (this._imageOrientation && this._imageOrientation.length === 6) {
                      let xCos = new Vector3(
                Severity: Minor
                Found in src/models/models.frame.js - About 1 hr to fix

                  Function _readLong has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    _readLong(len = 1) {
                      let tempBuff = new DataView(this._buffer.slice(this._bufferPos, this._bufferPos + len * 8));
                      this._bufferPos += len * 8;
                      let v = new Uint16Array(len);
                      for (let i = 0; i < len; i++) {
                  Severity: Minor
                  Found in src/parsers/parsers.mgh.js - About 1 hr to fix

                    Consider simplifying this complex logical expression.
                    Open

                        if (
                          !(
                            super.validate(model) &&
                            typeof model.cosines === 'function' &&
                            typeof model.spacingXY === 'function' &&
                    Severity: Major
                    Found in src/models/models.frame.js - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                          if (
                            !(
                              photometricInterpretation !== 'RGB' &&
                              photometricInterpretation !== 'PALETTE COLOR' &&
                              photometricInterpretation !== 'YBR_FULL' &&
                      Severity: Major
                      Found in src/parsers/parsers.dicom.js - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

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

                          Consider simplifying this complex logical expression.
                          Open

                              if (
                                point &&
                                point.x >= bbox.min.x - epsilon &&
                                point.y >= bbox.min.y - epsilon &&
                                point.z >= bbox.min.z - epsilon &&
                          Severity: Major
                          Found in src/core/core.intersections.js - About 1 hr to fix

                            Function pack has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                              pack() {
                                // Get total number of voxels
                                const nbVoxels = this._dimensionsIJK.x * this._dimensionsIJK.y * this._dimensionsIJK.z;
                            
                                // Packing style
                            Severity: Minor
                            Found in src/models/models.stack.js - About 55 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

                            Severity
                            Category
                            Status
                            Source
                            Language