Showing 218 of 386 total issues
Function decodeACSuccessive
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
function decodeACSuccessive(component, offset) {
var k = spectralStart;
var e = spectralEnd;
var r = 0;
var s;
Function parseMultipart
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export function parseMultipart(arr) {
const u8Array = new Uint8Array(arr);
const parts = [];
// check input
- 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 getDicomSRContentItem
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getDicomSRContentItem(content) {
// dicom item (tags are in ~group/element order)
let contentItem = {};
if (typeof content.relationshipType !== 'undefined') {
Function getPrecinctSizesInImageScale
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getPrecinctSizesInImageScale(tile) {
var componentsCount = tile.components.length;
var minWidth = Number.MAX_VALUE;
var minHeight = Number.MAX_VALUE;
var maxNumWide = 0;
Function getSRContent
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export function getSRContent(dataElements) {
// valueType -> ValueType (type1)
let valueType = '';
if (typeof dataElements[TagKeys.ValueType] !== 'undefined') {
valueType = dataElements[TagKeys.ValueType].value[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 MessageHandler
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function MessageHandler(name, comObj) {
this.name = name;
this.comObj = comObj;
this.callbackIndex = 1;
this.postMessageTransfers = true;
- 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 getDicomSRContentItem
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export function getDicomSRContentItem(content) {
// dicom item (tags are in ~group/element order)
let contentItem = {};
if (typeof content.relationshipType !== 'undefined') {
- 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 StatTimerClosure
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
var StatTimer = (function StatTimerClosure() {
function rpad(str, pad, length) {
while (str.length < length) {
str += pad;
}
- 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 range3d
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function range3d(dataAccessor, start, maxIter, increment,
blockMaxIter, blockIncrement, reverse1, reverse2, isPlanar) {
const iters = [];
if (isPlanar) {
iters.push(range(
Function MessageHandler
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
function MessageHandler(name, comObj) {
this.name = name;
this.comObj = comObj;
this.callbackIndex = 1;
this.postMessageTransfers = true;
Function StatTimerClosure
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
var StatTimer = (function StatTimerClosure() {
function rpad(str, pad, length) {
while (str.length < length) {
str += pad;
}
Function TagTreeClosure
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
var TagTree = (function TagTreeClosure() {
function TagTree(width, height) {
var levelsLength = log2(Math.max(width, height)) + 1;
this.levels = [];
for (var i = 0; i < levelsLength; i++) {
File dicomCode.js
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
// doc imports
/* eslint-disable no-unused-vars */
import {DataElement} from './dataElement';
/* eslint-enable no-unused-vars */
Function getDicomSegmentFrameInfoItem
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getDicomSegmentFrameInfoItem(frameInfo) {
const item = {
FrameContentSequence: {
value: [
{
Function ResolutionPositionComponentLayerIterator
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ResolutionPositionComponentLayerIterator(context) {
var siz = context.SIZ;
var tileIndex = context.currentTile.index;
var tile = context.tiles[tileIndex];
var layersCount = tile.codingStyleDefaultParameters.layersCount;
Function getVariableRegionSliceIterator
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getVariableRegionSliceIterator(
image, index, isRescaled, regions) {
if (image.getNumberOfComponents() !== 1) {
throw new Error('Unsupported number of components for region iterator: ' +
image.getNumberOfComponents());
Function transformTile
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function transformTile(context, tile, c) {
var component = tile.components[c];
var codingStyleParameters = component.codingStyleParameters;
var quantizationParameters = component.quantizationParameters;
var decompositionLevelsCount =
Function decodeKeyValueUri
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function decodeKeyValueUri(uri, replaceMode) {
const result = [];
// repeat key replace mode (default to keep key)
let repeatKeyReplaceMode = 'key';
Function PageViewport
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function PageViewport(viewBox, scale, rotation, offsetX, offsetY, dontFlip) {
this.viewBox = viewBox;
this.scale = scale;
this.rotation = rotation;
this.offsetX = offsetX;
Function 4
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./data-stream.js":2,"./frame-header.js":4,"./huffman-table.js":5,"./quantization-table.js":7,"./scan-header.js":9,"./utils.js":10}],4:[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.