Showing 271 of 665 total issues
Function constructor
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
constructor(data, id) {
super();
/**
* @member
- Read upRead up
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 _readLong
has a Cognitive Complexity of 9 (exceeds 5 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++) {
- Read upRead up
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 mergeModels
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
mergeModels(referenceArray, targetArray) {
if (!(this._validateModelArray(referenceArray) && this._validateModelArray(targetArray))) {
window.console.log('invalid inputs provided.');
return false;
}
- Read upRead up
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 load
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
load: function(url, onLoad, onProgress, onError) {
let scope = this;
let xhr = new XMLHttpRequest();
function onloaded(event) {
- Read upRead up
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 load
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
load: function(url, onLoad, onProgress, onError) {
window.console.log(url, onLoad, onProgress, onError);
let scope = this;
let xhr = new XMLHttpRequest();
- Read upRead up
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
Avoid deeply nested control flow statements. Open
for (let j = 0; j < -n + 1 && outIndex < endOfSegment; ++j) {
out[outIndex] = value;
outIndex++;
}
Avoid deeply nested control flow statements. Open
} else if (bitsAllocated === 8 && channels === 3) {
let data = new Uint8Array(textureSize * textureSize * 3);
for (let i = startVoxel; i < stopVoxel; i++) {
frameIndex = ~~(i / frameDimension);
Avoid deeply nested control flow statements. Open
if (superiorDirection.z > 0) {
superiorDirection.negate();
}
Avoid deeply nested control flow statements. Open
if (superiorDirection.z < 0) {
superiorDirection.negate();
}
Avoid deeply nested control flow statements. Open
for (let j = 0; j < -n + 1 && outIndex < endOfSegment; ++j) {
out[outIndex] = value;
outIndex += imageFrame.samplesPerPixel;
}
Function imageOrientation
has a Cognitive Complexity of 8 (exceeds 5 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):
- Read upRead up
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
Avoid deeply nested control flow statements. Open
for (let i = startVoxel; i < stopVoxel; i++) {
frameIndex = ~~(i / frameDimension);
inFrameIndex = i % frameDimension;
let raw = frame[frameIndex].pixelData[inFrameIndex] + offset;
Avoid deeply nested control flow statements. Open
if (posteriorDirection.y > 0) {
posteriorDirection.negate();
}
Avoid deeply nested control flow statements. Open
if (posteriorDirection.y > 0) {
posteriorDirection.negate();
}
Function _decompressUncompressed
has a Cognitive Complexity of 8 (exceeds 5 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()) {
- Read upRead up
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
Avoid deeply nested control flow statements. Open
if (leftDirection.x > 0) {
leftDirection.negate();
}
Function helpersBoundingBox
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const helpersBoundingBox = (three = window.THREE) => {
if (three === undefined || three.Object3D === undefined) {
return null;
}
- Read upRead up
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
Avoid deeply nested control flow statements. Open
if (superiorDirection.z < 0) {
superiorDirection.negate();
}
Avoid deeply nested control flow statements. Open
if (!Number.isNaN(raw)) {
data[4 * packIndex] = raw & 0x000000ff;
data[4 * packIndex + 1] = (raw >>> 8) & 0x000000ff;
data[4 * packIndex + 2] = (raw >>> 16) & 0x000000ff;
data[4 * packIndex + 3] = (raw >>> 24) & 0x000000ff;
Avoid deeply nested control flow statements. Open
for (let j = 0; j < -n + 1 && outIndex < frameSize; ++j) {
out[outIndex * 2 + highByte] = value;
outIndex++;
}