Showing 271 of 665 total issues
Function constructor
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(targetMesh, controls, params = {}) {
super(targetMesh, controls, params);
this._widgetType = 'Polygon';
Function free
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
free() {
this.removeEventListeners();
this._handles.forEach(h => {
this.remove(h);
Function onEnd
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
onEnd() {
let numHandles = this._handles.length;
let active = false;
if (
Function updateDOM
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
updateDOM() {
this.updateDOMColor();
// update line
const lineData = this.getLineData(
Function _vector2Label
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_vector2Label(direction) {
const index = this._getMaxIndex(direction);
// set vector max value to 1
const scaledDirection = direction
.clone()
Function constructor
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(left, right, top, bottom, near, far) {
super(left, right, top, bottom, near, far);
this._front = null;
this._back = null;
Function orderFrames
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
orderFrames() {
// order the frames based on theirs dimension indices
// first index is the most important.
// 1,1,1,1 will be first
// 1,1,2,1 will be next
Function initCoordinates
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
initCoordinates(first, second, third, fourth) {
const intersectR = new three.Vector3();
const intersectS = new three.Vector3();
const ray = new three.Ray(first);
Function finalize
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
finalize() {
if (this._initialized) {
// remove old axis handles
this._handles.splice(-2).forEach(elem => {
this.remove(elem);
Function onEnd
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
onEnd() {
if (this._handles.length < 3) {
return;
}
Function constructor
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(targetMesh, controls, params = {}) {
super(targetMesh, controls, params);
this._widgetType = 'Ruler';
Function constructor
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(targetMesh, controls, params = {}) {
super(targetMesh, controls, params);
this._widgetType = 'Freehand';
Function constructor
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(targetMesh, controls, params = {}) {
super(targetMesh, controls, params);
this._widgetType = 'BiRuler';
Function constructor
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(targetMesh, controls, params = {}) {
super(targetMesh, controls, params);
this._widgetType = 'Handle';
Function load
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
load() {
if (this.file) {
// instantiate the loader
// it loads and parses the dicom image
const loader = new LoadersVolume(this._progressbarContainer);
Function validateAabb
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static validateAabb(aabb) {
//
if (aabb === null) {
window.console.log('Invalid aabb.');
window.console.log(aabb);
Function updateValues
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
updateValues() {
const usPosition0 = this.getUsPoint(
this._regions,
CoreUtils.worldToData(this._params.lps2IJK, this._handles[0].worldPosition)
);
Function free
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
free() {
this.removeEventListeners();
this._handles.forEach(h => {
this.remove(h);
Function _parser
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_parser(extension) {
let Parser = null;
switch (extension.toUpperCase()) {
case 'NII':
Function instanceNumber
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
instanceNumber(frameIndex = 0) {
let instanceNumber = null;
// first look for frame!
// per frame functionnal group sequence
let perFrameFunctionnalGroupSequence = this._dataSet.elements.x52009230;
- 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"