Showing 271 of 665 total issues
Function _frameToCanvas
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
_frameToCanvas() {
const dimension = this._columns * this._rows;
const params = {
invert: this._invert,
- 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 uniforms
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
static uniforms() {
return {
uCanvasWidth: {
type: 'f',
value: 0,
Function _frameToCanvas
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
_frameToCanvas() {
const dimension = this._columns * this._rows;
const params = {
invert: this._invert,
Function prepare
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
prepare() {
// if segmentation, merge some frames...
if (this._modality === 'SEG') {
this.prepareSegmentation();
}
Function onMove
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
onMove(evt) {
if (this.active) {
const prevPosition = this._moveHandle.worldPosition.clone();
this._moveHandle.onMove(evt, true);
Function prepareSegmentation
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
prepareSegmentation() {
// store frame and do special pre-processing
this._frameSegment = this._frame;
let mergedFrames = [];
Function helpersMaterialMixin
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
const helpersMaterialMixin = (three = window.THREE) => {
if (three === undefined || three.Object3D === undefined) {
return null;
}
Function constructor
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor() {
super();
this._uid = null;
this._stackID = -1;
Function updateMesh
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateMesh() {
if (this._mesh) {
this.remove(this._mesh);
}
Function updateMesh
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateMesh() {
if (this._mesh) {
this.remove(this._mesh);
}
Function geometriesSlice
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
const geometriesSlice = (three = window.THREE) => {
if (three === undefined || three.ShapeBufferGeometry === undefined) {
return null;
}
Function helpersBorder
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const helpersBorder = (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 getRoI
has a Cognitive Complexity of 14 (exceeds 5 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);
- 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 constructor
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(targetMesh, controls, params = {}) {
super(targetMesh, controls, params);
this._widgetType = 'PressureHalfTime';
Function geometriesVoxel
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
const geometriesVoxel = (three = window.THREE) => {
if (three === undefined || three.BoxGeometry === undefined) {
return null;
}
Function uniforms
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
static uniforms() {
return {
uTextureBackTest0: {
type: 't',
value: [],
Consider simplifying this complex logical expression. Open
if (
!(
objectToTest !== null &&
typeof objectToTest !== 'undefined' &&
objectToTest.hasOwnProperty('center') &&
Function constructor
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(targetMesh, controls, params = {}) {
super(targetMesh, controls, params);
this._widgetType = 'VelocityTimeIntegral';
Function computeDefinition
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
computeDefinition() {
let content = `
step( abs( textureIndexF - 0.0 ), 0.0 ) * texture2D(uTextureContainer[0], uv) +
step( abs( textureIndexF - 1.0 ), 0.0 ) * texture2D(uTextureContainer[1], uv) +
step( abs( textureIndexF - 2.0 ), 0.0 ) * texture2D(uTextureContainer[2], uv) +
Function onMove
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
onMove(evt) {
let hovered = false;
if (this.active) {
this._dragged = true;