Showing 665 of 665 total issues

File models.frame.js has 374 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/** * Imports ***/
import ModelsBase from '../models/models.base';

import { Vector3 } from 'three/src/math/Vector3';

Severity: Minor
Found in src/models/models.frame.js - About 5 hrs to fix

    Function helpersLut has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

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

      constructor(data, id) {
        super();
    
        /**
         * @member
    Severity: Major
    Found in src/parsers/parsers.mgh.js - About 4 hrs to fix

      File widgets.base.ts has 363 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import WidgetsCss from './widgets.css';
      
      import {COLORS} from '../core/core.colors';
      import CoreUtils from '../core/core.utils';
      
      
      Severity: Minor
      Found in src/widgets/widgets.base.ts - About 4 hrs to fix

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

              if (this._handles[1].active) {
                this._handles[3].onEnd();
              } else if (this._dragged || !this._handles[3].tracking) {
                this._handles[3].tracking = false;
                this._handles[3].onEnd();
        Severity: Major
        Found in src/widgets/widgets.biruler.js and 1 other location - About 4 hrs to fix
        src/widgets/widgets.angle.js on lines 173..180

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 129.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

              if (this._handles[1].active) {
                this._handles[2].onEnd();
              } else if (this._dragged || !this._handles[2].tracking) {
                this._handles[2].tracking = false;
                this._handles[2].onEnd();
        Severity: Major
        Found in src/widgets/widgets.angle.js and 1 other location - About 4 hrs to fix
        src/widgets/widgets.biruler.js on lines 115..122

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 129.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            hideDOM() {
              this._line.style.display = 'none';
              this._label.style.display = 'none';
              this._line2.style.display = 'none';
              this._label2.style.display = 'none';
        Severity: Major
        Found in src/widgets/widgets.biruler.js and 1 other location - About 4 hrs to fix
        src/widgets/widgets.biruler.js on lines 203..211

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 129.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            showDOM() {
              this._line.style.display = '';
              this._label.style.display = '';
              this._line2.style.display = '';
              this._label2.style.display = '';
        Severity: Major
        Found in src/widgets/widgets.biruler.js and 1 other location - About 4 hrs to fix
        src/widgets/widgets.biruler.js on lines 193..201

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 129.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

          inStackPositionNumber(frameIndex = 0) {
            let inStackPositionNumber = null;
        
            // try to get it from enhanced MR images
            // per-frame functionnal group sequence
        Severity: Major
        Found in src/parsers/parsers.dicom.js and 1 other location - About 4 hrs to fix
        src/parsers/parsers.dicom.js on lines 656..674

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 128.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

          stackID(frameIndex = 0) {
            let stackID = null;
        
            // try to get it from enhanced MR images
            // per-frame functionnal group sequence
        Severity: Major
        Found in src/parsers/parsers.dicom.js and 1 other location - About 4 hrs to fix
        src/parsers/parsers.dicom.js on lines 636..654

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 128.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        ParsersVolume has 35 functions (exceeds 20 allowed). Consider refactoring.
        Open

        export default class ParsersVolume {
          constructor() {
            this._rightHanded = true;
          }
        
        
        Severity: Minor
        Found in src/parsers/parsers.volume.js - About 4 hrs to fix

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

              set geometry(geometry) {
                if (this._mesh) {
                  this.remove(this._mesh);
                  this._mesh.geometry.dispose();
                  this._mesh.geometry = null;
          Severity: Major
          Found in src/helpers/helpers.contour.js and 1 other location - About 4 hrs to fix
          src/helpers/helpers.localizer.js on lines 133..147

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 125.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

              set geometry(geometry) {
                if (this._mesh) {
                  this.remove(this._mesh);
                  this._mesh.geometry.dispose();
                  this._mesh.geometry = null;
          Severity: Major
          Found in src/helpers/helpers.localizer.js and 1 other location - About 4 hrs to fix
          src/helpers/helpers.contour.js on lines 111..125

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 125.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

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

            parse: function(data) {
              let littleEndian = this.littleEndian();
              let reader = new DataView(data);
              let offset = 0;
              let surfDesc = undefined;
          Severity: Major
          Found in src/loaders/loaders.freesurfer.js - About 4 hrs to fix

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

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

              Similar blocks of code found in 3 locations. Consider refactoring.
              Open

                  onHover(evt) {
                    if (evt) {
                      this.hoverDom(evt);
                    }
              
              
              Severity: Major
              Found in src/widgets/widgets.freehand.js and 2 other locations - About 4 hrs to fix
              src/widgets/widgets.polygon.js on lines 82..95
              src/widgets/widgets.velocityTimeIntegral.js on lines 90..103

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 123.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 3 locations. Consider refactoring.
              Open

                  onHover(evt) {
                    if (evt) {
                      this.hoverDom(evt);
                    }
              
              
              Severity: Major
              Found in src/widgets/widgets.polygon.js and 2 other locations - About 4 hrs to fix
              src/widgets/widgets.freehand.js on lines 78..91
              src/widgets/widgets.velocityTimeIntegral.js on lines 90..103

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 123.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 3 locations. Consider refactoring.
              Open

                  onHover(evt) {
                    if (evt) {
                      this.hoverDom(evt);
                    }
              
              
              Severity: Major
              Found in src/widgets/widgets.velocityTimeIntegral.js and 2 other locations - About 4 hrs to fix
              src/widgets/widgets.freehand.js on lines 78..91
              src/widgets/widgets.polygon.js on lines 82..95

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 123.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  showDOM() {
                    this._line.style.display = '';
                    this._line2.style.display = '';
                    this._label.style.display = '';
                    this._label2.style.display = '';
              Severity: Major
              Found in src/widgets/widgets.crossRuler.js and 1 other location - About 4 hrs to fix
              src/widgets/widgets.crossRuler.js on lines 249..256

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 121.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  hideDOM() {
                    this._line.style.display = 'none';
                    this._line2.style.display = 'none';
                    this._label.style.display = 'none';
                    this._label2.style.display = 'none';
              Severity: Major
              Found in src/widgets/widgets.crossRuler.js and 1 other location - About 4 hrs to fix
              src/widgets/widgets.crossRuler.js on lines 258..265

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 121.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Severity
              Category
              Status
              Source
              Language