Showing 271 of 665 total issues
Function parse
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
parse: function(data) {
let littleEndian = this.littleEndian();
let reader = new DataView(data);
let offset = 0;
let surfDesc = 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 _convertColorSpace
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
_convertColorSpace(uncompressedData) {
let rgbData = null;
let photometricInterpretation = this.photometricInterpretation();
let planarConfiguration = this.planarConfiguration();
if (planarConfiguration === null) {
Function updateDOMContent
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateDOMContent(clear) {
const meanSDContainer = this._label.querySelector('.mean-sd');
const maxMinContainer = this._label.querySelector('.max-min');
const areaContainer = this._label.querySelector('.area');
Function updateDOMContent
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateDOMContent(clear) {
const meanSDContainer = this._label.querySelector('.mean-sd');
const maxMinContainer = this._label.querySelector('.max-min');
const areaContainer = this._label.querySelector('.area');
Function main
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
main() {
// need to pre-call main to fill up the functions list
this._main = `
void intersectionProjection(
in vec4 plane,
Function parseFrame
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseFrame(series, stack, url, i, dataParser, resolve, reject) {
let frame = new ModelsFrame();
frame.sopInstanceUID = dataParser.sopInstanceUID(i);
frame.url = url;
frame.index = i;
File loaders.trk.js
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
THREE.TRKLoader = function() {};
Object.assign(THREE.TRKLoader.prototype, THREE.EventDispatcher.prototype, {
Function updateDOM
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateDOM() {
this.updateDOMColor();
const regions = this._stack.frame[this._params.frameIndex].ultrasoundRegions || [];
ParsersNifti
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
export default class ParsersNifti extends ParsersVolume {
constructor(data, id) {
super();
/**
Function helpersLocalizer
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
const helpersLocalizer = (three = window.THREE) => {
if (three === undefined || three.Object3D === undefined) {
return null;
}
- 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 decode8Planar
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function decode8Planar(imageFrame, pixelData) {
const frameData = pixelData;
const frameSize = imageFrame.rows * imageFrame.columns;
const outFrame = new ArrayBuffer(frameSize * imageFrame.samplesPerPixel);
const header = new DataView(frameData.buffer, frameData.byteOffset);
- 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 main
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
main() {
// need to pre-call main to fill up the functions list
this._main = `
void getIntensity(in vec3 dataCoordinates, out float intensity, out vec3 gradient){
Function updateValues
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateValues() {
const region = this._regions[
this.getRegionByXY(
this._regions,
CoreUtils.worldToData(this._params.lps2IJK, this._handles[0]._worldPosition)
Function _decompressUncompressed
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
_decompressUncompressed(frameIndex = 0) {
// papaya.volume.nifti.NIFTI_TYPE_UINT8 = 2;
// papaya.volume.nifti.NIFTI_TYPE_INT16 = 4;
// papaya.volume.nifti.NIFTI_TYPE_INT32 = 8;
// papaya.volume.nifti.NIFTI_TYPE_FLOAT32 = 16;
- 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 _create
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
_create() {
if (!this._stack || !this._stack.prepared || !this._stack.packed) {
return;
}
Function paintCanvas
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
paintCanvas() {
// setup context
let ctx = this._canvas.getContext('2d');
ctx.clearRect(0, 0, this._canvas.width, this._canvas.height);
ctx.globalCompositeOperation = 'source-over';
Function getRoI
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
static getRoI(mesh, camera, stack) {
mesh.geometry.computeBoundingBox();
const bbox = new Box3().setFromObject(mesh);
const min = bbox.min.clone().project(camera);
Function load
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
load: function(url, onLoad, onProgress, onError) {
window.console.log(url, onLoad, onProgress, onError);
let scope = this;
let xhr = new XMLHttpRequest();
Function code
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
static get code() {
return `
.widgets-handle {
position: absolute;
border: 1px solid;
Function load
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
load: function(url, onLoad, onProgress, onError) {
let scope = this;
let xhr = new XMLHttpRequest();
function onloaded(event) {