Showing 665 of 665 total issues

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

      this._pht =
        phtKoeff === 1
          ? Number.POSITIVE_INFINITY
          : Math.abs(vMaxTime - (time0 - phtKoeff * time1) / (1 - phtKoeff)) * 1000;
Severity: Major
Found in src/widgets/widgets.pressureHalfTime.js and 1 other location - About 1 hr to fix
src/widgets/widgets.pressureHalfTime.js on lines 318..321

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 57.

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

    _prepareBBox() {
      const HelpersBoundingBoxConstructor = helpersBoundingBox(three);
      this._bBox = new HelpersBoundingBoxConstructor(this._stack);
      this.add(this._bBox);
    }
Severity: Major
Found in src/helpers/helpers.stack.js and 1 other location - About 1 hr to fix
src/helpers/helpers.stack.js on lines 354..358

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 57.

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

  rows(frameIndex = 0) {
    let rows = this._dataSet.uint16('x00280010');

    if (typeof rows === 'undefined') {
      rows = null;
Severity: Major
Found in src/parsers/parsers.dicom.js and 1 other location - About 1 hr to fix
src/parsers/parsers.dicom.js on lines 534..543

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 57.

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

  columns(frameIndex = 0) {
    let columns = this._dataSet.uint16('x00280011');

    if (typeof columns === 'undefined') {
      columns = null;
Severity: Major
Found in src/parsers/parsers.dicom.js and 1 other location - About 1 hr to fix
src/parsers/parsers.dicom.js on lines 523..532

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 57.

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 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 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 zSpacing has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  zSpacing() {
    if (this._numberOfFrames > 1) {
      if (this._frame[0].pixelSpacing && this._frame[0].pixelSpacing[2]) {
        this._spacing.z = this._frame[0].pixelSpacing[2];
      } else {
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 _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 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 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

                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
                    Severity
                    Category
                    Status
                    Source
                    Language