Showing 209 of 399 total issues
Function JpxImage_nextPacket
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.nextPacket = function JpxImage_nextPacket() {
// Section B.12.1.5 Component-position-resolution-layer
for (; c < componentsCount; ++c) {
var component = tile.components[c];
var precinctsIterationSizes = precinctsSizes.components[c];
Function BitModel_setNeighborsSignificance
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function BitModel_setNeighborsSignificance(row, column, index) {
var neighborsSignificance = this.neighborsSignificance;
var width = this.width, height = this.height;
var left = (column > 0);
var right = (column + 1 < width);
Function JpxImage_nextPacket
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.nextPacket = function JpxImage_nextPacket() {
// Section B.12.1.4 Position-component-resolution-layer
for (; py < precinctsIterationSizes.maxNumHigh; py++) {
for (; px < precinctsIterationSizes.maxNumWide; px++) {
for (; c < componentsCount; c++) {
Function getVectorStringLPS
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function getVectorStringLPS(vector) {
let abs = new Vector3D(
Math.abs(vector.getX()),
Math.abs(vector.getY()),
Math.abs(vector.getZ())
- 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 combineUrl
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function combineUrl(baseUrl, url) {
if (!url) {
return baseUrl;
}
if (/^[a-z][a-z0-9+\-.]*:/i.test(url)) {
- 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 splitKeyValueString
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function splitKeyValueString(inputStr) {
// result
const result = {};
// check input string
if (inputStr) {
- 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 update
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
update(anchor, style, _viewController) {
// parent group
const group = anchor.getParent();
// associated shape
const kroi = group.getChildren(function (node) {
Function getVectorStringLPS
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getVectorStringLPS(vector) {
let abs = new Vector3D(
Math.abs(vector.getX()),
Math.abs(vector.getY()),
Math.abs(vector.getZ())
Function update
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
update(anchor, style, _viewController) {
// parent group
const group = anchor.getParent();
// associated shape
const kline = group.getChildren(function (node) {
Function buildHuffTable
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
jpeg.lossless.HuffmanTable.prototype.buildHuffTable = function(tab, L, V) {
/*jslint bitwise: true */
var currentTable, temp, k, i, j, n;
temp = 256;
Function getViewFromDOMImage
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getViewFromDOMImage(domImage, origin, index) {
// image size
const width = domImage.width;
const height = domImage.height;
Function rangeRegions
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function rangeRegions(
dataAccessor, start, end, increment, regions) {
let nextIndex = start;
let regionCount = 0;
let regionElementCount = 0;
Function dcmdump
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function dcmdump(dicomElements) {
const keys = Object.keys(dicomElements);
let result = '\n';
result += '# Dicom-File-Format\n';
result += '\n';
Function isEqualSegment
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function isEqualSegment(seg1, seg2) {
// basics
if (typeof seg1 === 'undefined' ||
typeof seg2 === 'undefined' ||
seg1 === null ||
Function buildHuffmanTable
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildHuffmanTable(codeLengths, values) {
var k = 0, code = [], i, j, length = 16;
while (length > 0 && !codeLengths[length - 1]) {
length--;
}
Function read
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
jpeg.lossless.ScanHeader.prototype.read = function(data) {
/*jslint bitwise: true */
var count = 0, length, i, temp;
Function getData
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
getData: function getData(width, height, forceRGBoutput) {
if (this.numComponents > 4) {
throw 'Unsupported color mode';
}
// type of data: Uint8Array(width * height * numComponents)
Function range3d
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
export function range3d(dataAccessor, start, maxIter, increment,
blockMaxIter, blockIncrement, reverse1, reverse2, isPlanar) {
Function decodeScan
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
function decodeScan(data, offset, frame, components, resetInterval,
spectralStart, spectralEnd, successivePrev, successive) {
Function create
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
create(dataElements, image) {
// view
const view = new View(image);
// default color map