src/models/models.frame.js
ModelsFrame
has 71 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default class ModelsFrame extends ModelsBase {
/**
* Constructor
*/
constructor() {
File models.frame.js
has 374 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/** * Imports ***/
import ModelsBase from '../models/models.base';
import { Vector3 } from 'three/src/math/Vector3';
Function _frameToCanvas
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
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 _frameToCanvas
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_frameToCanvas() {
const dimension = this._columns * this._rows;
const params = {
invert: this._invert,
Function constructor
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor() {
super();
this._sopInstanceUID = null;
this._url = null;
Function cosines
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
cosines() {
let cosines = [new Vector3(1, 0, 0), new Vector3(0, 1, 0), new Vector3(0, 0, 1)];
if (this._imageOrientation && this._imageOrientation.length === 6) {
let xCos = new Vector3(
Consider simplifying this complex logical expression. Open
Open
if (
!(
super.validate(model) &&
typeof model.cosines === 'function' &&
typeof model.spacingXY === 'function' &&
Function _pixelTo8Bit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
_pixelTo8Bit(value, params) {
// values equal to pixelPaddingValue are outside of the image and should be ignored
let packedValue = value <= params.min || value === params.padding ? 0 : 255;
if (value > params.min && value < params.max) {
- 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"