Showing 271 of 665 total issues

Function worldBoundingBox has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  worldBoundingBox() {
    let bbox = [
      Number.POSITIVE_INFINITY,
      Number.NEGATIVE_INFINITY,
      Number.POSITIVE_INFINITY,
Severity: Minor
Found in src/models/models.stack.js - About 25 mins 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 _swapFrame has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  _swapFrame(frame) {
    // swap bytes ( if 8bits (1byte), nothing to swap)
    let bitsAllocated = this.bitsAllocated();

    if (bitsAllocated === 16) {
Severity: Minor
Found in src/parsers/parsers.dicom.js - About 25 mins 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 _pixelTo8Bit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  _pixelTo8Bit(value, params) {
    // values equal to pixelPaddingValue are outside of the image and should be ignored
    let packedValue = value <= params.min || value === params.padding ? 0 : 255;

    if (value > params.min && value < params.max) {
Severity: Minor
Found in src/models/models.frame.js - About 25 mins 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 _onScroll has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  _onScroll(event) {
    if (event.delta > 0) {
      if (this._object.index >= this._object.orientationMaxIndex) {
        return false;
      }
Severity: Minor
Found in src/helpers/x/helpers.x.renderer2d.js - About 25 mins 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 orderFrames has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  orderFrames() {
    // order the frames based on theirs dimension indices
    // first index is the most important.
    // 1,1,1,1 will be first
    // 1,1,2,1 will be next
Severity: Minor
Found in src/models/models.stack.js - About 25 mins 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 packEchos has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  packEchos() {
    // 4 echo times...
    let echos = 4;
    let packedEcho = [];
    for (let i = 0; i < this._frame.length; i += echos) {
Severity: Minor
Found in src/models/models.stack.js - About 25 mins 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 geometriesSlice has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

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

Severity: Minor
Found in src/geometries/geometries.slice.js - About 25 mins 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 _reorderData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  _reorderData() {
    let numberOfChannels = this.numberOfChannels();
    let numPixels = this.rows() * this.columns() * numberOfChannels;
    let buffer = this._niftiImage;

Severity: Minor
Found in src/parsers/parsers.nifti.js - About 25 mins 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 _decodeJPEGLossless has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  _decodeJPEGLossless(frameIndex = 0) {
    let encodedPixelData = this.getEncapsulatedImageFrame(frameIndex);
    let pixelRepresentation = this.pixelRepresentation(frameIndex);
    let bitsAllocated = this.bitsAllocated(frameIndex);
    let byteOutput = bitsAllocated <= 8 ? 1 : 2;
Severity: Minor
Found in src/parsers/parsers.dicom.js - About 25 mins 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 cielab2XYZ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  public static cielab2XYZ(l: number, a: number, b: number) {
    // https://www.mathworks.com/help/images/ref/whitepoint.html
    // d65: 0.9504, 1, 1.0888
    const refX = 95.047;
    const refY = 100.0;
Severity: Minor
Found in src/core/core.colors.ts - About 25 mins 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 xyz2RGB has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  public static xyz2RGB(x: number, y: number, z: number) {
    x /= 100;
    y /= 100;
    z /= 100;
    let r = x * 3.2406 + y * -1.5372 + z * -0.4986;
Severity: Minor
Found in src/core/core.colors.ts - About 25 mins 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