File orbit-control.class.ts
has 576 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { EventDispatcher, OrthographicCamera, PerspectiveCamera, Quaternion, Spherical, Vector2, Vector3 } from 'three';
const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 };
// This set of controls performs orbiting, dollying (zooming), and panning.
OrbitControls
has 51 functions (exceeds 20 allowed). Consider refactoring. Open
export class OrbitControls extends EventDispatcher {
static STATE = { NONE: -1, ROTATE: 0, DOLLY: 1, PAN: 2, TOUCH_ROTATE: 3, TOUCH_DOLLY_PAN: 4 };
constructor(public object: PerspectiveCamera | OrthographicCamera, private domElement: HTMLCanvasElement) {
super();
Function onMouseDown
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
static onMouseDown(scope: OrbitControls) {
return function _onMouseDown(event) {
if (scope.enabled === false) {
return;
}
- 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 onTouchMove
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
static onTouchMove(scope: OrbitControls) {
return function _onTouchMove(event) {
if (scope.enabled === false) {
return;
}
- 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 onMouseDown
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
static onMouseDown(scope: OrbitControls) {
return function _onMouseDown(event) {
if (scope.enabled === false) {
return;
}
Function _onMouseDown
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function _onMouseDown(event) {
if (scope.enabled === false) {
return;
}
Function update
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
update() {
const position = this.object.position;
this._updateOffset.copy(position).sub(this.target);
Function onTouchStart
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
static onTouchStart(scope: OrbitControls) {
return function _onTouchStart(event) {
if (scope.enabled === false) {
return;
}
- 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 onMouseMove
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
static onMouseMove(scope: OrbitControls) {
return function _onMouseMove(event) {
if (scope.enabled === false) {
return;
}
- 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 onTouchMove
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
static onTouchMove(scope: OrbitControls) {
return function _onTouchMove(event) {
if (scope.enabled === false) {
return;
}
Function onTouchStart
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
static onTouchStart(scope: OrbitControls) {
return function _onTouchStart(event) {
if (scope.enabled === false) {
return;
}
Function _onTouchMove
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function _onTouchMove(event) {
if (scope.enabled === false) {
return;
}
Function onMouseMove
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
static onMouseMove(scope: OrbitControls) {
return function _onMouseMove(event) {
if (scope.enabled === false) {
return;
}
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
return;