Showing 271 of 665 total issues
Function imageOrientation
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
imageOrientation(frameIndex = 0) {
// http://nifti.nimh.nih.gov/pub/dist/src/niftilib/nifti1.h
// http://nifti.nimh.nih.gov/pub/dist/src/niftilib/nifti1_io.c
if (this._dataSet.qform_code > 0) {
// METHOD 2 (used when qform_code > 0, which should be the "normal" case):
Function updateDOM
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
updateDOM() {
this.updateDOMColor();
// update first line
const lineData = this.getLineData(
Function constructor
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(targetMesh: THREE.Mesh, controls: THREE.OrbitControls, params: WidgetParameter) {
super();
this._widgetType = 'Base';
Function init
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init(xCosine, yCosine, zCosine, controls, box, canvas) {
// DEPRECATION NOTICE
window.console.warn(
`cameras.orthographic.init(...) is deprecated.
Use .cosines, .controls, .box and .canvas instead.`
Function decode16
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function decode16(imageFrame, pixelData) {
const frameData = pixelData;
const frameSize = imageFrame.rows * imageFrame.columns;
const outFrame = new ArrayBuffer(frameSize * imageFrame.samplesPerPixel * 2);
Function onMove
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
onMove(evt) {
let hovered = false;
if (this.active) {
this._dragged = true;
Function constructor
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(halfDimensions, center, position, direction, toAABB = new three.Matrix4()) {
//
// prepare data for the shape!
//
let aabb = {
Function recalculateOrtho
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
recalculateOrtho() {
// called onMove if 2nd or 3rd handle is active
const activeInd = this._handles[2].active ? 2 : 3;
const lines = [];
const intersect = new three.Vector3();
Function onEnd
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
onEnd() {
this._handles[0].onEnd();
this._handles[2].onEnd();
if (
Function constructor
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(targetMesh, controls, params = {}) {
super(targetMesh, controls, params);
this._widgetType = 'CrossRuler';
Function _decompressUncompressed
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
_decompressUncompressed(frameIndex = 0) {
let buffer = this._dataSet.buffer;
const numberOfChannels = this.numberOfChannels();
const numPixels = this.rows(frameIndex) * this.columns(frameIndex) * numberOfChannels;
if (!this.rightHanded()) {
- 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 copy
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var copy = (srcDir, dstDir) => {
var results = [];
var list = fs.readdirSync(srcDir);
var src, dst;
list.forEach(file => {
Function pack
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
pack() {
// Get total number of voxels
const nbVoxels = this._dimensionsIJK.x * this._dimensionsIJK.y * this._dimensionsIJK.z;
// Packing style
Function _prepareMaterial
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_prepareMaterial() {
// uniforms
this._uniforms = ShadersUniform.uniforms();
this._uniforms.uWorldBBox.value = this._stack.worldBoundingBox();
this._uniforms.uTextureSize.value = this._stack.textureSize;
Function free
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
free() {
this.removeEventListeners();
this._handles.forEach(h => {
this.remove(h);
Function free
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
free() {
this.removeEventListeners();
this._handles.forEach(elem => {
this.remove(elem);
Function parseUrl
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static parseUrl(url) {
const parsedUrl = new URL(url, 'http://fix.me');
const data = {
filename: parsedUrl.searchParams.get('filename'),
extension: '',
Function constructor
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(targetMesh, controls, params = {}) {
super(targetMesh, controls, params);
this._widgetType = 'Ellipse';
Function updateDOM
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
updateDOM() {
this.updateDOMColor();
// update line
const lineData = this.getLineData(
Function free
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
free() {
this.removeEventListeners();
this._handles.forEach(h => {
this.remove(h);