Showing 271 of 665 total issues
Function _decompressUncompressed
has 34 lines of code (exceeds 25 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()) {
Function constructor
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(
stack,
index = 0,
position = new three.Vector3(0, 0, 0),
direction = new three.Vector3(0, 0, 1),
Function _decompressUncompressed
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;
Function decode8Planar
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
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);
Function decode8
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function decode8(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);
Function constructor
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(targetMesh, controls, params = {}) {
super(targetMesh, controls, params);
this._widgetType = 'Annotation';
Function constructor
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(targetMesh, controls, params = {}) {
super(targetMesh, controls, params);
this._widgetType = 'Rectangle';
Function onEnd
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
onEnd() {
this._handles[0].onEnd(); // First Handle
if (
(this._handles[1].tracking &&
Consider simplifying this complex logical expression. Open
Open
if (
this._stackID === stack.stackID &&
this._numberOfFrames === 1 &&
stack._numberOfFrames === 1 &&
this._frame[0].columns === stack.frame[0].columns &&
Consider simplifying this complex logical expression. Open
Open
if (
!(
super.validate(model) &&
typeof model.mergeSeries === 'function' &&
model.hasOwnProperty('_seriesInstanceUID') &&
Function _reorderData
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_reorderData() {
let numberOfChannels = this.numberOfChannels();
let numPixels = this.rows() * this.columns() * numberOfChannels;
let buffer = this._niftiImage;
Function _decodePixelData
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_decodePixelData(frameIndex = 0) {
// if compressed..?
let transferSyntaxUID = this.transferSyntaxUID();
// find compression scheme
Function onEnd
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
onEnd() {
this._handles[0].onEnd();
this._handles[2].onEnd();
this._handles[3].onEnd();
Function orderIntersections
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static orderIntersections(points, direction) {
let reference = this.centerOfMass(points);
// direction from first point to reference
let referenceDirection = new Vector3(
points[0].x - reference.x,
Function updateDOM
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
updateDOM() {
this.updateDOMColor();
// update line
const lineData = this.getLineData(
Function constructor
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor() {
super();
this._sopInstanceUID = null;
this._url = null;
Function updateDOMContent
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
updateDOMContent(clear) {
const vMaxContainer = this._label.querySelector('.vmax');
const vMeanContainer = this._label.querySelector('.vmean');
const gMaxContainer = this._label.querySelector('.gmax');
const gMeanContainer = this._label.querySelector('.gmean');
Function constructor
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(targetMesh, controls, params = {}) {
super(targetMesh, controls, params);
this._widgetType = 'PeakVelocity';
Function constructor
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(targetMesh, controls, params = {}) {
super(targetMesh, controls, params);
this._widgetType = 'Angle';
Function merge
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
merge(series) {
if (!this.validate(series)) {
return false;
}
- 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"