Showing 271 of 665 total issues

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

  imageOrientation(frameIndex = 0) {
    // http://nifti.nimh.nih.gov/pub/dist/src/niftilib/nifti1.h
    // http://nifti.nimh.nih.gov/pub/dist/src/niftilib/nifti1_io.c
    if (this._dataSet.qform_code > 0) {
      // METHOD 2 (used when qform_code > 0, which should be the "normal" case):
Severity: Minor
Found in src/parsers/parsers.nifti.js - About 1 hr to fix

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

        updateDOM() {
          this.updateDOMColor();
    
          // update first line
          const lineData = this.getLineData(
    Severity: Minor
    Found in src/widgets/widgets.angle.js - About 1 hr to fix

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

          constructor(targetMesh: THREE.Mesh, controls: THREE.OrbitControls, params: WidgetParameter) {
            super();
      
            this._widgetType = 'Base';
      
      
      Severity: Minor
      Found in src/widgets/widgets.base.ts - About 1 hr to fix

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

            init(xCosine, yCosine, zCosine, controls, box, canvas) {
              // DEPRECATION NOTICE
              window.console.warn(
                `cameras.orthographic.init(...) is deprecated.
                Use .cosines, .controls, .box and .canvas instead.`
        Severity: Minor
        Found in src/cameras/cameras.orthographic.js - About 1 hr to fix

          Function decode16 has 37 lines of code (exceeds 25 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 1 hr to fix

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

                onMove(evt) {
                  let hovered = false;
            
                  if (this.active) {
                    this._dragged = true;
            Severity: Minor
            Found in src/widgets/widgets.polygon.js - About 1 hr to fix

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

                  constructor(halfDimensions, center, position, direction, toAABB = new three.Matrix4()) {
                    //
                    // prepare data for the shape!
                    //
                    let aabb = {
              Severity: Minor
              Found in src/geometries/geometries.slice.js - About 1 hr to fix

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

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

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

                      recalculateOrtho() {
                        // called onMove if 2nd or 3rd handle is active
                        const activeInd = this._handles[2].active ? 2 : 3;
                        const lines = [];
                        const intersect = new three.Vector3();
                  Severity: Minor
                  Found in src/widgets/widgets.crossRuler.js - About 1 hr to fix

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

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

                      Function _decompressUncompressed has a Cognitive Complexity of 12 (exceeds 5 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

                      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 pack has 35 lines of code (exceeds 25 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 1 hr to fix

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

                            _prepareMaterial() {
                              // uniforms
                              this._uniforms = ShadersUniform.uniforms();
                              this._uniforms.uWorldBBox.value = this._stack.worldBoundingBox();
                              this._uniforms.uTextureSize.value = this._stack.textureSize;
                        Severity: Minor
                        Found in src/helpers/helpers.volumerendering.js - About 1 hr to fix

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

                          var copy = (srcDir, dstDir) => {
                              var results = [];
                              var list = fs.readdirSync(srcDir);
                              var src, dst;
                              list.forEach(file => {
                          Severity: Minor
                          Found in scripts/buildDist.js - About 1 hr to fix

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

                              static parseUrl(url) {
                                const parsedUrl = new URL(url, 'http://fix.me');
                                const data = {
                                  filename: parsedUrl.searchParams.get('filename'),
                                  extension: '',
                            Severity: Minor
                            Found in src/core/core.utils.js - About 1 hr to fix

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

                                  free() {
                                    this.removeEventListeners();
                              
                                    this._handles.forEach(h => {
                                      this.remove(h);
                              Severity: Minor
                              Found in src/widgets/widgets.freehand.js - About 1 hr to fix

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

                                    free() {
                                      this.removeEventListeners();
                                
                                      this._handles.forEach(elem => {
                                        this.remove(elem);
                                Severity: Minor
                                Found in src/widgets/widgets.velocityTimeIntegral.js - About 1 hr to fix

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

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

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

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

                                          free() {
                                            this.removeEventListeners();
                                      
                                            this._handles.forEach(h => {
                                              this.remove(h);
                                      Severity: Minor
                                      Found in src/widgets/widgets.polygon.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language