Showing 271 of 665 total issues
Consider simplifying this complex logical expression. Open
Open
} else if (
this._frame[0].imagePosition &&
this._frame[0].imageOrientation &&
this._frame[1] &&
this._frame[1].imagePosition &&
Consider simplifying this complex logical expression. Open
Open
if (
(vMaxIndex === 2 && verticalDirection.getComponent(vMaxIndex) < 0) ||
(vMaxIndex === 1 && verticalDirection.getComponent(vMaxIndex) > 0) ||
(vMaxIndex === 0 && verticalDirection.getComponent(vMaxIndex) > 0)
) {
Consider simplifying this complex logical expression. Open
Open
if (
index.x >= 0 &&
index.y >= 0 &&
index.z >= 0 &&
index.x < dimensions.x &&
Consider simplifying this complex logical expression. Open
Open
if (
!(
objectToTest !== null &&
typeof objectToTest !== 'undefined' &&
objectToTest.hasOwnProperty('x') &&
Consider simplifying this complex logical expression. Open
Open
if (
!(
objectToTest !== null &&
typeof objectToTest !== 'undefined' &&
objectToTest.hasOwnProperty('position') &&
Function _decodePixelData
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
_decodePixelData(frameIndex = 0) {
// if compressed..?
let transferSyntaxUID = this.transferSyntaxUID();
// find compression scheme
- 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 pixelSpacing
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
pixelSpacing(frameIndex = 0) {
// expect frame index to start at 0!
let pixelSpacing = this._findStringEverywhere('x00289110', 'x00280030', frameIndex);
if (pixelSpacing === 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 too many return
statements within this function. Open
Open
return newArray;
Avoid too many return
statements within this function. Open
Open
return new Int32Array(buffer, frameOffset, numPixels);
Avoid too many return
statements within this function. Open
Open
return data;
Avoid too many return
statements within this function. Open
Open
return this._decodeUncompressed(frameIndex);
Avoid too many return
statements within this function. Open
Open
return new Float32Array(buffer, frameOffset, numPixels);
Avoid too many return
statements within this function. Open
Open
return new Int32Array(buffer, frameOffset, numPixels);
Avoid too many return
statements within this function. Open
Open
return new Int16Array(buffer, frameOffset, numPixels);
Avoid too many return
statements within this function. Open
Open
return new Int32Array(buffer, frameOffset, numPixels);
Avoid too many return
statements within this function. Open
Open
return this._swapFrame(frame);
Avoid too many return
statements within this function. Open
Open
return new Float32Array(buffer, frameOffset, numPixels);
Avoid too many return
statements within this function. Open
Open
return new Uint32Array(buffer, frameOffset, numPixels);
Avoid too many return
statements within this function. Open
Open
return new Uint32Array(buffer, frameOffset, numPixels);
Avoid too many return
statements within this function. Open
Open
return true;