Showing 271 of 665 total issues

Function widgetsPeakVelocity has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

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

Severity: Minor
Found in src/widgets/widgets.peakVelocity.js - About 3 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 updateDOM has 88 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.crossRuler.js - About 3 hrs to fix

    Function helpersStack has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

    const helpersStack = (three = window.THREE) => {
      if (three === undefined || three.Object3D === undefined) {
        return null;
      }
    
    
    Severity: Minor
    Found in src/helpers/helpers.stack.js - About 3 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 helpersBorder has 80 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const helpersBorder = (three = window.THREE) => {
      if (three === undefined || three.Object3D === undefined) {
        return null;
      }
    
    
    Severity: Major
    Found in src/helpers/helpers.border.js - About 3 hrs to fix

      Function helpersBoundingBox has 78 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const helpersBoundingBox = (three = window.THREE) => {
        if (three === undefined || three.Object3D === undefined) {
          return null;
        }
      
      
      Severity: Major
      Found in src/helpers/helpers.boundingbox.js - About 3 hrs to fix

        Function fetch has 78 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          fetch(url, requests) {
            return new Promise((resolve, reject) => {
              const request = new XMLHttpRequest();
              request.open('GET', url);
              request.crossOrigin = true;
        Severity: Major
        Found in src/loaders/loaders.base.js - About 3 hrs to fix

          Function aabbPlane has 78 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            static aabbPlane(aabb, plane) {
              //
              // obb = { halfDimensions, orientation, center, toAABB }
              // plane = { position, direction }
              //
          Severity: Major
          Found in src/core/core.intersections.js - About 3 hrs to fix

            Function _decodeOpenJPEG has 75 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              _decodeOpenJPEG(frameIndex = 0) {
                const encodedPixelData = this.getEncapsulatedImageFrame(frameIndex);
                const bytesPerPixel = this.bitsAllocated(frameIndex) <= 8 ? 1 : 2;
                const signed = this.pixelRepresentation(frameIndex) === 1;
                const dataPtr = openJPEG._malloc(encodedPixelData.length);
            Severity: Major
            Found in src/parsers/parsers.dicom.js - About 3 hrs to fix

              Function _convertColorSpace has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
              Open

                _convertColorSpace(uncompressedData) {
                  let rgbData = null;
                  let photometricInterpretation = this.photometricInterpretation();
                  let planarConfiguration = this.planarConfiguration();
                  if  (planarConfiguration === null) {
              Severity: Minor
              Found in src/parsers/parsers.dicom.js - About 2 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 decode16 has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
              Open

              function decode16(imageFrame, pixelData) {
                const frameData = pixelData;
                const frameSize = imageFrame.rows * imageFrame.columns;
              
                const outFrame = new ArrayBuffer(frameSize * imageFrame.samplesPerPixel * 2);
              Severity: Minor
              Found in src/decoders/decoders.rle.js - About 2 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 widgetsVoxelprobe has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
              Open

              const widgetsVoxelprobe = (three = window.THREE) => {
                if (three === undefined || three.Object3D === undefined) {
                  return null;
                }
              
              
              Severity: Minor
              Found in src/widgets/widgets.voxelProbe.js - About 2 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 _decodeUncompressed has 70 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                _decodeUncompressed(frameIndex = 0) {
                  let pixelRepresentation = this.pixelRepresentation(frameIndex);
                  let bitsAllocated = this.bitsAllocated(frameIndex);
                  let pixelDataElement = this._dataSet.elements.x7fe00010;
                  let pixelDataOffset = pixelDataElement.dataOffset;
              Severity: Major
              Found in src/parsers/parsers.dicom.js - About 2 hrs to fix

                File core.utils.js has 283 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import Validators from './core.validators';
                
                import { Box3 } from 'three/src/math/Box3';
                import { Raycaster } from 'three/src/core/Raycaster';
                import { Triangle } from 'three/src/math/Triangle';
                Severity: Minor
                Found in src/core/core.utils.js - About 2 hrs to fix

                  Function initEventListenner has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    initEventListenner() {
                      const self = this;
                  
                      this._emitter.on('load-start', function(event) {
                        const totalFiles = event.files.length;
                  Severity: Major
                  Found in src/helpers/helpers.progressbar.eventbased.js - About 2 hrs to fix

                    Function _decodeOpenJPEG has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                    Open

                      _decodeOpenJPEG(frameIndex = 0) {
                        const encodedPixelData = this.getEncapsulatedImageFrame(frameIndex);
                        const bytesPerPixel = this.bitsAllocated(frameIndex) <= 8 ? 1 : 2;
                        const signed = this.pixelRepresentation(frameIndex) === 1;
                        const dataPtr = openJPEG._malloc(encodedPixelData.length);
                    Severity: Minor
                    Found in src/parsers/parsers.dicom.js - About 2 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 prepareSegmentation has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                    Open

                      prepareSegmentation() {
                        // store frame and do special pre-processing
                        this._frameSegment = this._frame;
                        let mergedFrames = [];
                    
                    
                    Severity: Minor
                    Found in src/models/models.stack.js - About 2 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 updateDOM has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        updateDOM() {
                          if (!this._geometry) {
                            return;
                          }
                    
                    
                    Severity: Major
                    Found in src/widgets/widgets.ellipse.js - About 2 hrs to fix

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

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

                        Function decode8 has a Cognitive Complexity of 19 (exceeds 5 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 2 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 _decodeUncompressed has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                        Open

                          _decodeUncompressed(frameIndex = 0) {
                            let pixelRepresentation = this.pixelRepresentation(frameIndex);
                            let bitsAllocated = this.bitsAllocated(frameIndex);
                            let pixelDataElement = this._dataSet.elements.x7fe00010;
                            let pixelDataOffset = pixelDataElement.dataOffset;
                        Severity: Minor
                        Found in src/parsers/parsers.dicom.js - About 2 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

                        Severity
                        Category
                        Status
                        Source
                        Language