Showing 209 of 399 total issues
Function getRegionSliceIterator
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getRegionSliceIterator(
image, index, isRescaled, min, max) {
if (image.getNumberOfComponents() !== 1) {
throw new Error('Unsupported number of components for region iterator: ' +
image.getNumberOfComponents());
Function messageHandlerComObjOnMessage
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
comObj.onmessage = function messageHandlerComObjOnMessage(event) {
var data = event.data;
if (data.isReply) {
var callbackId = data.callbackId;
if (data.callbackId in callbacksCapabilities) {
Function simpleRange3d
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function simpleRange3d(
dataAccessor, start, end, increment, isPlanar) {
if (typeof increment === 'undefined') {
increment = 1;
}
Function getFileListFromDicomDir
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getFileListFromDicomDir(data) {
// parse file
const parser = new DicomParser();
parser.parse(data);
const elements = parser.getDicomElements();
Function getDicomSegmentItem
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getDicomSegmentItem(segment) {
let algoType = segment.algorithmType;
if (algoType === undefined) {
algoType = 'MANUAL';
}
Function 10
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./data-stream.js":2,"./scan-component.js":8}],10:[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 getSegment
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getSegment(dataElements) {
// number -> SegmentNumber (type1)
// label -> SegmentLabel (type1)
// algorithmType -> SegmentAlgorithmType (type1)
const segment = new MaskSegment(
Function getTouchesPositions
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function getTouchesPositions(touches) {
// get the touch offset from all its parents
let offsetLeft = 0;
let offsetTop = 0;
if (touches.length !== 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 checkTag
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function checkTag(element, name, values) {
let warning = '';
if (typeof element === 'undefined') {
warning += ' ' + name + ' is undefined,';
} else if (element.value.length === 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 getVariableRegionSliceIterator
has a Cognitive Complexity of 12 (exceeds 5 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());
- 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 decodeRGB
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
jpeg.lossless.Decoder.prototype.decodeRGB = function (prev, temp, index) {
/*jslint bitwise: true */
var value, actab, dctab, qtab, ctrC, i, k, j;
Function read
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
jpeg.lossless.FrameHeader.prototype.read = function (data) {
/*jslint bitwise: true */
var count = 0, length, i, c, temp;
Function calculateTileGrids
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function calculateTileGrids(context, components) {
var siz = context.SIZ;
// Section B.3 Division into tile and tile-components
var tile, tiles = [];
var numXtiles = Math.ceil((siz.Xsiz - siz.XTOsiz) / siz.XTsiz);
Function buildMultipart
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function buildMultipart(parts, boundary) {
const lineBreak = '\r\n';
// build headers and calculate size
let partsSize = 0;
const headers = [];
Function BitModel_runMagnitudeRefinementPass
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function BitModel_runMagnitudeRefinementPass() {
var decoder = this.decoder;
var width = this.width, height = this.height;
var coefficentsMagnitude = this.coefficentsMagnitude;
var neighborsSignificance = this.neighborsSignificance;
Function LayerResolutionComponentPositionIterator
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function LayerResolutionComponentPositionIterator(context) {
var siz = context.SIZ;
var tileIndex = context.currentTile.index;
var tile = context.tiles[tileIndex];
var layersCount = tile.codingStyleDefaultParameters.layersCount;
Function ResolutionLayerComponentPositionIterator
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ResolutionLayerComponentPositionIterator(context) {
var siz = context.SIZ;
var tileIndex = context.currentTile.index;
var tile = context.tiles[tileIndex];
var layersCount = tile.codingStyleDefaultParameters.layersCount;
Function Uint32ArrayViewClosure
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Uint32ArrayView = (function Uint32ArrayViewClosure() {
function Uint32ArrayView(buffer, length) {
this.buffer = buffer;
this.byteLength = buffer.length;
Function decodeManifest
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function decodeManifest(manifest, nslices) {
const result = [];
// wado url
const wadoElement = manifest.getElementsByTagName('wado_query');
const wadoURL = wadoElement[0].getAttribute('wadoURL');
Function runHandlers
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
runHandlers: function runHandlers() {
var RUN_TIMEOUT = 1; // ms
var timeoutAt = Date.now() + RUN_TIMEOUT;
while (this.handlers.length > 0) {
var handler = this.handlers.shift();