Showing 146 of 146 total issues
LoreEffects
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
@Injectable()
export class LoreEffects {
public constructor(
private actions$: Actions<FeatureActions>,
private store: Store<FeatureState>,
Function importDatabase
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public importDatabase(): void {
this.databaseService.database$
.pipe(
take(1),
switchMap(db =>
Function pan
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
public pan(coord: Vector2, velocity: Vector2, button: number, start: boolean, end: boolean) {
// this.control.enabled = this.interactionMode === 'move';
this.raycaster.setFromCamera(coord, this.stage.camera);
const intersections = this.raycaster.intersectObject(this.globe, true);
const intersectionsFiltered = intersections.filter(i => i.object.type === 'Globe' || i.object.type === 'Point'); // Ignoring arcs
Function actorStateMapper
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static actorStateMapper(actor: RxDocument<Actor> | Actor): RxDocument<Actor> | Actor {
if (actor.states) {
let parsedStates = actor.states;
if (environment.production) {
parsedStates = parsedStates.replace(
- 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 onKeyDown
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
@HostListener('window:keydown', ['$event'])
public onKeyDown($event: KeyboardEvent): void {
if (document.activeElement.tagName !== 'INPUT') {
switch ($event.code) {
case 'Space':
TimelineComponent
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
@Component({
selector: 'app-timeline',
templateUrl: './timeline.component.html',
styleUrls: ['./timeline.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
Function constructor
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public constructor(
private zoomSubject: BehaviorSubject<number>,
public radius: number = 1,
private storeFacade: StoreFacade
) {
Function loreReducer
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function loreReducer(state: LoreState = initialLoreState, action: LoreActions): LoreState {
switch (action.type) {
// initial load
case loadLores.type: {
return { ...state, loading: true };
Function removeKeys
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export function removeKeys<T = {}>(obj: T, keys: Array<string>): T {
let index;
for (const prop in obj) {
// important check that this is objects own property
// not from prototype prop inherited
- 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 createScene
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public createScene(canvas: HTMLCanvasElement): void {
this.renderer = new WebGLRenderer({
canvas: canvas,
alpha: false,
logarithmicDepthBuffer: true,
Function loadDefaultEarth
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public loadDefaultEarth(): void {
this.teardown = this.dialog
.open(ConfirmComponent, {
data: {
title: 'Warning!',
Function constructor
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public constructor(private templateRef: TemplateRef<any>, private viewContainer: ViewContainerRef) {
super();
this.teardown = this.audit
.pipe(
throttleTime(1000 / 60),
- 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 calculateIntersection
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public calculateIntersection(globe: Globe, preLookHelper: Group, isDebugMode: boolean) {
if (this.left.valid && this.right.valid) {
this.normal
.copy(this.left.position)
.cross(this.right.position)
- 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 constructor
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public constructor(
public dialogRef: MatDialogRef<ActorFormComponent>,
@Inject(MAT_DIALOG_DATA) public originalData: Accumulator,
private formBuilder: FormBuilder,
private actorService: ActorService,
Function remove
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public remove(node: Node<UnixWrapper, ActorDelta>, isDisabled: boolean): void {
if (!isDisabled) {
if (!this.isAtMostOneLeft) {
this.dialog
.open(ConfirmComponent)
Function _onMouseDown
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function _onMouseDown(event) {
if (scope.enabled === false) {
return;
}
Function constructor
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(private storeFacade: StoreFacade, private databaseService: DatabaseService) {
this.selection$.subscribe();
this.hover$.subscribe();
this.storeFacade.isDebugMode$.subscribe(isDebugMode => {
Function actorStateMapper
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static actorStateMapper(actor: RxDocument<Actor> | Actor): RxDocument<Actor> | Actor {
if (actor.states) {
let parsedStates = actor.states;
if (environment.production) {
parsedStates = parsedStates.replace(