Showing 271 of 665 total issues

Function parse has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

  parse: function(data) {
    let littleEndian = this.littleEndian();
    let reader = new DataView(data);
    let offset = 0;
    let surfDesc = undefined;
Severity: Minor
Found in src/loaders/loaders.freesurfer.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 _convertColorSpace has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  _convertColorSpace(uncompressedData) {
    let rgbData = null;
    let photometricInterpretation = this.photometricInterpretation();
    let planarConfiguration = this.planarConfiguration();
    if  (planarConfiguration === null) {
Severity: Major
Found in src/parsers/parsers.dicom.js - About 2 hrs to fix

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

        updateDOMContent(clear) {
          const meanSDContainer = this._label.querySelector('.mean-sd');
          const maxMinContainer = this._label.querySelector('.max-min');
          const areaContainer = this._label.querySelector('.area');
    
    
    Severity: Major
    Found in src/widgets/widgets.freehand.js - About 2 hrs to fix

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

          updateDOMContent(clear) {
            const meanSDContainer = this._label.querySelector('.mean-sd');
            const maxMinContainer = this._label.querySelector('.max-min');
            const areaContainer = this._label.querySelector('.area');
      
      
      Severity: Major
      Found in src/widgets/widgets.polygon.js - About 2 hrs to fix

        Function main has 62 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          main() {
            // need to pre-call main to fill up the functions list
            this._main = `
        void intersectionProjection(
          in vec4 plane,
        Severity: Major
        Found in src/shaders/shaders.localizer.fragment.js - About 2 hrs to fix

          Function parseFrame has 61 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            parseFrame(series, stack, url, i, dataParser, resolve, reject) {
              let frame = new ModelsFrame();
              frame.sopInstanceUID = dataParser.sopInstanceUID(i);
              frame.url = url;
              frame.index = i;
          Severity: Major
          Found in src/loaders/loaders.volume.js - About 2 hrs to fix

            File loaders.trk.js has 268 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            'use strict';
            
            THREE.TRKLoader = function() {};
            
            Object.assign(THREE.TRKLoader.prototype, THREE.EventDispatcher.prototype, {
            Severity: Minor
            Found in src/loaders/loaders.trk.js - About 2 hrs to fix

              Function updateDOM has 59 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  updateDOM() {
                    this.updateDOMColor();
              
                    const regions = this._stack.frame[this._params.frameIndex].ultrasoundRegions || [];
              
              
              Severity: Major
              Found in src/widgets/widgets.rectangle.js - About 2 hrs to fix

                ParsersNifti has 22 functions (exceeds 20 allowed). Consider refactoring.
                Open

                export default class ParsersNifti extends ParsersVolume {
                  constructor(data, id) {
                    super();
                
                    /**
                Severity: Minor
                Found in src/parsers/parsers.nifti.js - About 2 hrs to fix

                  Function decode8Planar has a Cognitive Complexity of 17 (exceeds 5 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 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 helpersLocalizer has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const helpersLocalizer = (three = window.THREE) => {
                    if (three === undefined || three.Object3D === undefined) {
                      return null;
                    }
                  
                  
                  Severity: Minor
                  Found in src/helpers/helpers.localizer.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 main has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    main() {
                      // need to pre-call main to fill up the functions list
                      this._main = `
                  void getIntensity(in vec3 dataCoordinates, out float intensity, out vec3 gradient){
                  
                  
                  Severity: Major
                  Found in src/shaders/shaders.vr.secondpass.fragment.js - About 2 hrs to fix

                    Function updateValues has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        updateValues() {
                          const region = this._regions[
                            this.getRegionByXY(
                              this._regions,
                              CoreUtils.worldToData(this._params.lps2IJK, this._handles[0]._worldPosition)
                    Severity: Major
                    Found in src/widgets/widgets.velocityTimeIntegral.js - About 2 hrs to fix

                      Function _decompressUncompressed has a Cognitive Complexity of 16 (exceeds 5 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 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 _create has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          _create() {
                            if (!this._stack || !this._stack.prepared || !this._stack.packed) {
                              return;
                            }
                      
                      
                      Severity: Major
                      Found in src/helpers/helpers.slice.js - About 2 hrs to fix

                        Function paintCanvas has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            paintCanvas() {
                              // setup context
                              let ctx = this._canvas.getContext('2d');
                              ctx.clearRect(0, 0, this._canvas.width, this._canvas.height);
                              ctx.globalCompositeOperation = 'source-over';
                        Severity: Major
                        Found in src/helpers/helpers.lut.js - About 2 hrs to fix

                          Function getRoI has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            static getRoI(mesh, camera, stack) {
                              mesh.geometry.computeBoundingBox();
                          
                              const bbox = new Box3().setFromObject(mesh);
                              const min = bbox.min.clone().project(camera);
                          Severity: Minor
                          Found in src/core/core.utils.js - About 2 hrs to fix

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

                              static get code() {
                                return `
                                    .widgets-handle {
                                        position: absolute;
                                        border: 1px solid;
                            Severity: Minor
                            Found in src/widgets/widgets.css.js - About 1 hr to fix

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

                                load: function(url, onLoad, onProgress, onError) {
                                  window.console.log(url, onLoad, onProgress, onError);
                              
                                  let scope = this;
                                  let xhr = new XMLHttpRequest();
                              Severity: Minor
                              Found in src/loaders/loaders.trk.js - About 1 hr to fix

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

                                  load: function(url, onLoad, onProgress, onError) {
                                    let scope = this;
                                    let xhr = new XMLHttpRequest();
                                
                                    function onloaded(event) {
                                Severity: Minor
                                Found in src/loaders/loaders.freesurfer.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language