Showing 209 of 401 total issues
Avoid deeply nested control flow statements. Open
Open
if (dirMax0.index === 0) {
// xzy
rangeObj = getRange(dataAccessor,
start, maxIter, 1, ncols, sliceSize, reverse1, reverse2);
} else {
Avoid deeply nested control flow statements. Open
Open
if (gotOneArg) {
baseUrl += '&';
}
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 decode
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
dwvdecoder.RleDecoder.prototype.decode = function (buffer,
bitsAllocated, isSigned, sliceSize, samplesPerPixel, planarConfiguration) {
Function rangeRegion
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
dataAccessor, start, end, increment, regionSize, regionOffset) {
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
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) {
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 (sign[position] !== 0) {
n = -n;
}
Avoid deeply nested control flow statements. Open
Open
for (pos = c, j = 0, jj = items.length; j < jj; j++) {
val = items[j];
out[pos] = val <= min ? 0 :
val >= max ? 255 : (val + offset) >> shift;
pos += componentsCount;
Avoid deeply nested control flow statements. Open
Open
if (k === null) {
continue;
}
Avoid deeply nested control flow statements. Open
Open
for (pos = c, j = 0, jj = items.length; j < jj; j++) {
val = items[j];
out[pos] = (val + offset);
pos += componentsCount;
}
Avoid deeply nested control flow statements. Open
Open
for (b = 0; b < numBuffers; b++) {
items[k + b] = colBuffers[b][l];
}
Avoid deeply nested control flow statements. Open
Open
if (reversible && (nb >= mb)) {
coefficients[pos] = n;
} else {
coefficients[pos] = n * (1 << (mb - nb));
}
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
for (j = 0; j < v; j++) {
for (k = 0; k < h; k++) {
decodeMcu(component, decodeFn, mcu, j, k);
}
}
Avoid deeply nested control flow statements. Open
Open
if (k === null) {
continue;
}
Avoid deeply nested control flow statements. Open
Open
for (; l < layersCount;) {
var packet = createPacket(resolution, k, l);
l++;
return packet;
}
Avoid deeply nested control flow statements. Open
Open
for (; l < layersCount;) {
var packet = createPacket(resolution, k, l);
l++;
return packet;
}
Avoid deeply nested control flow statements. Open
Open
for (j = 0; j < 64; j++) {
z = dctZigZag[j];
tableData[z] = data[offset++];
}