Showing 218 of 386 total issues
File iterator.js
has 462 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {Index} from '../math/index';
import {Point2D} from '../math/point';
// doc imports
/* eslint-disable no-unused-vars */
Function parseTilePackets
has 176 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parseTilePackets(context, data, offset, dataLength) {
var position = 0;
var buffer, bufferSize = 0, skipNextBit = false;
function readBits(count) {
while (bufferSize < count) {
Function decode
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
dwvdecoder.RleDecoder.prototype.decode = function (buffer,
bitsAllocated, isSigned, sliceSize, samplesPerPixel, planarConfiguration) {
// bytes per element
var bpe = bitsAllocated / 8;
- 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 getElementAsString
has 159 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getElementAsString(tag, dicomElement, prefix) {
// default prefix
prefix = prefix || '';
// get tag anme from dictionary
Function UtilClosure
has 150 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Util = PDFJS.Util = (function UtilClosure() {
function Util() {}
var rgbBuf = ['rgb(', 0, ',', 0, ',', 0, ')'];
Function getDecayedDose
has 149 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getDecayedDose(elements) {
let warning = '';
let warn;
// SeriesDate (type1)
Function ArithmeticDecoderClosure
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
var ArithmeticDecoder = (function ArithmeticDecoderClosure() {
// Table C-2
var QeTable = [
{qe: 0x5601, nmps: 1, nlps: 1, switchFlag: 1},
{qe: 0x3401, nmps: 2, nlps: 6, switchFlag: 0},
- 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 quantizeAndInverse
has 143 lines of code (exceeds 25 allowed). Consider refactoring. Open
function quantizeAndInverse(component, blockBufferOffset, p) {
var qt = component.quantizationTable, blockData = component.blockData;
var v0, v1, v2, v3, v4, v5, v6, v7;
var p0, p1, p2, p3, p4, p5, p6, p7;
var t;
Function decodeKeyValueUri
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
export function decodeKeyValueUri(uri, replaceMode) {
const result = [];
// repeat key replace mode (default to keep key)
let repeatKeyReplaceMode = 'key';
- 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 getElementValueAsString
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
function getElementValueAsString(tag, dicomElement, pretty) {
let str = '';
const strLenLimit = 65;
// dafault to pretty output
- 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 ArithmeticDecoderClosure
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
var ArithmeticDecoder = (function ArithmeticDecoderClosure() {
// Table C-2
var QeTable = [
{qe: 0x5601, nmps: 1, nlps: 1, switchFlag: 1},
{qe: 0x3401, nmps: 2, nlps: 6, switchFlag: 0},
Function getDecayedDose
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
function getDecayedDose(elements) {
let warning = '';
let warn;
// SeriesDate (type1)
- 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 getSliceIterator
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
export function getSliceIterator(
image, position, isRescaled, viewOrientation) {
const size = image.getGeometry().getSize();
// zero-ify non direction index
let dirMax2Index = 2;
- 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 getSegmentFrameInfo
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
export function getSegmentFrameInfo(dataElements) {
// Derivation Image Sequence
const derivationImages = [];
if (typeof dataElements[TagKeys.DerivationImageSequence] !== 'undefined') {
const derivationImageSq =
- 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 UtilClosure
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
var Util = PDFJS.Util = (function UtilClosure() {
function Util() {}
var rgbBuf = ['rgb(', 0, ',', 0, ',', 0, ')'];
- 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 getShapeFromScoord
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
export function getShapeFromScoord(scoord) {
// extract points
const dataLength = scoord.graphicData.length;
if (dataLength % 2 !== 0) {
throw new Error('Expecting even number of coordinates in scroord data');
- 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 mergeObjects
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function mergeObjects(obj1, obj2, idKey, valueKey) {
const res = {};
// check id key
if (!idKey) {
throw new Error('Cannot merge object with an undefined id key: ' + idKey);
Function 5
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./component-spec.js":1,"./data-stream.js":2}],5:[function(require,module,exports){
/*
* Copyright (C) 2015 Michael Martinez
* Changes: Added support for selection values 2-7, fixed minor bugs &
* warnings, split into multiple class files, and general clean up.
Function transformComponents
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
function transformComponents(context) {
var siz = context.SIZ;
var components = context.components;
var componentsCount = siz.Csiz;
var resultImages = [];
Function buildPackets
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildPackets(context) {
var siz = context.SIZ;
var tileIndex = context.currentTile.index;
var tile = context.tiles[tileIndex];
var componentsCount = siz.Csiz;