Showing 218 of 386 total issues
Function getViewFromDOMVideo
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
video, onloaditem, onload, onprogress, onloadend,
origin, dataIndex) {
Avoid deeply nested control flow statements. Open
Open
if (typeof sourceImageSq[j][TagKeys.ReferencedSOPInstanceUID] !==
'undefined') {
sourceImage.referencedSOPInstanceUID =
sourceImageSq[j][TagKeys.ReferencedSOPInstanceUID].value[0];
}
Function getDefaultImage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
width, height, sliceIndex,
imageBuffer, numberOfFrames,
imageUid) {
Avoid deeply nested control flow statements. Open
Open
if (typeof sourceImageSq[j][TagKeys.ReferencedSOPClassUID] !==
'undefined') {
sourceImage.referencedSOPClassUID =
sourceImageSq[j][TagKeys.ReferencedSOPClassUID].value[0];
}
Avoid deeply nested control flow statements. Open
Open
if (Array.isArray(subValue1)) {
// merged object with repeated value
// copy it with the index list
value[valueKey] = {};
for (let j = 0; j < id1.length; ++j) {
Avoid deeply nested control flow statements. Open
Open
if (typeof value[valueKey] === 'undefined') {
value[valueKey] = {};
}
Function decode
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
dwvdecoder.RleDecoder.prototype.decode = function (buffer,
bitsAllocated, isSigned, sliceSize, samplesPerPixel, planarConfiguration) {
Avoid deeply nested control flow statements. Open
Open
if (dirMax0.index === 0) {
// xzy
rangeObj = getRange(dataAccessor,
start, maxIter, 1, ncols, sliceSize, reverse1, reverse2);
} else {
Function getDicomSegmentItem
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
export function getDicomSegmentItem(segment) {
let algoType = segment.algorithmType;
if (algoType === undefined) {
algoType = 'MANUAL';
}
- 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 getViewFromDOMVideo
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
export function getViewFromDOMVideo(
video, onloaditem, onload, onprogress, onloadend,
origin, dataIndex) {
// video size
const width = video.videoWidth;
- 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
Open
for (var j = 0; j < -count + 1; ++j) {
// store
outputArray[outputIndex] = value;
// increment index
outputIndex += outputIndexIncrement;
Function rangeRegion
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
dataAccessor, start, end, increment, regionSize, regionOffset) {
Avoid deeply nested control flow statements. Open
Open
if (gotOneArg) {
baseUrl += '&';
}
Avoid deeply nested control flow statements. Open
Open
if (!isClosed) {
if (points.length === 2) {
shape = new Line(points[0], points[1]);
} else if (points.length === 3) {
shape = new Protractor([points[0], points[1], points[2]]);
Avoid deeply nested control flow statements. Open
Open
if (dicomElement.vr === 'OB') {
tmp = '00'.substring(0, 2 - tmp.length) + tmp;
} else {
tmp = '0000'.substring(0, 4 - tmp.length) + tmp;
}
Function PageViewport
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function PageViewport(viewBox, scale, rotation, offsetX, offsetY, dontFlip) {
Avoid deeply nested control flow statements. Open
Open
if (readBits(1)) {
valueReady = !zeroBitPlanesTree.nextLevel();
if (valueReady) {
break;
}
Avoid deeply nested control flow statements. Open
Open
for (b = 0; b < numBuffers; b++) {
colBuffers[b][l] = items[k + b];
}
Avoid deeply nested control flow statements. Open
Open
} else if ((quantizationTableSpec >> 4) === 1) { //16 bit
for (j = 0; j < 64; j++) {
z = dctZigZag[j];
tableData[z] = readUint16();
}
Avoid deeply nested control flow statements. Open
Open
if (reversible && (nb >= mb)) {
coefficients[pos] = n;
} else {
coefficients[pos] = n * (1 << (mb - nb));
}