Showing 128 of 146 total issues
Function PEhandler
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
handler: function PEhandler(ev) {
const store = this.store;
let removePointer = false;
const eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');
- 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 teardown
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
.subscribe(c => {
for (let i = Math.min(this.c, c); i < Math.max(this.c, c); i++) {
if (c < this.c) {
try {
this.viewContainer.detach();
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 ngOnInit
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public ngOnInit(): void {
this.teardown = this.onResizeSubject.subscribe($event => {
const w = ($event as any).target.innerWidth;
const h = ($event as any).target.innerHeight;
this.storeFacade.setMediaLarge(w / h >= 1.8); // Standard 16/9 ratio is 1.77 repeating.
Function shift
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
@HostListener('panstart', ['$event'])
@HostListener('panleft', ['$event'])
@HostListener('panright', ['$event'])
@HostListener('panup', ['$event'])
@HostListener('pandown', ['$event'])
- 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 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function _onTouchMove(event) {
if (scope.enabled === false) {
return;
}
Function tweenOperation
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function tweenOperation(source: Observable<Tweenable<T>>): Observable<T> {
const innerSubject = new BehaviorSubject<T>(undefined);
let lastTween: Tween;
if (pingpongAfterFinish) {
pingpongInterrupt = true;
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 exports
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: plugins,
Function newProperties
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
newProperties: this.formBuilder.array([], (ctrl: FormArray) => {
const dups = new Map<string, Array<FormGroup>>();
if (this.properties) {
this.properties.controls.forEach((propctrl: FormGroup) => {
const key = (propctrl as FormGroup).controls['key'].value;
Function downloadTextures
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public downloadTextures(): void {
this.databaseService.database$
.pipe(
take(1),
switchMap(db => db.lore.find().$.pipe(take(1))),
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;
}
Function click
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public click(coord: Vector2, shift: boolean) {
this.control.enabled = true;
this.raycaster.setFromCamera(coord, this.stage.camera);
const intersection = this.raycaster
.intersectObject(this.globe, true)
- 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 surroundAndSpeed
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public surroundAndSpeed(
node: Node<UnixWrapper, ActorDelta>
): { prev: Node<UnixWrapper, ActorDelta>; next: Node<UnixWrapper, ActorDelta>; speed: number } {
let prevNodeNow: Node<UnixWrapper, ActorDelta>;
let nextNodeNow: Node<UnixWrapper, ActorDelta>;
- 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 constructor
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public constructor(
public dialogRef: MatDialogRef<ActorFormComponent>,
@Inject(MAT_DIALOG_DATA) public originalData: Accumulator,
private formBuilder: FormBuilder,
private actorService: ActorService,
- 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
Avoid deeply nested control flow statements. Open
if (value) {
if (value === FORGET_TOKEN) {
if (!prop.value.startsWith(FORGET_TOKEN)) {
prop.value = `${FORGET_TOKEN}.${prop.value}`;
}
Avoid deeply nested control flow statements. Open
if (value !== undefined && prop.nextAppearance === undefined) {
prop.nextValue = value;
prop.nextAppearance = node;
}
Function create
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static create(formBuilder: FormBuilder): FormGroup {
return formBuilder.group({
key: [
'',
[
- 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 ngOnInit
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public ngOnInit(): void {
this.teardown = this.onResizeSubject.subscribe($event => {
const w = ($event as any).target.innerWidth;
const h = ($event as any).target.innerHeight;
this.storeFacade.setMediaLarge(w / h >= 1.8); // Standard 16/9 ratio is 1.77 repeating.
- 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 serializeActor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function serializeActor(actor: Actor): Actor {
if (actor !== undefined && actor !== null) {
if (actor._states) {
for (const node of actor._states.nodes()) {
node.key.unix = Math.floor(node.key.unix);
- 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"